aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/values
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-03-29 20:03:50 +0530
committerGitHub <noreply@github.com>2020-03-29 20:03:50 +0530
commitbc463f3c64ab04ae766aa2f161cce8d5f0e4b9f3 (patch)
treec509e028fac85fcee6804402e32c277084f63afa /app/src/main/res/values
parent6e84ca1f3c19fc0f67f021ad43c40d7b99416d55 (diff)
Significantly improve app theming (#679)
* Update CHANGELOG * Use outlined box style in folder creation dialog * Add user-facing choice for app theme Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/res/values')
-rw-r--r--app/src/main/res/values/arrays.xml10
-rw-r--r--app/src/main/res/values/colors.xml7
-rw-r--r--app/src/main/res/values/prefs.xml4
-rw-r--r--app/src/main/res/values/strings.xml5
-rw-r--r--app/src/main/res/values/styles.xml13
5 files changed, 35 insertions, 4 deletions
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 37b55432..559a520c 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -59,5 +59,15 @@
<item>file</item>
<item>directory</item>
</string-array>
+ <string-array name="app_theme_options">
+ <item>@string/theme_light</item>
+ <item>@string/theme_dark</item>
+ <item>@string/theme_battery_saver</item>
+ </string-array>
+ <string-array name="app_theme_values">
+ <item>light</item>
+ <item>dark</item>
+ <item>battery_saver</item>
+ </string-array>
</resources>
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index f8fa1170..13bc049d 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base palette -->
<color name="primary_color">#607d8b</color>
<color name="primary_light_color">#8eacbb</color>
@@ -19,4 +19,9 @@
<color name="list_multiselect_background">#668eacbb</color>
<color name="navigation_bar_color">#000000</color>
<color name="status_bar_color">@color/primary_dark_color</color>
+
+ <!-- Override TextInputEditText stroke color like a boss -->
+ <color name="mtrl_textinput_default_box_stroke_color" tools:override="true">
+ @color/secondary_color
+ </color>
</resources>
diff --git a/app/src/main/res/values/prefs.xml b/app/src/main/res/values/prefs.xml
new file mode 100644
index 00000000..ae01866a
--- /dev/null
+++ b/app/src/main/res/values/prefs.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_theme_def" translatable="false">battery_saver</string>
+</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ba491c87..ff9a2ea8 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -334,4 +334,9 @@
<string name="password_generator_category_title">Password Generator</string>
<string name="tap_clear_clipboard">Tap here to clear clipboard</string>
<string name="clone_git_repo">Clone a git repository to sync changes</string>
+ <string name="theme_title">App theme</string>
+ <string name="theme_light">Light</string>
+ <string name="theme_dark">Dark</string>
+ <string name="theme_battery_saver">Set by Battery Saver</string>
+ <string name="theme_follow_system">System default</string>
</resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index bed9a13e..090b56b9 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -20,6 +20,7 @@
<item name="alertDialogTheme">@style/AppTheme.Dialog</item>
<item name="materialAlertDialogTheme">@style/AppTheme.Dialog</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.MaterialComponents.ActionBar</item>
+ <item name="textInputStyle">@style/TextInputLayoutBase</item>
</style>
<style name="AppTheme.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
@@ -32,9 +33,15 @@
<item name="background">@color/primary_color</item>
</style>
- <style name="TextInputLayoutBase" parent="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
- <item name="boxStrokeColor">?attr/colorSecondary</item>
- <item name="hintTextColor">?attr/colorOnPrimary</item>
+ <style name="ThemeOverlay.AppTheme.TextInputEditText.OutlinedBox" parent="ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox">
+ <item name="colorControlActivated">@color/color_control_normal</item>
+ </style>
+
+ <style name="TextInputLayoutBase" parent="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
+ <item name="boxStrokeColor">@color/secondary_color</item>
+ <item name="hintTextColor">@color/color_control_normal</item>
+ <item name="hintEnabled">true</item>
+ <item name="materialThemeOverlay">@style/ThemeOverlay.AppTheme.TextInputEditText.OutlinedBox</item>
</style>
<style name="DialogLikeTheme" parent="AppTheme">