Where Customization Begins 

  • How to add customizable 14 statusbar toggle for Samsung ROM

 #20958  by Neuropass
 29 Dec 2011, 01:35
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: Select all<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: Select allconst 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: Select allconst 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!


Image



Download:
File Type: apk lidroid-res.apk
File Type: apk LidroidSystemUI.apk
File Type: apk QuickPanelSettings.apk


Source: Here.