Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/376530 )

Change subject: Tweak design of theme chooser image dimming switch
......................................................................

Tweak design of theme chooser image dimming switch

Per T172897#3583546

Bug: T172897
Change-Id: I2d1d4a971f7333a2cd45c4f51f449ceba5f21cc6
---
M app/src/main/java/org/wikipedia/theme/ThemeChooserDialog.java
M app/src/main/res/layout/dialog_theme_chooser.xml
M app/src/main/res/values/attrs.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
5 files changed, 23 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/30/376530/1

diff --git a/app/src/main/java/org/wikipedia/theme/ThemeChooserDialog.java 
b/app/src/main/java/org/wikipedia/theme/ThemeChooserDialog.java
index d76e0fb..a24a788 100644
--- a/app/src/main/java/org/wikipedia/theme/ThemeChooserDialog.java
+++ b/app/src/main/java/org/wikipedia/theme/ThemeChooserDialog.java
@@ -128,7 +128,7 @@
 
     private void updateDimImagesSwitch() {
         dimImagesSwitch.setChecked(Prefs.shouldDimDarkModeImages());
-        dimImagesSwitch.setEnabled(app.getCurrentTheme() == Theme.DARK);
+        dimImagesSwitch.setClickable(app.getCurrentTheme() == Theme.DARK);
     }
 
     private final class ThemeButtonListener implements View.OnClickListener {
diff --git a/app/src/main/res/layout/dialog_theme_chooser.xml 
b/app/src/main/res/layout/dialog_theme_chooser.xml
index ddbb948..7b69a97 100644
--- a/app/src/main/res/layout/dialog_theme_chooser.xml
+++ b/app/src/main/res/layout/dialog_theme_chooser.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android";
+             xmlns:app="http://schemas.android.com/apk/res-auto";
              xmlns:tools="http://schemas.android.com/tools";
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
@@ -107,6 +108,7 @@
             android:layout_height="wrap_content"
             android:layout_marginBottom="16dp"
             android:gravity="center_vertical"
+            app:theme="?attr/blue_switch"
             style="@style/RtlAwareTextView"
             android:textColor="?attr/feed_text_tertiary_color"
             android:textSize="14sp"
diff --git a/app/src/main/res/values/attrs.xml 
b/app/src/main/res/values/attrs.xml
index 4c2b1f8..7334067 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -43,6 +43,8 @@
     <attr name="multi_select_background_color" format="reference" />
     <attr name="searchItemBackground" format="reference" />
 
+    <attr name="blue_switch" format="reference" />
+
     <declare-styleable name="CabSearchView">
         <attr name="cabEnabled" format="boolean" />
     </declare-styleable>
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index 3ced21b..c92bd78 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -75,6 +75,8 @@
         <item 
name="feed_text_tertiary_color">@color/feed_text_tertiary_dark</item>
         <item name="searchItemBackground">@color/base12</item>
         <item name="cardBackgroundColor">@color/base14</item>
+        <item name="blue_switch">@style/BlueSwitchDark</item>
+
     </style>
 
     <style name="Theme.Dark.Dialog.Alert" 
parent="Theme.AppCompat.Dialog.Alert">
@@ -91,4 +93,10 @@
         <item name="overlapAnchor">true</item>
     </style>
 
+    <style name="BlueSwitchDark">
+        <item name="colorControlActivated">@color/accent75</item>
+        <item name="colorSwitchThumbNormal">@color/base90</item>
+        <item name="android:colorForeground">@color/base30</item>
+    </style>
+
 </resources>
diff --git a/app/src/main/res/values/styles_light.xml 
b/app/src/main/res/values/styles_light.xml
index f535ce2..5f0581d 100644
--- a/app/src/main/res/values/styles_light.xml
+++ b/app/src/main/res/values/styles_light.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools";>
 
     <style name="Theme.Light.ActionBar">
         <item name="windowNoTitle">false</item>
@@ -76,6 +76,7 @@
         <item 
name="feed_text_tertiary_color">@color/feed_text_tertiary_light</item>
         <item name="searchItemBackground">@color/base100</item>
         <item name="cardBackgroundColor">@color/base100</item>
+        <item name="blue_switch">@style/BlueSwitchLight</item>
 
     </style>
 
@@ -93,4 +94,12 @@
         <item name="overlapAnchor">true</item>
     </style>
 
+    <style name="BlueSwitchLight">
+        <item name="colorControlActivated">@color/base90</item>
+        <item name="colorSwitchThumbNormal">@color/base90</item>
+        <item name="android:colorForeground">@color/base30</item>
+        <item name="trackTint">@color/base70</item>
+        <item name="trackTintMode">src_in</item>
+    </style>
+
 </resources>

-- 
To view, visit https://gerrit.wikimedia.org/r/376530
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2d1d4a971f7333a2cd45c4f51f449ceba5f21cc6
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mholloway <mhollo...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to