Post Reply

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

OP lidroid

5th October 2011, 11:53 AM   |  #1  
lidroid's Avatar
OP Senior Member
Flag Xi'an
Thanks Meter: 887
 
207 posts
Join Date:Joined: May 2011
Donate to Me
More
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:	49407
Size:	52.1 KB
ID:	740786   Click image for larger version

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

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

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

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

Click image for larger version

Name:	SC20111015-145358.jpg
Views:	22497
Size:	23.4 KB
ID:	750403  
Attached Files
File Type: apk lidroid-res.apk - [Click for QR Code] (1,019.4 KB, 15808 views)
File Type: apk LidroidSystemUI.apk - [Click for QR Code] (34.2 KB, 14490 views)
File Type: apk QuickPanelSettings.apk - [Click for QR Code] (54.4 KB, 15485 views)
Last edited by lidroid; 16th October 2011 at 05:56 PM.
The Following 275 Users Say Thank You to lidroid For This Useful Post: [ View ]
5th October 2011, 12:23 PM   |  #2  
89luca89's Avatar
Retired Recognized Developer
Flag Terracina (LT)
Thanks Meter: 1,383
 
1,186 posts
Join Date:Joined: Apr 2010
Donate to Me
More
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!
The Following 3 Users Say Thank You to 89luca89 For This Useful Post: [ View ]
5th October 2011, 02:43 PM   |  #3  
lidroid's Avatar
OP Senior Member
Flag Xi'an
Thanks Meter: 887
 
207 posts
Join Date:Joined: May 2011
Donate to Me
More
Quote:
Originally Posted by 89luca89

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: [ View ]
5th October 2011, 03:54 PM   |  #4  
89luca89's Avatar
Retired Recognized Developer
Flag Terracina (LT)
Thanks Meter: 1,383
 
1,186 posts
Join Date:Joined: Apr 2010
Donate to Me
More
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
5th October 2011, 03:56 PM   |  #5  
Senior Member
Flag Muscat
Thanks Meter: 140
 
381 posts
Join Date:Joined: Aug 2011
Screenshots please...
5th October 2011, 04:09 PM   |  #6  
D.O.C's Avatar
Senior Moderator / Recognized Developer - The Android Surgeon
Thanks Meter: 3,744
 
3,098 posts
Join Date:Joined: Jun 2006
Donate to Me
More
Nice bro....this is what we need.....nice
5th October 2011, 04:45 PM   |  #7  
lidroid's Avatar
OP Senior Member
Flag Xi'an
Thanks Meter: 887
 
207 posts
Join Date:Joined: May 2011
Donate to Me
More
Quote:
Originally Posted by akbarhash

Screenshots please...

I have uploaded screenshots as attachment.
The Following 8 Users Say Thank You to lidroid For This Useful Post: [ View ]
5th October 2011, 05:42 PM   |  #8  
Junior Member
Thanks Meter: 1
 
27 posts
Join Date:Joined: Jan 2008
This way you can add a shortcut to the application?
I know silly question

thank you very much
sorry for my English
Last edited by kolo200; 5th October 2011 at 05:44 PM.
5th October 2011, 05:55 PM   |  #9  
Senior Member
Flag Muscat
Thanks Meter: 140
 
381 posts
Join Date:Joined: Aug 2011
Quote:
Originally Posted by lidroid

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: [ View ]
5th October 2011, 07:18 PM   |  #10  
ephumuris's Avatar
Senior Member
Flag Hull
Thanks Meter: 480
 
3,145 posts
Join Date:Joined: Dec 2008
More
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?
Last edited by ephumuris; 5th October 2011 at 07:34 PM.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy S II Android Development by ThreadRank