[Android Themes] Adi Aisiteru Reborn:
HOW TO PORT LIDROID TOGGLES

TO NON SAMSUNG JELLY BEAN ROM

Oke guys, I want to share how to port Lidroid toggle to all non Samsung Jelly Bean 4.1 rom ,

do not try this on 4.0/4.2/4.3 or you will ended with SystemUI force closes

Credit & Thank you very much , to lidroid, and Wanam for Guide [MOD][Android 4.1.2] Add Customizable 23 Statusbar Toggles To Samsung Jelly bean Roms,. and Thanks too to peetr_I learn some code from his thread [MOD][JB][ICS] Xperia T/TX/V port of Lidroid power widget,. and also thanks to

XDA.AGM I learn some code from his thread too [ JB ] [ A.0.400/1.100 ] [ XP-XU ]SystemUI with Lidroid Custom 18 Toggles [version 6], and you must thanks them too :)

and also thanks to [MENTION=4987653]BOND1987[/MENTION] for testing it on mediatek device

and also Thanks to Recognized themer [MENTION=3989065]serajr[/MENTION] for some toggles created by him

so we are going to port 20 Lidroid toggles :

( -Lock screen/screen-off action, -Reboot action, -Shutdown action, -Airplane mode, -Bluetoth, -Brightness, -GPS, -Flashlight, -Lockscreen, -MobileData, -Orientation, -ScreenTimeOut, -Sound, -Sync, -Wi-fi, -Wi-fi Hotspot, Battery info, Stay awake, USB Connection mode, USB Debugging )

NOTE !! for CyanogenMod 10 , do not follow or use this guide,. you can just flash my mod from here http://xdaforums.com/showthread.php?t=2333075

Many users from different device reported work on their devices

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

- Know how to decompile/recompiling jar Apk file

- notepad++

- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else

1. Decompile settings.apk

go to : res/xml/settings_header.xml and add the Blue code :

<header android:icon="@drawable/ic_settings_cmlauncher" android:id="@id/launcher_settings" android:title="@string/launcher_settings_title" />
<header android:icon="@drawable/ic_settings_lockscreen" android:id="@id/lock_screen_settings" android:title="@string/lock_screen_title" android:fragment="com.android.settings.cyanogenmod.LockscreenInterface" />
<header android:icon="@drawable/ic_settings_themes" android:id="@id/themes_settings" android:title="@string/themes_settings_title">
<intent android:targetPackage="com.tmobile.themechooser" android:action="android.intent.action.MAIN" android:targetClass="com.tmobile.themechooser.ThemeChooser" />
</header>
<header android:icon="@drawable/ic_settings_system" android:id="@id/system_settings" android:title="@string/system_settings_title" android:fragment="com.android.settings.cyanogenmod.SystemSettings" />
[COLOR="Blue"]<header android:icon="@drawable/ic_settings_advanced" android:id="@id/adi_buttons" android:title="@string/adi_buttons_title">
<intent android:targetPackage="com.lidroid.settings" android:action="android.intent.action.MAIN" android:targetClass="com.lidroid.settings.Settings" />
</header>[/COLOR]
<header android:title="@string/header_category_device" />
<header android:icon="@drawable/ic_settings_sound" android:id="@id/sound_settings" android:title="@string/sound_settings" android:fragment="com.android.settings.SoundSettings" />
<header android:icon="@drawable/ic_settings_display" android:id="@id/display_settings" android:title="@string/display_settings" android:fragment="com.android.settings.DisplaySettings" />

- res/values/ids.xml

[COLOR="Blue"]<item type="id" name="adi_buttons">false</item>[/COLOR]

- res/values/strings.xml

[COLOR="Blue"]<string name="adi_buttons_title">Power Widget</string>[/COLOR]

- res/values/drawable-hdpi

add this PNG image http://d-h.st/mQp

Done & recompile : push to system/app with right permission

NOTE !!, you can skip steps for editing Settings.apk, but don't use Lidroid_setings.apk bellow,. you must use this Version Lidroid_settings.apk by [MENTION=4641889]akash akya[/MENTION],. go here : http://xdaforums.com/showpost.php?p=44062624&postcount=34

Credit & Thanks to [MENTION=4641889]akash akya[/MENTION]

Don't forget to press His THANKS BUTTON

2. Download this Lidroid_Settings.apk push to system/app with right permission

3. Decompile SystemUI.apk, Download this : Sources_Lidroid_SystemUI.apk

exstract it and merge to your decompiled SystemUI.apk

NOTE !!, if your device has arrays.xml in res/values/here

please do check again the Sources_Lidroid_SystemUI.apk and adapt the arrays.xml code in it with yours

4. Add the blue code :

- res/values/ids.xml

[COLOR="Blue"]<item type="id" name="power_widget_button_text">false</item>
<item type="id" name="power_widget_button_indic">false</item>
<item type="id" name="adi_widget">false</item>
<item type="id" name="automatic">false</item>
<item type="id" name="power_widget_button">false</item>
<item type="id" name="power_widget_button_image">false</item>[/COLOR]

- res/values/strings.xml

[COLOR="Blue"]
<string name="usb_connected_txt">USB connected</string>
<string name="quickpanel_wifi_text">Wi-Fi</string>
<string name="quickpanel_dc_text">Data</string>
<string name="quickpanel_network_mode_text">Network</string>
<string name="quickpanel_sound_text">Sound</string>
<string name="quickpanel_sound_vibration_text">Sound vibration</string>
<string name="quickpanel_silent_text">Silent</string>
<string name="quickpanel_vibration_text">Vibration</string>
<string name="quickpanel_rotation_text">Rotation</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</string>
<string name="quickpanel_autosync_text">Auto Sync</string>
<string name="quickpanel_brightness_text">Brightness</string>
<string name="quickpanel_screen_timeout_text">Timeout</string>
<string name="quickpanel_lockscreen_text">Lockscreen</string>
<string name="quickpanel_airplane_text">Flightmode</string>
<string name="quickpanel_flashlight_text">Flashlight</string>
<string name="quickpanel_reboot_text">Reboot</string>
<string name="quickpanel_shutdown_text">Shutdown</string>
<string name="airplane_mode">In Flight mode</string>
<string name="shutdown_confirm">Your phone will shut down.</string>
<string name="screen_timeout_seconds">Screen timeout set to: %d second(s)</string>
<string name="screen_timeout_minutes">Screen timeout set to: %d minute(s)</string>
<string name="screen_timeout_hours">Screen timeout set to: %d hour(s)</string>
<string name="hamster">Phone Options</string>
<string name="yes">OK</string>
<string name="no">Cancel</string>
<string name="reboot">Reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="reboot_download">Download</string>
<string name="quickpanel_nfc_text">NFC</string>
<string name="quickpanel_wifi_ap_text">Wifi AP</string>
<string name="quickpanel_lockscreen_action_text">Lock Now</string>
<string name="quickpanel_androidbeam_text">Android Beam</string>
<string name="brightness_settings_automatic">AUTO</string>
<string name="brightness_settings_title" />
<string name="quickpanel_usb_debugging_text">USB Debugging</string>
<string name="quickpanel_usb_connection_mode_text">USB Conn. Mode</string>
<string name="quickpanel_usb_current_mtp_title">Current mode: MPT</string>
<string name="quickpanel_usb_current_msc_title">Current mode: MSC</string>
<string name="usb_mpt_mode">MPT - Media Transfer</string>
<string name="usb_msc_mode">MSC - Mass Storage</string>
<string name="quickpanel_stay_awake_plugged_text">Stay Awake</string>
<string name="quickpanel_battery_info_text">Battery Info</string>
<string name="battery_info_info">Battery Information</string>
<string name="battery_info_usage">Battery Power Usage</string>
[/COLOR]

- res/values/integers.xml

[COLOR="Blue"]<integer name="quickpanel_scroll_threshold_port">5</integer>
<integer name="quickpanel_scroll_threshold_land">8</integer>[/COLOR]

- smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali

.field mPixelFormat:I

.field mPositionTmp:[I

.field mPostCollapseCleanup:Ljava/lang/Runnable;

[COLOR="Blue"].field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]

.field private mPreviousConfigFontScale:F

.field private mPrevioutConfigOrientation:I

.field mQueueLock:Ljava/lang/Object;

Next find this method

# virtual methods
.method public addIcon(Ljava/lang/String;IILcom/android/internal/statusbar/StatusBarIcon;)V

and Add the blue code above .return-void

invoke-virtual {v1, v0, p3, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

[COLOR="Blue"]iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->updateWidget()V[/COLOR]

.line 826
return-void
.end method

Next find this method

.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

scroll down still in that method ,

find the Green code, and add the blue code above it

iget-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const [COLOR="Red"]v10[/COLOR], 0x7f0c0044

invoke-virtual {[COLOR="Red"]v9, v10[/COLOR]}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object [COLOR="Red"]v9[/COLOR]

check-cast [COLOR="Red"]v9[/COLOR], Landroid/widget/ScrollView;

iput-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

.line 528
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

const/4 v10, 0x0

invoke-virtual {v9, v10}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V

[COLOR="Blue"]iget-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

.line 444
const [COLOR="Red"]v10[/COLOR], 0x7f0c00da

invoke-virtual {[COLOR="Red"]v9, v10[/COLOR]}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

.line 445
move-result-object [COLOR="Red"]v9[/COLOR]

check-cast [COLOR="Red"]v9[/COLOR], Lcom/lidroid/systemui/quickpanel/PowerWidget;

iput-object [COLOR="Red"]v9[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;[/COLOR]

.line 530
[COLOR="Green"]new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;

iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

invoke-direct {v9, p0, v1, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V

iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;
[/COLOR]

Pay attentiion on the red code in the part of blue code, it have to be wriiten the same like above/previous part

Next go to post #2