[Android Themes] zhalx:
(Part III) Add dual layer background and edit Side padding

(Part III) Add dual layer background and edit Side padding​

[IMG="Add dual layers background and set side padding settings"]http://4.bp.blogspot.com/-MzS1NjkjEW4/VhQ0TQXSqEI/AAAAAAAAAxw/vRph7HjAj10/s400/catatandroid-settings-lollipop-cm12-theme.jpg[/IMG]
​

Prepare

- Know how to decompile recompile apk

- Disabled signature system

- Finished Part I dan Part II

- Settings.apk

- framework-res.apk

Guides

- Decompile Settings.apk

- make sure you have finished tutorial part II

- go to folder res\drawable\

- make 2 new xml files with name duawarna_yanu_cover.xml and duawarna_yanu_cover_anak.xml

- write in duawarna_yanu_cover.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:height="9.0dip">
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/teal_yanu" />
</shape>
</item>
<item android:top="133.0dip">
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dark_yanu" />
</shape>
</item>
</layer-list>

- write in duawarna_yanu_cover_anak.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:height="9.0dip">
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@*android:color/teal_yanu" />
</shape>
</item>
<item android:top="73.0dip">
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@*android:color/dark_yanu" />
</shape>
</item>
</layer-list>

- save

- go to folder \res\values\

- open styles.xml and add this script bellow (name="Mole.Theme")

<style name="Mole.Theme" parent="@*android:style/Theme.Holo">
....
....
<item name="android:windowBackground">@drawable/duawarna_yanu_cover</item>
</style>
<style name="Mole.Theme.Anak" parent="@*android:style/Theme.Holo">
<item name="android:windowBackground">@drawable/duawarna_yanu_cover_anak</item>
<item name="android:listSeparatorTextViewStyle">@style/Mole.ListSeparator</item>
</style>

- open colors.xml

- add these two color value

<color name="dark_yanu">#ff111111</color>
<color name="teal_yanu">#ff00695c</color>
</resources>

- save

- open AndroidManifest.xml

- change these 3 android:theme look like this

<application android:theme="[B]@style/Mole.Theme.Anak[/B]" android:label="@string/settings_label" android:icon="@mipmap/ic_launcher_settings" android:taskAffinity="" android:hardwareAccelerated="true" android:uiOptions="splitActionBarWhenNarrow" android:supportsRtl="true">
<activity android:theme="[B]@style/Mole.Theme[/B]" android:label="@string/settings_label_launcher" android:name="Settings" android:taskAffinity="com.android.settings" android:launchMode="singleTask" android:configChanges="mcc|mnc|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.settings.SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:theme="[B]@style/Mole.Theme.Anak[/B]" android:name=".SubSettings" android:taskAffinity="com.android.settings" android:configChanges="mcc|mnc|keyboardHidden|orientation|screenSize" android:parentActivityName="Settings" />

- save

- recompile - sign

- Settings done

- decompile framework-res.apk

- go to folder \res\values\

- open dimens.xml

- find and change these 2 value with these

<dimen name="preference_fragment_padding_side">9.0dip</dimen>
<dimen name="preference_screen_header_padding_side">9.0dip</dimen>

if you dont want any side padding just make 0dp atau 0.0dip

- save - recompile - sign

- push Settings.apk and framework-res.apk to each system folder

- Reboot and done