Commit 72026d94 authored by Erik Duisters's avatar Erik Duisters
Browse files

Switch to MaterialComponents theme

Summary:
Androidx introduced new Materialcomponents themes, use them instead of
Theme.AppCompat. This also causes AlertDialogs and PreferenceDialogFragments
to be styled correctly

|{F6531506}|{F6531505}|
|Before|After|

(Ok button is disabled if you are wondering)

Test Plan: Apply patch, verify everything still looks as expected

Reviewers: #kde_connect, albertvaka

Reviewed By: #kde_connect, albertvaka

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D18039
parent 47254567
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<color name="darkStatusBarBackground">#333333</color> <color name="darkStatusBarBackground">#333333</color>
<!-- KdeConnectThemeBase styles must only be defined in the main res/values/ folder --> <!-- KdeConnectThemeBase styles must only be defined in the main res/values/ folder -->
<style name="KdeConnectThemeBase.Dark" parent="Theme.AppCompat"> <style name="KdeConnectThemeBase.Dark" parent="Theme.MaterialComponents">
<item name="colorPrimary">@color/darkGrey</item> <item name="colorPrimary">@color/darkGrey</item>
<item name="colorPrimaryDark">@color/darkStatusBarBackground</item> <item name="colorPrimaryDark">@color/darkStatusBarBackground</item>
<item name="colorAccent">@color/accent</item> <item name="colorAccent">@color/accent</item>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<item name="colorHighContrast">@android:color/white</item> <item name="colorHighContrast">@android:color/white</item>
<item name="android:textColorPrimary">@android:color/white</item> <item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColor">@android:color/white</item> <item name="android:textColor">@android:color/white</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
</style> </style>
<style name="KdeConnectThemeBase.Dark.NoActionBar" parent="KdeConnectThemeBase.Dark"> <style name="KdeConnectThemeBase.Dark.NoActionBar" parent="KdeConnectThemeBase.Dark">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<color name="disabled_grey">#eee</color> <color name="disabled_grey">#eee</color>
<!-- NoActionBar because we use a Toolbar widget as ActionBar --> <!-- NoActionBar because we use a Toolbar widget as ActionBar -->
<style name="KdeConnectThemeBase" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="KdeConnectThemeBase" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- The three colors used by system widgets, according to https://chris.banes.me/2014/10/17/appcompat-v21/ --> <!-- The three colors used by system widgets, according to https://chris.banes.me/2014/10/17/appcompat-v21/ -->
<item name="colorPrimary">@color/primary</item> <item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item> <item name="colorPrimaryDark">@color/primaryDark</item>
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<item name="colorHighContrast">@android:color/black</item> <item name="colorHighContrast">@android:color/black</item>
<item name="android:textColorPrimary">@android:color/black</item> <item name="android:textColorPrimary">@android:color/black</item>
<item name="android:textColor">@android:color/black</item> <item name="android:textColor">@android:color/black</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
</style> </style>
<style name="KdeConnectThemeBase.NoActionBar" parent="KdeConnectThemeBase"> <style name="KdeConnectThemeBase.NoActionBar" parent="KdeConnectThemeBase">
...@@ -40,5 +41,4 @@ ...@@ -40,5 +41,4 @@
<style name="DisableableButton" parent="ThemeOverlay.AppCompat"> <style name="DisableableButton" parent="ThemeOverlay.AppCompat">
<item name="colorButtonNormal">@drawable/disableable_button</item> <item name="colorButtonNormal">@drawable/disableable_button</item>
</style> </style>
</resources> </resources>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment