[Android Themes] akash akya:
PART 2 : add lidroid toggles

PART 2 : add Lidroid Toggles to QuickPanel

You must have working Quick panel view before trying this mod... follow first step to add quick panel view

You may also try.... [MENTION=4987653]BOND1987[/MENTION] guide here for them who have already implimented lidroid in normal view thanks to him... (y)

step 1 :

decompile systemUI.apk, merge the files i have given...

goto : res/values/ids.xml add these at the end :

<item type="id" name="power_widget_button_text">false</item>
<item type="id" name="power_widget_button_indic">false</item>
<item type="id" name="power_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>

goto : res/values/strings.xml add these at the end

<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>

step 2 :

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

find :

.field mPostCollapseCleanup:Ljava/lang/Runnable;

add this below it :

.field mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

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

step 3 :

find line similer to these

new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;

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

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

iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;

above it you will see some thing like this,

iget-object [COLOR="red"]v11[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

const/4[COLOR="red"] v12[/COLOR], 0x0

invoke-virtual {[COLOR="red"]v11, v12[/COLOR]}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V

red lines may be different i your case..

add blue lines to give it the form , edit red colored variables to match using green line:

iget-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mScrollView:Landroid/widget/ScrollView;

const/4 v12, 0x0

[COLOR="SeaGreen"] invoke-virtual {[COLOR="red"]v11, v12[/COLOR]}, Landroid/widget/ScrollView;->setVerticalScrollBarEnabled(Z)V[/COLOR]

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

.line 444
const[COLOR="red"] v12[/COLOR], 0x7f0c00e9

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

.line 445
move-result-object [COLOR="red"]v11[/COLOR]

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

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

.line 530
new-instance v11, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;

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

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

iput-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicker:Lcom/android/systemui/statusbar/phone/Ticker;

step 4:

find lines similer to this :

iget-object v11, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;

iget v11, v11, Landroid/util/DisplayMetrics;->heightPixels:I

iget-object v12, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

add these line above

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

invoke-virtual {v1}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V

step 5

: open quickpanel_quick_settings_space.xml

edit it to look like this :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
[COLOR="Red"] <com.lidroid.systemui.quickpanel.PowerWidget android:layout_marginTop="50.0dip" android:id="@id/power_widget" android:paddingTop="0.0dip" android:paddingBottom="0.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" /> [/COLOR]
<ScrollView android:id="@id/scroll" android:scrollbars="none" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="0.0dip" android:overScrollMode="never">

compile and decompile to get public ids..

Step 6

: Open : res/values/public.xml keep it open, then open com/android/systemui/statusbar/phone/PhoneStatusBar.smali

search : 0x7f0c00e9 replece with id you got with <public type="id" name="power_widget"

open all smali found in smali/com/lidroid/systemui/quickpanel/

search for

0x7f

find the public name using my public.txt given

search for that name in your public.xml replace id in that smali...

step 7

: Edit AndroidManifeast.xml to look like this, add red code,

[COLOR="red"]<manifest android:sharedUserId="android.uid.system" android:process="system"[/COLOR] android:versionCode="16" android:versionName="4.1.1-eng..1364989609" package="com.android.systemui" coreApp="true"
xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="red"]<uses-permission android:name="android.permission.CAMERA" />[/COLOR]

save all and compile, sign your systemui.apk as you have modified manifeast

Step 8:

push/flash new systemui along with idroid_settings.apk given...