[Sony Cross-Device Development Themes and Apps] venkat kamesh:
Main

Hello first dont confuse and read everything step by step ;)

All you need is Settings and SystemUI deodexed

Settings.apk

:-

1. Since you guys dont like to have a Rom control app

All you like to have in Stock settings

2. So First decompile your settings.apk

3. Follow this Guide (add Preferences to stock settings) by [MENTION=4672359]bamzzz[/MENTION]

4. After adding this you are ready and easy to add any settings :p

more mods with less work

Now SystemUI.apk

:-

1. Decompile your apk and

2. Download this View attachment 3811529

3. Merge the code to your SystemUI.apk

Let me explain from here in small detail ;)

so i want to hide battery so what i do is ( search for which layout it was )

Hide Battey

open SystemUi.apk/res/layout/system_icons.xml

in that the sony battery Code looks like this

<LinearLayout android:id="@id/somc_battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginStart="4.0dip">
<ImageView android:layout_gravity="center_vertical" android:id="@id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<LinearLayout android:id="@id/battery_meter" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stamina_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout android:id="@id/battery_percent" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.sonymobile.systemui.statusbar.BatteryImage android:layout_gravity="start|center" android:id="@id/battery_percent_bg" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
</LinearLayout>

So this is one complete Layout of battery on statusbar

This is how the Code i add to hide / enable switch

[COLOR="Red"] <com.android.systemui.rz.LeftLayout android:layout_width="wrap_content" android:layout_height="wrap_content" key="[COLOR="Blue"]battery_hide[/COLOR]">
[/COLOR]
<LinearLayout android:id="@id/somc_battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginStart="4.0dip">
<ImageView android:layout_gravity="center_vertical" android:id="@id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<LinearLayout android:id="@id/battery_meter" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stamina_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout android:id="@id/battery_percent" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.sonymobile.systemui.statusbar.BatteryImage android:layout_gravity="start|center" android:id="@id/battery_percent_bg" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
</LinearLayout>
[COLOR="red"] </com.android.systemui.rz.LeftLayout>[/COLOR]

See the Red lines are the Start and end points to hide the layout ( i am poor in explanation :p hope you got it :D )

and the Blue key is the one you need to remember.. which will be added in settings as switch key to enable or hide

in settings you need to add like this ( see the Blue Key )

that play the role

<SwitchPreference
android:title="HIDE STOCK BATTERY"
android:key="[COLOR="Blue"]battery_hide[/COLOR]"
android:defaultValue="true" />

if you are about to have any other layout to hide

Then use same red lines and

change the Blue key in both settings and in ui

When i get free time i will add all the layouts codes on how to add :p

For now follow this small example and try your own :D

Thanks to Vanya

If you used my work

Dont forget to mention me ;)

Good luck guys