Skip to content

Commit

Permalink
fix(android): themes to not use dark status/nav icons on dark backgro…
Browse files Browse the repository at this point in the history
…und (#13168)

Fixes TIMOB-28577

Co-authored-by: Hans Knöchel <hansemannn@users.noreply.github.com>
Co-authored-by: Michael Gangolf <m1ga@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 12, 2022
1 parent c0c2dcc commit 08219c2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions android/titanium/res/values-v23/values.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.Theme.Titanium.Dark" parent="Theme.MaterialComponents">
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="Base.Theme.Titanium.Light" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="android:windowLightStatusBar">false</item>
</style>

<style name="Theme.Titanium.Light.Solid" parent="Theme.Titanium.Light">
<item name="android:navigationBarColor">@android:color/black</item>
<item name="android:statusBarColor">?android:attr/colorBackground</item>
Expand Down
9 changes: 9 additions & 0 deletions android/titanium/res/values-v27/values.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.Theme.Titanium.Dark" parent="Theme.MaterialComponents">
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
</style>
<style name="Base.Theme.Titanium.Light" parent="Theme.MaterialComponents.Light.DarkActionBar">
<item name="android:windowLightNavigationBar">false</item>
<item name="android:windowLightStatusBar">false</item>
</style>

<style name="Theme.Titanium.Light.Solid" parent="Theme.Titanium.Light">
<item name="android:navigationBarColor">?android:attr/colorBackground</item>
<item name="android:statusBarColor">?android:attr/colorBackground</item>
Expand Down
12 changes: 10 additions & 2 deletions android/titanium/res/values/values.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
<attr name="titaniumSplashIcon" format="reference"/>
</declare-styleable>

<!-- Base dark Titanium theme which applies version specific styles. (See v23 and v27 folders.) -->
<style name="Base.Theme.Titanium.Dark" parent="Theme.MaterialComponents"/>

<!-- Titanium's dark material theme with an action bar. -->
<style name="Theme.Titanium.Dark" parent="Theme.MaterialComponents">
<style name="Theme.Titanium.Dark" parent="Base.Theme.Titanium.Dark">
<item name="actionBarSize">@dimen/ti_action_bar_height</item>
<item name="actionBarStyle">@style/Widget.MaterialComponents.ActionBar.Surface</item>
<item name="colorPrimary">@color/ti_dark_primary</item>
Expand All @@ -44,6 +47,7 @@
<item name="android:statusBarColor">?attr/colorPrimaryDark</item>
<item name="android:textAllCaps">false</item>
<item name="textAllCaps">false</item>
<item name="titaniumIsSolidTheme">false</item>
</style>

<!-- Titanium's dark material theme without an action bar. -->
Expand Down Expand Up @@ -86,8 +90,11 @@
<item name="android:windowFullscreen">true</item>
</style>

<!-- Base light Titanium theme which applies version specific styles. (See v23 and v27 folders.) -->
<style name="Base.Theme.Titanium.Light" parent="Theme.MaterialComponents.Light.DarkActionBar"/>

<!-- Titanium's light material theme with an action bar. -->
<style name="Theme.Titanium.Light" parent="Theme.MaterialComponents.Light.DarkActionBar">
<style name="Theme.Titanium.Light" parent="Base.Theme.Titanium.Light">
<item name="actionBarSize">@dimen/ti_action_bar_height</item>
<item name="actionBarStyle">@style/Widget.AppCompat.Light.ActionBar.Solid</item>
<item name="colorPrimary">@color/ti_light_primary</item>
Expand All @@ -101,6 +108,7 @@
<item name="android:statusBarColor">?attr/colorPrimaryDark</item>
<item name="android:textAllCaps">false</item>
<item name="textAllCaps">false</item>
<item name="titaniumIsSolidTheme">false</item>
</style>

<!-- Titanium's light material theme without an action bar. -->
Expand Down

0 comments on commit 08219c2

Please sign in to comment.