Custom Theme Switch Button in a app of different Basic Theme

101 views Asked by At

Scene # 1 -------> @style/AppTheme

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

<style name="AppBaseTheme" parent="android:Theme.Light" />

Below was my switch enter image description here

Scene # 2 -------> @style/MyMaterialTheme

I changed the theme to implement the tab on the main screen.

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyMaterialTheme">

<style name="MyMaterialTheme" parent="MyMaterialTheme.Base" />
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="MyMaterialTheme" parent="MyMaterialTheme.Base">
    <item name="android:windowContentTransitions">true</item>
    <item name="android:windowAllowEnterTransitionOverlap">true</item>
    <item name="android:windowAllowReturnTransitionOverlap">true</item>
    <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
    <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>

& Now the same Switch is like below (in red oval)

enter image description here

Question : How can I keep the tab implementation & keep the old scene #1 switch. I am guessing it's due to the theme change from "android:Theme.Light" to "Theme.AppCompat.Light.DarkActionBar".

Is it even possible ? Could you please help. :)

0

There are 0 answers