From daac74d4d848f2895233fb340a36ddab4c972181 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Tue, 17 Apr 2018 00:44:58 +0200
Subject: [PATCH] Improve themes

---
 .../settings/AppearanceSettings.kt            |  4 +-
 .../res/values-de/strings_preferences.xml     |  2 +
 .../main/res/values/strings_preferences.xml   |  6 ++
 app/src/main/res/values/themes_amoled.xml     |  4 +-
 app/src/main/res/values/themes_dracula.xml    |  2 +-
 app/src/main/res/values/themes_gruvbox.xml    |  8 +-
 app/src/main/res/values/themes_material.xml   | 97 +++++++++++++++++++
 app/src/main/res/values/themes_solarized.xml  |  8 +-
 app/src/main/res/xml/preferences.xml          |  4 +-
 9 files changed, 121 insertions(+), 14 deletions(-)
 create mode 100644 app/src/main/res/values/themes_material.xml

diff --git a/app/src/main/java/de/kuschku/quasseldroid/settings/AppearanceSettings.kt b/app/src/main/java/de/kuschku/quasseldroid/settings/AppearanceSettings.kt
index ca2ed6f46..1c70a69dc 100644
--- a/app/src/main/java/de/kuschku/quasseldroid/settings/AppearanceSettings.kt
+++ b/app/src/main/java/de/kuschku/quasseldroid/settings/AppearanceSettings.kt
@@ -6,7 +6,7 @@ import de.kuschku.quasseldroid.R
 data class AppearanceSettings(
   val inputEnter: InputEnterMode = InputEnterMode.EMOJI,
   val showLag: Boolean = true,
-  val theme: Theme = Theme.QUASSEL_LIGHT
+  val theme: Theme = Theme.MATERIAL_LIGHT
 ) {
   enum class InputEnterMode {
     EMOJI,
@@ -19,6 +19,8 @@ data class AppearanceSettings(
   }
 
   enum class Theme(@StyleRes val style: Int) {
+    MATERIAL_LIGHT(R.style.Theme_ChatTheme_Material_Light),
+    MATERIAL_DARK(R.style.Theme_ChatTheme_Material_Dark),
     QUASSEL_LIGHT(R.style.Theme_ChatTheme_Quassel_Light),
     QUASSEL_DARK(R.style.Theme_ChatTheme_Quassel_Dark),
     AMOLED(R.style.Theme_ChatTheme_Amoled),
diff --git a/app/src/main/res/values-de/strings_preferences.xml b/app/src/main/res/values-de/strings_preferences.xml
index 07c60f97a..57e66656b 100644
--- a/app/src/main/res/values-de/strings_preferences.xml
+++ b/app/src/main/res/values-de/strings_preferences.xml
@@ -3,6 +3,8 @@
   <string name="preference_appearance_title">Aussehen</string>
 
   <string name="preference_theme_title">Farbschema</string>
+  <string name="preference_theme_entry_material_light">Material (Hell)</string>
+  <string name="preference_theme_entry_material_dark">Material (Dunkel)</string>
   <string name="preference_theme_entry_quassel_light">Quassel (Hell)</string>
   <string name="preference_theme_entry_quassel_dark">Quassel (Dunkel)</string>
   <string name="preference_theme_entry_amoled">AMOLED</string>
diff --git a/app/src/main/res/values/strings_preferences.xml b/app/src/main/res/values/strings_preferences.xml
index 462a497b9..b7ecd45ef 100644
--- a/app/src/main/res/values/strings_preferences.xml
+++ b/app/src/main/res/values/strings_preferences.xml
@@ -4,6 +4,8 @@
 
   <string name="preference_theme_key" translatable="false">theme</string>
   <string name="preference_theme_title">Theme</string>
+  <string name="preference_theme_entry_material_light">Material (Light)</string>
+  <string name="preference_theme_entry_material_dark">Material (Dark)</string>
   <string name="preference_theme_entry_quassel_light">Quassel (Light)</string>
   <string name="preference_theme_entry_quassel_dark">Quassel (Dark)</string>
   <string name="preference_theme_entry_amoled">AMOLED</string>
@@ -13,6 +15,8 @@
   <string name="preference_theme_entry_gruvbox_dark">Gruvbox (Dark)</string>
   <string name="preference_theme_entry_dracula">Dracula</string>
   <string-array name="preference_theme_entries">
+    <item>@string/preference_theme_entry_material_light</item>
+    <item>@string/preference_theme_entry_material_dark</item>
     <item>@string/preference_theme_entry_quassel_light</item>
     <item>@string/preference_theme_entry_quassel_dark</item>
     <item>@string/preference_theme_entry_amoled</item>
@@ -23,6 +27,8 @@
     <item>@string/preference_theme_entry_dracula</item>
   </string-array>
   <string-array name="preference_theme_entryvalues" translatable="false">
+    <item>MATERIAL_LIGHT</item>
+    <item>MATERIAL_DARK</item>
     <item>QUASSEL_LIGHT</item>
     <item>QUASSEL_DARK</item>
     <item>AMOLED</item>
diff --git a/app/src/main/res/values/themes_amoled.xml b/app/src/main/res/values/themes_amoled.xml
index 39b57fc9b..cfe787d74 100644
--- a/app/src/main/res/values/themes_amoled.xml
+++ b/app/src/main/res/values/themes_amoled.xml
@@ -26,7 +26,7 @@
     <item name="senderColorF">#3176b3</item>
 
     <item name="colorForeground">#FFFFFF</item>
-    <item name="colorForegroundHighlight">#DE000000</item>
+    <item name="colorForegroundHighlight">#FFFFFF</item>
     <item name="colorForegroundSecondary">#B3FFFFFF</item>
     <item name="colorForegroundAction">#7986cb</item>
     <item name="colorForegroundNotice">#916409</item>
@@ -38,7 +38,7 @@
 
     <item name="colorBackground">#000000</item>
     <item name="android:windowBackground">@color/amoled_background</item>
-    <item name="colorBackgroundHighlight">#ffaf3b</item>
+    <item name="colorBackgroundHighlight">#40ffaf3b</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#000000</item>
     <item name="colorBackgroundDialog">#000000</item>
diff --git a/app/src/main/res/values/themes_dracula.xml b/app/src/main/res/values/themes_dracula.xml
index 24948ea3b..3866f2508 100644
--- a/app/src/main/res/values/themes_dracula.xml
+++ b/app/src/main/res/values/themes_dracula.xml
@@ -41,7 +41,7 @@
 
     <item name="android:windowBackground">@color/dracula_dark_background</item>
     <item name="colorBackground">#282a36</item>
-    <item name="colorBackgroundHighlight">#44475a</item>
+    <item name="colorBackgroundHighlight">#20ff79c6</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#44475a</item>
     <item name="colorBackgroundDialog">#282a36</item>
diff --git a/app/src/main/res/values/themes_gruvbox.xml b/app/src/main/res/values/themes_gruvbox.xml
index feb2fe12a..06e8ff83a 100644
--- a/app/src/main/res/values/themes_gruvbox.xml
+++ b/app/src/main/res/values/themes_gruvbox.xml
@@ -26,7 +26,7 @@
     <item name="senderColorF">#af3a03</item>
 
     <item name="colorForeground">#3c3836</item>
-    <item name="colorForegroundHighlight">#282828</item>
+    <item name="colorForegroundHighlight">#3c3836</item>
     <item name="colorForegroundSecondary">#665c54</item>
     <item name="colorForegroundAction">#076678</item>
     <item name="colorForegroundNotice">#b57614</item>
@@ -41,7 +41,7 @@
 
     <item name="android:windowBackground">@color/gruvbox_light_background</item>
     <item name="colorBackground">#fbf1c7</item>
-    <item name="colorBackgroundHighlight">#d79921</item>
+    <item name="colorBackgroundHighlight">#40d65d0e</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#ebdbb2</item>
     <item name="colorBackgroundDialog">#f2d5bc</item>
@@ -85,7 +85,7 @@
     <item name="senderColorF">#fe8019</item>
 
     <item name="colorForeground">#dbdbb2</item>
-    <item name="colorForegroundHighlight">#282828</item>
+    <item name="colorForegroundHighlight">#dbdbb2</item>
     <item name="colorForegroundSecondary">#bdae93</item>
     <item name="colorForegroundAction">#458588</item>
     <item name="colorForegroundNotice">#d79921</item>
@@ -100,7 +100,7 @@
 
     <item name="android:windowBackground">@color/gruvbox_dark_background</item>
     <item name="colorBackground">#282828</item>
-    <item name="colorBackgroundHighlight">#d79921</item>
+    <item name="colorBackgroundHighlight">#40d65d0e</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#504945</item>
     <item name="colorBackgroundDialog">#3c3836</item>
diff --git a/app/src/main/res/values/themes_material.xml b/app/src/main/res/values/themes_material.xml
new file mode 100644
index 000000000..6af52574b
--- /dev/null
+++ b/app/src/main/res/values/themes_material.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<resources>
+  <color name="material_light_background">#fafafa</color>
+
+  <style name="Theme.ChatTheme.Material_Light" parent="Theme.ChatTheme.Light">
+    <item name="senderColor0">#F44336</item>
+    <item name="senderColor1">#2196F3</item>
+    <item name="senderColor2">#7CB342</item>
+    <item name="senderColor3">#7B1FA2</item>
+    <item name="senderColor4">#DA8E00</item>
+    <item name="senderColor5">#4CAF50</item>
+    <item name="senderColor6">#3F51B5</item>
+    <item name="senderColor7">#E91E63</item>
+    <item name="senderColor8">#b94600</item>
+    <item name="senderColor9">#9E9D24</item>
+    <item name="senderColorA">#558B2F</item>
+    <item name="senderColorB">#009688</item>
+    <item name="senderColorC">#0277BD</item>
+    <item name="senderColorD">#00838F</item>
+    <item name="senderColorE">#9C27B0</item>
+    <item name="senderColorF">#C51162</item>
+
+    <item name="colorForeground">#DE000000</item>
+    <item name="colorForegroundHighlight">#DE000000</item>
+    <item name="colorForegroundSecondary">#8A000000</item>
+    <item name="colorForegroundAction">#01579B</item>
+    <item name="colorForegroundNotice">#B56A00</item>
+    <item name="colorForegroundError">#B71C1C</item>
+
+    <item name="colorForegroundMirc">0x1</item>
+
+    <item name="android:windowBackground">@color/material_light_background</item>
+    <item name="colorBackground">#FAFAFA</item>
+    <item name="colorBackgroundHighlight">#40ffaf3b</item>
+    <item name="colorBackgroundSecondary">@null</item>
+    <item name="colorBackgroundCard">#FFFFFF</item>
+    <item name="colorBackgroundDialog">#FAFAFA</item>
+
+    <item name="colorMarkerLine">#B71C1C</item>
+
+    <item name="colorTintActivity">#AFB42B</item>
+    <item name="colorTintMessage">#1976D2</item>
+    <item name="colorTintHighlight">#FFAB00</item>
+
+    <item name="colorTintSecure">#4CAF50</item>
+    <item name="colorTintPartiallySecure">#FFC107</item>
+    <item name="colorTintInsecure">#D32F2F</item>
+  </style>
+
+  <color name="material_dark_background">#303030</color>
+
+  <style name="Theme.ChatTheme.Material_Dark" parent="Theme.ChatTheme">
+    <item name="senderColor0">#F44336</item>
+    <item name="senderColor1">#2196F3</item>
+    <item name="senderColor2">#8BC34A</item>
+    <item name="senderColor3">#673AB7</item>
+    <item name="senderColor4">#FFC107</item>
+    <item name="senderColor5">#4CAF50</item>
+    <item name="senderColor6">#3F51B5</item>
+    <item name="senderColor7">#E91E63</item>
+    <item name="senderColor8">#b94600</item>
+    <item name="senderColor9">#CDDC39</item>
+    <item name="senderColorA">#558B2F</item>
+    <item name="senderColorB">#009688</item>
+    <item name="senderColorC">#0277BD</item>
+    <item name="senderColorD">#00838F</item>
+    <item name="senderColorE">#9C27B0</item>
+    <item name="senderColorF">#C51162</item>
+
+    <item name="colorForeground">#FFFFFF</item>
+    <item name="colorForegroundHighlight">#FFFFFF</item>
+    <item name="colorForegroundSecondary">#B3FFFFFF</item>
+    <item name="colorForegroundAction">#448AFF</item>
+    <item name="colorForegroundNotice">#FFD740</item>
+    <item name="colorForegroundError">#FF5252</item>
+
+    <item name="colorForegroundMirc">0x0</item>
+
+    <item name="android:windowBackground">@color/material_dark_background</item>
+    <item name="colorBackground">#303030</item>
+    <item name="colorBackgroundHighlight">#40ffaf3b</item>
+    <item name="colorBackgroundSecondary">@null</item>
+    <item name="colorBackgroundCard">#424242</item>
+    <item name="colorBackgroundDialog">#303030</item>
+
+    <item name="colorMarkerLine">#B71C1C</item>
+
+    <item name="colorTintActivity">#AFB42B</item>
+    <item name="colorTintMessage">#42A5F5</item>
+    <item name="colorTintHighlight">#FFAB00</item>
+
+    <item name="colorTintSecure">#4CAF50</item>
+    <item name="colorTintPartiallySecure">#FFC107</item>
+    <item name="colorTintInsecure">#D32F2F</item>
+  </style>
+</resources>
diff --git a/app/src/main/res/values/themes_solarized.xml b/app/src/main/res/values/themes_solarized.xml
index e5f72d234..8e2aa8ed8 100644
--- a/app/src/main/res/values/themes_solarized.xml
+++ b/app/src/main/res/values/themes_solarized.xml
@@ -26,7 +26,7 @@
     <item name="senderColorF">#657900</item>
 
     <item name="colorForeground">#586e75</item>
-    <item name="colorForegroundHighlight">#002B36</item>
+    <item name="colorForegroundHighlight">#586e75</item>
     <item name="colorForegroundSecondary">#657b83</item>
     <item name="colorForegroundAction">#268BD2</item>
     <item name="colorForegroundNotice">#B58900</item>
@@ -41,7 +41,7 @@
 
     <item name="android:windowBackground">@color/solarized_light_background</item>
     <item name="colorBackground">#FDF6E3</item>
-    <item name="colorBackgroundHighlight">#D5A920</item>
+    <item name="colorBackgroundHighlight">#40B58900</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#EEE8D5</item>
     <item name="colorBackgroundDialog">#FDF6E3</item>
@@ -85,7 +85,7 @@
     <item name="senderColorF">#657900</item>
 
     <item name="colorForeground">#93a1a1</item>
-    <item name="colorForegroundHighlight">#002B36</item>
+    <item name="colorForegroundHighlight">#93a1a1</item>
     <item name="colorForegroundSecondary">#839496</item>
     <item name="colorForegroundAction">#268BD2</item>
     <item name="colorForegroundNotice">#B58900</item>
@@ -100,7 +100,7 @@
 
     <item name="android:windowBackground">@color/solarized_dark_background</item>
     <item name="colorBackground">#002B36</item>
-    <item name="colorBackgroundHighlight">#B58900</item>
+    <item name="colorBackgroundHighlight">#30268BD2</item>
     <item name="colorBackgroundSecondary">@null</item>
     <item name="colorBackgroundCard">#073642</item>
     <item name="colorBackgroundDialog">#002B36</item>
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 04da89343..9d37ce55f 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -3,7 +3,7 @@
   xmlns:robobunny="http://robobunny.com">
   <PreferenceCategory android:title="@string/preference_appearance_title">
     <ListPreference
-      android:defaultValue="QUASSEL_LIGHT"
+      android:defaultValue="MATERIAL_LIGHT"
       android:entries="@array/preference_theme_entries"
       android:entryValues="@array/preference_theme_entryvalues"
       android:key="@string/preference_theme_key"
@@ -112,7 +112,7 @@
       android:title="@string/preference_hostmask_plain_title" />
 
     <SwitchPreference
-      android:defaultValue="false"
+      android:defaultValue="true"
       android:key="@string/preference_time_at_end_key"
       android:summary="@string/preference_time_at_end_summary"
       android:title="@string/preference_time_at_end_title" />
-- 
GitLab