5,605,250 Members 38,484 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] Brightness Slider Guide Stock GB CM7/CM9- Rewritten To Make It Easy To Follow

Tip us?
 
marcussmith2626
Old
(Last edited by marcussmith2626; 21st April 2014 at 01:51 PM.)
#1  
marcussmith2626's Avatar
Recognized Contributor - OP
Thanks Meter 1737
Posts: 3,401
Join Date: Jul 2012
Location: London

 
DONATE TO ME
Default [GUIDE] Brightness Slider Guide Stock GB CM7/CM9- Rewritten To Make It Easy To Follow

Brightness Slider Guide


I have re-written the guide by @evanlocked with his permission as some people had trouble following his guide so I'll try to make it simple to follow steps
Full credit goes to him for the original guide and steps - All I have done is present it and re-write it in a different way to make it more understandable and iv also added steps for different layouts depending on what rom you are using

The original thread can be found
http://forum.xda-developers.com/show....php?t=2152370


1 - Download the attachment and unzip the folder

2 - Decompile your SystemUI.apk with apktool

3 - Open the downloaded attachment and copy the files within to the following locations to your decompiled SystemUI folder
Note if you dont have the folder for the smali eg lidroid just create it

smali\com\lidroid\systemui\quickpanel
BrightnessSlider$BrightnessSettingsObserver.smali
BrightnessSlider.smali

smali\com\android\systemui\statusbar
SlideBrightness$1.smali
SlideBrightness$2.smali
SlideBrightness.smali

smali\com\android\systemui\statusbar\quickpanel
BrightnessSettingsView$1.smali
BrightnessSettingsView$AutomaticObserver.smali
BrightnessSettingsView$BrightnessObserver.smali

res\drawable
brightness_seekbar.xml

res\layout
qp_brightness.xml
quickpanel_brightness_settings.xml

res\drawable-ldpi (or -mdpi and so on depending on your phone res)
brightness_bg.png
ic_brightness.png
quickpanel_brightness_icon.png


4 - Open res/values/strings.xml with notepad++

above </resources> place the following

Code:
<string name="brightness_settings_title" />
    <string name="brightness_settings_automatic" />

5 - Open res/values/ids.xml with notepad++

above </resources> place the following (note cm9 dont add <item type="id" name="brightness">false</item> as its already defined)

Code:
<item type="id" name="title">false</item>
    <item type="id" name="brightness">false</item>
	<item type="id" name="automatic">false</item>

6 - Open res/layout/status_bar_expanded.xml

This step will vary depending on rom so I will give a few examples


Example 1 - Stock Gingerbread (deodexed)

Under
Code:
 <com.android.systemui.statusbar.NotificationLinearLayout android:orientation="vertical" android:id="@id/notificationLinearLayout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="6.0dip">
Place
Code:
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    <include layout="@layout/qp_brightness" />
                </LinearLayout>

Example 2 - CM7

Under
Code:
 <com.android.systemui.statusbar.StatusBarJellyHeaderView android:layout_width="wrap_content" android:layout_height="wrap_content" />
            <TextView android:textSize="14.0sp" android:textColor="#ffffffff" android:layout_gravity="center_vertical" android:id="@id/clear_all_button" android:paddingLeft="15.0dip" android:paddingRight="15.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="4.0dip" android:layout_marginBottom="1.0dip" android:text="@string/status_bar_clear_all_button" style="StatusBar.ClearButton" />
Place
Code:
<include layout="@layout/qp_brightness" />

Example 3 - CM9

Above
Code:
 <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
Place
Code:
<LinearLayout android:orientation="horizontal" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="wrap_content">
                    <include layout="@layout/qp_brightness" />
                </LinearLayout>
    <View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />


7 - This step is optional and is for the icon next to the brightness slider

open res/layout/qp_brightness.xml

Look at
Code:
 <ImageView android:paddingLeft="3.0px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_brightness" />
This is the line for the image - change it how you like if you want to

note - to change the icon just replace ic_brightness.png that you placed in res/drawable-ldpi (or mdpi and so on) with one of your choice but make sure the filename remains ic_brightness.png


8 - Recompile and sign - if you are using cm7/9 sign the apk with a platform key using zip signer (playstore)

9 - Put in a flashable zip and flash in cwm with system mounted





credits
evanlocked
Attached Files
File Type: zip Brightness_Slider_Files.zip - [Click for QR Code] (16.5 KB, 4 views)

My Work And Threads For Galaxy Y GT-S5360


My PM is not a Question & Answer thread - Dont treat it as such!
The Following 2 Users Say Thank You to marcussmith2626 For This Useful Post: [ Click to Expand ]
 
Mranggapo
Old
(Last edited by Mranggapo; 19th April 2014 at 02:45 PM.)
#2  
Senior Member
Thanks Meter 80
Posts: 622
Join Date: Mar 2013
Location: Jakarta
Will follow this one

EDIT:
thanks @marcussmith2626
workin perfectly
no force close or what
Dont say newbie user a noob, once upon a time you were a noob too

The Following User Says Thank You to Mranggapo For This Useful Post: [ Click to Expand ]
Tags
brightness slider, cm7, cm9, gingerbread, status bar
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Cloupload is a Beautiful and Fully Functional CloudApp Client for Android

If you’re a Mac OS X user who frequently uploads screenshots, … more

Microsoft Finally Brings Remote Desktop to Windows Phone

You may recall that back in October of last year, Microsoft released itsofficial … more

SideControl Gains New Powers through Xposed

You may recall that a little overa month ago, we first talked about SideCutsby XDA Forum … more

Leak Points to Windows Start Menu’s Return as Soon as August

About a month ago at this year’s Build conference, Microsoft … more