5,600,335 Members 35,077 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE]How to add customizable 14 statusbar toggle buttons for samsung ROM

Tip us?
 
lidroid
Old
(Last edited by lidroid; 16th October 2011 at 05:56 PM.)
#1  
lidroid's Avatar
Senior Member - OP
Thanks Meter 872
Posts: 207
Join Date: May 2011
Location: Xi'an

 
DONATE TO ME
Default [GUIDE]How to add customizable 14 statusbar toggle buttons for samsung ROM

I rebuild status bar power button in samsung rom in my national day holiday, now it has 14 buttons now, include all samsung buttons, wifi, data connection, gps, flashlight, sound, auto rotation, bluetooth, brightness, screen timeout, lock screen, sync, reboot and power down. Actually early time I coded some of those function in LidroidToolbox, but not included them in status bar. I actually rebuilt it with java, not just mod of samli.

This code can adapt to samsung i9000/i9100/i897/t959/m110s etc. I will port this in my new rom. The flashflight will display a white and brightest activity when the camera without flashlight, for example i9000/i897/t959/m110s etc.

Next I will explain how to adapt it to samsung 2.3 rom. There are 3 attachments QuickPanelSettings.apk, LidroidSystemUI.apk and lidroid-res.apk.

1. Download LidroidSystemUI.apk and decompile it whit apktool, then you get LidroidSystemUI dir.

2. Decompile SystemUI.apk, copy LidroidSystemUI/smali/* into SystemUI/smali.

3. Modify SystemUI/AndroidManifeset.xml, add this code before </Application>
Code:
      <activity android:name="com.lidroid.systemui.quickpanel.FlashlightActivity"
		android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
		android:clearTaskOnLaunch="true"
		android:configChanges="orientation|keyboardHidden"
		android:launchMode="singleTask" />
if your model has flashlight, you can skip this step.

4. Open SystemUI/smali/com/android/systemui/status/StatusBarService.smali. Find(Ctrl + F) QuickSettingsView, locate fellow codes
Code:
    const v7, 0x7f030002

    invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    check-cast v3, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;

    .line 379
    .local v3, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
modify

Code:
    const v7, 0x3030003

    invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    check-cast v3, Lcom/lidroid/systemui/quickpanel/PowerWidget;

    .line 394
    .local v3, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
    invoke-virtual {v3}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
5. Compile SystemUI with apktool, Sign it if you have modify AndroidManifest.xml. Push it into /system/app/

6. push lidroid-res.apk in /system/framework/, push QuickPanelSettings.apk in /system/app, reboot.


Simplicity, no need to modify layout, id and Strings which is painful. If you know how to do it, you will know how simple it is. Any android/rom developer can download this code and add more buttons.

Enjoy!
Attached Thumbnails
Click image for larger version

Name:	20111005114101.jpg
Views:	47901
Size:	52.1 KB
ID:	740786   Click image for larger version

Name:	20111005114110.jpg
Views:	33418
Size:	53.0 KB
ID:	740787   Click image for larger version

Name:	20111005114118.jpg
Views:	31567
Size:	52.6 KB
ID:	740788   Click image for larger version

Name:	SC20111015-145333.jpg
Views:	24356
Size:	18.6 KB
ID:	750401   Click image for larger version

Name:	SC20111015-145344.jpg
Views:	30433
Size:	29.0 KB
ID:	750402  

Click image for larger version

Name:	SC20111015-145358.jpg
Views:	21907
Size:	23.4 KB
ID:	750403  
Attached Files
File Type: apk lidroid-res.apk - [Click for QR Code] (1,019.4 KB, 14310 views)
File Type: apk LidroidSystemUI.apk - [Click for QR Code] (34.2 KB, 13114 views)
File Type: apk QuickPanelSettings.apk - [Click for QR Code] (54.4 KB, 14001 views)
The Following 271 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
 
89luca89
Old
#2  
89luca89's Avatar
Recognized Developer
Thanks Meter 1383
Posts: 1,186
Join Date: Apr 2010
Location: Terracina (LT)

 
DONATE TO ME
thank you very much for this work!
I will study the code and try to develop also new toggles

Little question, the java source (god bless you! I HATE Smali! xD) is about systemUI, what about lildroid-res.apk?
Is it only a "complementar" framework for icons and string for the toggles? Or whatelse?
Just curiosity and little question to better understand the project!

Thx!
If you like my work, you can buy me a coffe if you want


>>> THE GingerMOD (AOSPized XXKG&) for SGS2!
>>> THE FroyoMOD (AOSP) For Milestone<<<
>>> ROM:EclairMOD v0.3b For Milestone <<<
>>>Androidiani OpenRecovery by ME & Azhad For Milestone!<<<

Samsung Galaxy S2 i9100, Rom TheGingerMOD
Motorola Milestone, Rom TheFroyoMOD, 1,1ghz LV

Nokia n97mini IoEsisto v8 CFW
Nokia e51 hacked
Nokia n800 Maemo/Android 1.6
The Following 3 Users Say Thank You to 89luca89 For This Useful Post: [ Click to Expand ]
 
lidroid
Old
#3  
lidroid's Avatar
Senior Member - OP
Thanks Meter 872
Posts: 207
Join Date: May 2011
Location: Xi'an

 
DONATE TO ME
Quote:
Originally Posted by 89luca89 View Post
thank you very much for this work!
I will study the code and try to develop also new toggles

Little question, the java source (god bless you! I HATE Smali! xD) is about systemUI, what about lildroid-res.apk?
Is it only a "complementar" framework for icons and string for the toggles? Or whatelse?
Just curiosity and little question to better understand the project!

Thx!
I compiled all required images, strings and layout that toggle buttons into lidroid-res.apk to make the future ROM transplant work easier and finish the new ROM's mod work faster.
The Following 13 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
 
89luca89
Old
#4  
89luca89's Avatar
Recognized Developer
Thanks Meter 1383
Posts: 1,186
Join Date: Apr 2010
Location: Terracina (LT)

 
DONATE TO ME
Ok understood thx that was only what I need to know
Maybe with a little more work can try to fuse it with framework.apk or twframework.apk but for now just knowing that will make things clearer to me
If you like my work, you can buy me a coffe if you want


>>> THE GingerMOD (AOSPized XXKG&) for SGS2!
>>> THE FroyoMOD (AOSP) For Milestone<<<
>>> ROM:EclairMOD v0.3b For Milestone <<<
>>>Androidiani OpenRecovery by ME & Azhad For Milestone!<<<

Samsung Galaxy S2 i9100, Rom TheGingerMOD
Motorola Milestone, Rom TheFroyoMOD, 1,1ghz LV

Nokia n97mini IoEsisto v8 CFW
Nokia e51 hacked
Nokia n800 Maemo/Android 1.6
 
akbarhash
Old
#5  
Senior Member
Thanks Meter 140
Posts: 381
Join Date: Aug 2011
Location: Muscat
Screenshots please...
 
D.O.C
Old
#6  
D.O.C's Avatar
Senior Moderator / Recognized Developer - The Android Surgeon
Thanks Meter 3695
Posts: 3,067
Join Date: Jun 2006

 
DONATE TO ME
Nice bro....this is what we need.....nice

 
lidroid
Old
#7  
lidroid's Avatar
Senior Member - OP
Thanks Meter 872
Posts: 207
Join Date: May 2011
Location: Xi'an

 
DONATE TO ME
Quote:
Originally Posted by akbarhash View Post
Screenshots please...
I have uploaded screenshots as attachment.
The Following 8 Users Say Thank You to lidroid For This Useful Post: [ Click to Expand ]
 
kolo200
Old
(Last edited by kolo200; 5th October 2011 at 05:44 PM.)
#8  
Junior Member
Thanks Meter 0
Posts: 23
Join Date: Jan 2008
This way you can add a shortcut to the application?
I know silly question

thank you very much
sorry for my English
 
akbarhash
Old
#9  
Senior Member
Thanks Meter 140
Posts: 381
Join Date: Aug 2011
Location: Muscat
Quote:
Originally Posted by lidroid View Post
I have uploaded screenshots as attachment.
Thanks.
Tip: Home Button + Power Button = Screenshot.
The Following 2 Users Say Thank You to akbarhash For This Useful Post: [ Click to Expand ]
 
ephumuris
Old
(Last edited by ephumuris; 5th October 2011 at 07:34 PM.)
#10  
ephumuris's Avatar
Senior Member
Thanks Meter 443
Posts: 3,048
Join Date: Dec 2008
Location: Hull
This is disgustingly good work i'm really impressed...

Hmm the line numbers don't seem to match on my rom stock ki3 does that matter?
Very hungry. I want Gingerbread.

Join GiffGaff and earn Payback yourself. The mobile network run by YOU.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes