[Android Themes] arindam4u:
Need Help Please

I am trying to make a CM 13 theme for the first time.

I started it first on my own then stuck at some point where I find these guides at XDA. Thanks to [MENTION=3605033]nicholaschum[/MENTION] , [MENTION=5022494]Vivek_Neel[/MENTION] and also other helpful members. I am learning from here.

I need some help. I have managed to change systemui QS icons, stat icons but I am unable to change the Switches, Checkboxes (in style) of my theme.

View attachment 3804987 View attachment 3804988

(These screenshots was taken while selected default theme though)

I am trying to do it for 2-3 days now. So please help me.

Pardon me if I am wrong, as of now I got that these things should be changed from framework-res. which in the case of CM 13 Theme, the overlays/android/res folder

I have created four folders in here. drawable, drawable-xhdpi, drawable-xxxhdpi, values

in drawable-xhdpi:

View attachment 3804990

in drawable-xxxhdpi:

View attachment 3804994

in drawable: I have 3 files:

1. btn_check_material_anim.xml

<?xml version="1.0" encoding="utf-8"?>
<animated-selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:state_checked="true">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_015" android:tint="?android:colorControlActivated" android:alpha="?android:disabledAlpha" />
</item>
<item android:state_enabled="false">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_000" android:tint="?android:colorControlNormal" android:alpha="?android:disabledAlpha" />
</item>
<item android:state_checked="true" android:id="@*android:id/on">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_015" android:tint="?android:colorControlActivated" />
</item>
<item android:id="@*android:id/off">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_000" android:tint="?android:colorControlNormal" />
</item>
<transition android:toId="@*android:id/on" android:fromId="@*android:id/off">
<animation-list>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_000" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_001" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_002" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_003" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_004" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_005" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_006" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_007" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_008" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_009" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_010" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_011" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_012" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_013" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_014" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_on_mtrl_015" android:tint="?android:colorControlActivated" />
</item>
</animation-list>
</transition>
<transition android:toId="@*android:id/off" android:fromId="@*android:id/on">
<animation-list>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_000" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_001" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_002" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_003" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_004" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_005" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_006" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_007" android:tint="?android:colorControlActivated" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_008" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_009" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_010" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_011" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_012" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_013" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_014" android:tint="?android:colorControlNormal" />
</item>
<item android:duration="25">
<bitmap android:src="@drawable/btn_check_to_off_mtrl_015" android:tint="?android:colorControlNormal" />
</item>
</animation-list>
</transition>
</animated-selector>

2.switch_thumb_material_anim.xml

<?xml version="1.0" encoding="utf-8"?>
<animated-selector android:constantSize="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:id="@id/off">
<nine-patch android:gravity="center" android:src="@drawable/btn_switch_to_off_mtrl" />
</item>
<item android:state_checked="true" android:id="@id/on">
<nine-patch android:gravity="center" android:tint="?android:colorControlActivated" android:src="@drawable/btn_switch_to_on_mtrl" />
</item>
<item android:id="@id/off">
<nine-patch android:gravity="center" android:src="@drawable/btn_switch_to_off_mtrl" />
</item>
<transition android:toId="@id/on" android:fromId="@id/off">
<animation-list>
<item android:duration="1">
<nine-patch android:gravity="center" android:src="@drawable/btn_switch_to_off_mtrl" />
</item>
<item android:duration="1">
<nine-patch android:gravity="center" android:tint="?android:colorControlActivated" android:src="@drawable/btn_switch_to_on_mtrl" />
</item>
</animation-list>
</transition>
<transition android:toId="@id/off" android:fromId="@id/on">
<animation-list>
<item android:duration="1">
<nine-patch android:gravity="center" android:src="@drawable/btn_switch_to_on_mtrl" />
</item>

<item android:duration="1">
<nine-patch android:gravity="center" android:src="@drawable/btn_switch_to_off_mtrl" />
</item>
</animation-list>
</transition>
</animated-selector>

3. switch_track_material

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false">
<nine-patch android:src="@drawable/switch_track_mtrl_alpha" android:color="#00000000" android:alpha="1.0" />
</item>
<item android:state_checked="true">
<nine-patch android:src="@drawable/switch_track_mtrl_alpha" android:color="#00000000" android:alpha="1.0" />
</item>
<item>
<nine-patch android:src="@drawable/switch_track_mtrl_alpha" android:tint="#ffd7d7d7" />
</item>
</selector>

In values folder I have 2 xmls

1. colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="material_blue_grey_800">@*common:color/primary</color>
<color name="material_blue_grey_900">@*common:color/primary</color>
<color name="material_blue_grey_950">@*common:color/primary_dark</color>

<color name="material_deep_teal_200">@*common:color/accent_fallback</color>
<color name="material_deep_teal_500">@*common:color/accent</color>

<color name="system_notification_accent_color">@*common:color/accent</color>
<color name="battery_saver_mode_color">#fff4511e</color>

<color name="button_material_light">@*common:color/white_300</color>
<color name="button_material_dark">@*common:color/black_400</color>
</resources>

2. styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Material.Light" parent="@android:style/Theme.Material.Light">
<item name="android:colorPrimary">@*common:color/material_grey_800</item>
<item name="android:colorPrimaryDark">@*common:color/material_grey_900</item>
<item name="android:statusBarColor">@*common:color/material_grey_900</item>
<item name="android:navigationBarColor">@*common:color/material_grey_900</item>
</style>

<style name="Theme.Material" parent="@*android:style/Theme.Material">
<item name="android:colorPrimary">@*common:color/black_200</item>
<item name="android:colorPrimaryDark">@*common:color/black_200</item>
<item name="android:statusBarColor">@*common:color/material_grey_900</item>
<item name="android:navigationBarColor">@*common:color/material_grey_900</item>
<item name="android:colorBackground">@*common:color/black_200</item>
</style>

<style name="Widget.Material.ActionBar" parent="@android:style/Widget.Material.ActionBar">
<item name="android:elevation">1dp</item>
</style>
<style name="Widget.Material.ActionBar.Solid" parent="@android:style/Widget.Material.ActionBar.Solid">
<item name="android:elevation">1dp</item>
</style>

</resources>

Can anyone please help?? After this when I apply theme the default checkboxes and toggle switch appears always. I want to change Toggle Switches, Checkboxes and may be later Radio buttons for my theme.

I would really appreceate if anyone guide me for customizing it.

Thank you.