[Galaxy Y GT-S5360 General] san122:
Hello guys today iam going to teach you how to add lidroid toggles in grid view in AOSP/CM/Stock roms.

Maybe i have forgot something so dont blame me Let me know it first and i will change it.

Things REQUIRED.

1.Patience [Heavily Needed]

2.Lots of time.

3.My provided files.Here: Public.xml and Lidroid_Resources.zip

4.Notepad++ etc.

The guide is divide into two parts.

1.XML PART [Includes xml editing ]

2.SMALI PART [ Includes smali editing ]

Lets start with XML PART first.

STEP 1

Open ids.xml under res/values foler and add these in last above

<item type="id" name="quickpanel_button">false</item>
<item type="id" name="quickpanel_text">false</item>
<item type="id" name="quickpanel_image">false</item>
<item type="id" name="quickpanel_indicator">false</item>
<item type="id" name="Lidroid">false</item>

STEP 2

Open dimens.xml under res/values foler and add these in last above

</resources>

quickpanel_button_height">79.0px

STEP 3

Open strings.xml under res/values foler and add these in last above

<string name="quickpanel_wifi_text">Wi-Fi</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</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">"Auto rotation"</string>
<string name="quickpanel_shutdown_text">Phone will be shutdown</string>
<string name="quickpanel_shutdown_confirm">Shutdown</string>
<string name="quickpanel_sound_vibrate">Vibrate</string>
<string name="quickpanel_sound_sound">Sound</string>
<string name="quickpanel_sound_silent">Silent</string>
<string name="quickpanel_sound_sound_vibrate">Sound Vibrate</string>
<string name="quickpanel_sync">Sync</string>
<string name="quickpanel_wifiap">Wifi Ap</string>
<string name="quickpanel_wifi">Wifi</string>
<string name="quickpanel_rotation">Auto Rotate</string>
<string name="quickpanel_airplane">Airplane</string>
<string name="quickpanel_bluetooth">Bluetooth</string>
<string name="quickpanel_brightness">Brightness</string>
<string name="quickpanel_flashlight">Flashlight</string>
<string name="quickpanel_gps">GPS</string>
<string name="quickpanel_lockscreen">Lockscreen</string>
<string name="quickpanel_mobiledata">Data</string>
<string name="quickpanel_reboot">Reboot</string>
<string name="quickpanel_reboot_text">Phone will reboot</string>
<string name="quickpanel_screen_timeout">Screen Timeout</string>
<string name="quickpanel_recovery">Recovery</string>

STEP 5

Delete these if they are already present

<string name="quickpanel_wifi_text">Wi-Fi</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</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">"Auto rotation"</string>

STEP 6

Merge attached files with your SystemUI.apk

STEP 7

Recompile Your App.

STEP 8

Decompile it again.

STEP 9

Open Statusbar_expanded.xml or any other xml where you want to place lidroid toggles.

STEP 10

And Add this where you want to place the lidroid toggles.

<com.lidroid.systemui.quickpanel.PowerWidget android:id="@id/Lidroid" android:layout_width="fill_parent" android:layout_height="wrap_content" />

Now lets complete the SMALI PART

SMALI PART

STEP 11

Open com/android/systemui/statusbar/StatusBarService.smali

STEP12

In

# instance fields

Below

.field mPositionTmp:[I

Add this line

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

STEP 13

In

.method private makeStatusBarView(Landroid/content/Context;)V

Add this in last above

.line (A numeric value will be there)
return-void

.line 656
iget-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mExpandedView:Lcom/android/systemui/statusbar/ExpandedView;

const v6, 0x7f090039

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/ExpandedView;->findViewById(I)Landroid/view/View;

move-result-object v5

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

iput-object v5, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

iget-object v6, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

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

STEP 14

Open your public.xml

Search for "Lidroid" id and copy its public id and replace it with id of above code i.e with "0x7f090039"

STEP 15

OPEN Statusbarservice.smali again

STEP 16

In

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

Add this in last above

.line (A numeric value will be there)
return-void

.line 1900
iget-object v1, p0, Lcom/android/systemui/statusbar/StatusBarService;->mPowerWidget:Lcom/lidroid/systemui/quickpanel/PowerWidget;

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

NOTE..

Here "0x7f090039" is the public id of id "Lidroid"

STEP17

Now open all files in com/lidroid/systemui/quickpanel folder

Search "0x7f" Copy the whole id .

Open my provided public.xml

Search for that id in my public.xml

Copy the text of that id.

Like if my Public id is "0x7f030011"

Then i will copy "quickpanel_button".

Now find same text in your public.xml

Copy its public id .

And replace the id of all smali files with your public.xml's id.

Similarly do this with all smali files available in quickpanel folder.

STEP 18

Now open your apps Android-Manifest.xml.

And add this in last above

</application>

<activity android:theme="@*android:style/Theme.NoTitleBar.Fullscreen" android:name="com.lidroid.systemui.quickpanel.FlashlightActivity" android:clearTaskOnLaunch="true" android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation" />

Since You have edited Android-Manifest.xml you need to sign apk file.

STEP 19

Recompile it .

STEP 20

Sign it.

And push to system/app