I have two themes for app, manifest look like:
If I set SetApplicationAttribute(android:theme, "@style/ThemeDark") only dark theme work, same is for light SetApplicationAttribute(android:theme, "@style/ThemeLight"), only light theme work.
I'm not able to switch between those two themes on run time with this example: https://www.b4x.com/android/forum/threads/changing-the-theme-at-runtime.57277/#content
Anyone know proper way or solution?
B4X:
CreateResource(values, theme.xml,
<resources>
<style name="ThemeLight" parent="@android:style/Theme.Holo.NoActionBar">
</style>
</resources>)
CreateResource(values-v21, theme.xml,
<resources>
<style name="ThemeLight" parent="@android:style/Theme.Material.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:textColor">#000000</item> <!-- menu text,, msgbox title -->
<item name="android:textColorSecondary">#AAAAAA</item> <!-- inactive editText line,, scrollbar -->
<item name="android:colorPrimary">#1976D2</item> <!-- action bar -->
<item name="android:colorPrimaryDark">#EEEEEE</item> <!-- status bar -->
<item name="android:colorAccent">#1976D2</item> <!-- checkboxes,, switches,, etc. -->
<item name="android:colorControlNormal">#AAAAAA</item> <!-- inactive checkboxes -->
</style>
</resources>)
CreateResource(values, themedark.xml,
<resources>
<style name="ThemeDark" parent="@android:style/Theme.Holo.NoActionBar">
</style>
</resources>)
CreateResource(values-v21, themedark.xml,
<resources>
<style name="ThemeDark" parent="@android:style/Theme.Material">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:textColor">#FFFFFF</item> <!-- menu text,, msgbox title -->
<item name="android:textColorSecondary">#AAAAAA</item> <!-- inactive editText line,, scrollbar -->
<item name="android:colorPrimary">#1976D2</item> <!-- action bar -->
<item name="android:colorPrimaryDark">#000000</item> <!-- status bar -->
<item name="android:colorAccent">#1976D2</item> <!-- checkboxes,, switches,, etc. -->
<item name="android:colorControlNormal">#AAAAAA</item> <!-- inactive checkboxes -->
</style>
</resources>)
If I set SetApplicationAttribute(android:theme, "@style/ThemeDark") only dark theme work, same is for light SetApplicationAttribute(android:theme, "@style/ThemeLight"), only light theme work.
I'm not able to switch between those two themes on run time with this example: https://www.b4x.com/android/forum/threads/changing-the-theme-at-runtime.57277/#content
Anyone know proper way or solution?