How to Add BRIGHTNESS SLIDER TO NOTIFICATION PANEL for CM9 & CM10
Hi..Hi..Hello XDA , especially for Developer only
I want to share to you all how to add brigtness slider to notification panel for your Devices running CyanogenMod 9 & 10
Basically the guide is for Gingerbread, and I use all smali file and code from here http://xdaforums.com/showthread.php?t=2152370
so full credit goes to evanlocked
I just made some change and fix to suit for Device running CM9 & CM10
WARNING !!!
But there is a little bug on this Mod, if you enable Automatic Brightness from your SETTINGS - DISPLAY -BRIGHTNESS - , the Brightness bar will dissappear from notification panel, and never want to show again, so make sure before and after applying this mod, never to do that
SEE THE SCREENSHOT :
If you can see, there is an Automatic brightness check box,
and the check box is only a fake check box, doesn't have accessibility to access Automatic brightness of our Device. so you are free to tick/check list it, and brightness slider will not dissapear.
ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
Hi..Hi..Hello XDA , especially for Developer only
I want to share to you all how to add brigtness slider to notification panel for your Devices running CyanogenMod 9 & 10
Basically the guide is for Gingerbread, and I use all smali file and code from here http://xdaforums.com/showthread.php?t=2152370
so full credit goes to evanlocked
I just made some change and fix to suit for Device running CM9 & CM10
WARNING !!!
But there is a little bug on this Mod, if you enable Automatic Brightness from your SETTINGS - DISPLAY -BRIGHTNESS - , the Brightness bar will dissappear from notification panel, and never want to show again, so make sure before and after applying this mod, never to do that
SEE THE SCREENSHOT :
If you can see, there is an Automatic brightness check box,
and the check box is only a fake check box, doesn't have accessibility to access Automatic brightness of our Device. so you are free to tick/check list it, and brightness slider will not dissapear.
ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
STEP 1
Decompile your SytemUI.apk, go to
res/values/ids.xml
and add this line to the end
Code:
<item type="id" name="automatic">false</item>
NEXT - STEP -2
res/values/strings.xml
Add these two lines to the end
Code:
<string name="brightness_settings_automatic">AUTO</string>
<string name="brightness_settings_title" />
NEXT - STEP -3 for CM10
res/layout/status_bar_expanded.xml
and add the RED line code
Code:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel" android:background="@drawable/notification_panel_bg" android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network" android:gravity="center" android:layout_gravity="bottom" android:id="@id/carrier_label" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="@dimen/carrier_label_height" android:layout_marginBottom="@dimen/close_handle_height" />
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_header_height" layout="@layout/status_bar_expanded_header" />
<com.android.systemui.statusbar.powerwidget.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="@dimen/notification_panel_widget_height" />
[COLOR="Red"]<include layout="@layout/adi_brightness" />[/COLOR]
<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="always">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_row_min_height" />
</ScrollView>
</LinearLayout>
<com.android.systemui.statusbar.phone.CloseDragHandle android:layout_gravity="bottom" android:orientation="vertical" android:id="@id/close" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height">
<ImageView android:layout_gravity="bottom" android:layout_width="fill_parent" android:layout_height="@dimen/close_handle_height" android:src="@drawable/status_bar_close" android:scaleType="fitXY" />
</com.android.systemui.statusbar.phone.CloseDragHandle>
</FrameLayout>
NEXT - STEP -3 for CM9
add the RED LINE
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout android:orientation="vertical" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.powerwidget.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<RelativeLayout android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
<ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
<ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
[COLOR="Red"]<include layout="@layout/adi_brightness" />[/COLOR]
</LinearLayout>
<View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@*android:style/TextAppearance.Large" android:gravity="left" android:layout_gravity="top" android:id="@id/noNotificationsTitle" android:padding="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_height" />
</LinearLayout>
</ScrollView>
<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
</FrameLayout>
</com.android.systemui.statusbar.phone.ExpandedView>
NEXT - STEP -4
FOR CM9, YOU JUST SKIP THIS STEP-4 !!!
res/layout/status_bar_expanded_header
LINE xml 2
Code:
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" [COLOR="Red"]android:background="#ff000000"[/COLOR] android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false"
NEXT - STEP -5
Download the brightness bar source according to your device category :
Source_Brightness_HDPI
Source_Brightness_XHDPI
Source_Brightness_MDPI
Source_Brightness_LDPI
NEXT - STEP -6
Extract you have downloaded and merge it to your decompiled SytemUI.apk
Done and Recompile
I''ve made for my device Galaxy Wonder (HDPI) http://xdaforums.com/showthread.php?t=2230063
and Galaxy Nexus http://xdaforums.com/showthread.php?t=2265104
thanks to Omar1c for testing it
CREDIT & THANKS
arco
evanlocked
Omar1c
Galaxy Nexus xda themes forum
Galaxy wonder xda themes forum
XDA
CyanogenMod
ApkMultitools
and all of you , sorry if I missed
Attachments
Last edited: