Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,583 Members 38,267 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][CM9/CM10] How to Add BRIGHTNESS SLIDER TO NOTIFICATION PANEL

Tip us?
 
Adi Aisiteru Reborn
Old
(Last edited by Adi Aisiteru Reborn; 14th June 2013 at 05:06 AM.) Reason: Change tittle : GUIDE WORK TO CM9 TOO
#1  
Adi Aisiteru Reborn's Avatar
Senior Member - OP
Thanks Meter 4,456
Posts: 1,648
Join Date: Apr 2013
Location: Bandar Lampung
Default [GUIDE][CM9/CM10] How to Add BRIGHTNESS SLIDER TO NOTIFICATION PANEL

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://forum.xda-developers.com/show....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" />
        <include layout="@layout/adi_brightness" />
        <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>
   <include layout="@layout/adi_brightness" />
   </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" android:background="#ff000000" 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://forum.xda-developers.com/show....php?t=2230063

and Galaxy Nexus http://forum.xda-developers.com/show....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
Attached Thumbnails
Click image for larger version

Name:	user5204709_pic34657_1365657471.png
Views:	3071
Size:	19.4 KB
ID:	1942997  
Attached Files
File Type: zip Source_Brightness_HDPI.zip - [Click for QR Code] (20.2 KB, 404 views)
File Type: zip Source_Brightness_LDPI.zip - [Click for QR Code] (18.9 KB, 124 views)
File Type: zip Source_Brightness_MDPI.zip - [Click for QR Code] (18.9 KB, 181 views)
File Type: zip Source_Brightness_XHDPI.zip - [Click for QR Code] (20.7 KB, 116 views)
The Following 18 Users Say Thank You to Adi Aisiteru Reborn For This Useful Post: [ Click to Expand ]
 
Adi Aisiteru Reborn
Old
#2  
Adi Aisiteru Reborn's Avatar
Senior Member - OP
Thanks Meter 4,456
Posts: 1,648
Join Date: Apr 2013
Location: Bandar Lampung
Reserved for something
The Following 3 Users Say Thank You to Adi Aisiteru Reborn For This Useful Post: [ Click to Expand ]
 
MicroLizard
Old
#3  
MicroLizard's Avatar
Senior Member
Thanks Meter 200
Posts: 246
Join Date: Feb 2012
Location: Bandung, ID

 
DONATE TO ME
will this mod work on CM10.1 ?

Sorry for my bad English.
'
'

Device : Samsung Galaxy Ace GT-S5830
ROM : CM10.2 - modded - [nightly-20131206]
Kernel : MA6 Kernel [CM10.2 - 20131208]
Apps : Nova Launcher Prime | Autostarts | Seeder | Link2SD | Dodol Keyboard | Xposed - XuiMod, XVolume30, RemoveUSBStorageWarning, BlackHoloBackground, Tinted Status Bar.
 
Adi Aisiteru Reborn
Old
#4  
Adi Aisiteru Reborn's Avatar
Senior Member - OP
Thanks Meter 4,456
Posts: 1,648
Join Date: Apr 2013
Location: Bandar Lampung
Quote:
Originally Posted by MicroLizard View Post
will this mod work on CM10.1 ?
No , still force close..
I still try and try to get it working..

PS : But it will work to CM9

Sent from my GT-I8150 using xda app-developers app
The Following User Says Thank You to Adi Aisiteru Reborn For This Useful Post: [ Click to Expand ]
 
MicroLizard
Old
#5  
MicroLizard's Avatar
Senior Member
Thanks Meter 200
Posts: 246
Join Date: Feb 2012
Location: Bandung, ID

 
DONATE TO ME
Quote:
Originally Posted by Adi Aisiteru Reborn View Post
No , still force close..
I still try and try to get it working..

PS : But it will work to CM9

Sent from my GT-I8150 using xda app-developers app
Yes, I've tried and it give me force close.

Sorry for my bad English.
'
'

Device : Samsung Galaxy Ace GT-S5830
ROM : CM10.2 - modded - [nightly-20131206]
Kernel : MA6 Kernel [CM10.2 - 20131208]
Apps : Nova Launcher Prime | Autostarts | Seeder | Link2SD | Dodol Keyboard | Xposed - XuiMod, XVolume30, RemoveUSBStorageWarning, BlackHoloBackground, Tinted Status Bar.
 
androidphone2012
Old
(Last edited by androidphone2012; 7th May 2013 at 07:38 PM.)
#6  
Senior Member
Thanks Meter 416
Posts: 385
Join Date: Feb 2012
Big thanks!!
Nexus S retired
 
LoLaTiOn
Old
#7  
LoLaTiOn's Avatar
Recognized Contributor
Thanks Meter 9,114
Posts: 2,646
Join Date: Feb 2012
Location: Tours
Thank you bro work fine
Attached Thumbnails
Click image for larger version

Name:	Brightness_bar.jpg
Views:	941
Size:	20.2 KB
ID:	1943383  
Current Projects and Rom's
If you donate, give priority at dhiru1602 to improve Custom Rom's Collections

The Following User Says Thank You to LoLaTiOn For This Useful Post: [ Click to Expand ]
 
Adi Aisiteru Reborn
Old
#8  
Adi Aisiteru Reborn's Avatar
Senior Member - OP
Thanks Meter 4,456
Posts: 1,648
Join Date: Apr 2013
Location: Bandar Lampung
Quote:
Originally Posted by androidphone2012 View Post
Big thanks!!
Screenshot will be appreciated

Sent from my GT-I8150 using xda app-developers app
The Following 2 Users Say Thank You to Adi Aisiteru Reborn For This Useful Post: [ Click to Expand ]
 
Omar1c
Old
#9  
Omar1c's Avatar
Senior Member
Thanks Meter 788
Posts: 1,203
Join Date: Apr 2013
Location: Buckeye
Awesome bro!!

Sent from my Galaxy Nexus using xda premium
 
Adi Aisiteru Reborn
Old
(Last edited by Adi Aisiteru Reborn; 8th May 2013 at 10:36 AM.)
#10  
Adi Aisiteru Reborn's Avatar
Senior Member - OP
Thanks Meter 4,456
Posts: 1,648
Join Date: Apr 2013
Location: Bandar Lampung
Quote:
Originally Posted by Omar1c View Post
Awesome bro!!

Sent from my Galaxy Nexus using xda premium
I want to write another porting Guide, CM10 O4x style lockscreen, will you test it for XHDPI version ?.
I 'll use your file framework , but before you test it, make sure you revert back to stok theme first, without mod installed on your device.
I'll send you PM when the flashable zip is ready

Edit : Done for the porting guide

The Following User Says Thank You to Adi Aisiteru Reborn For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes