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

Change subject: Fix error text color in dark mode
......................................................................

Fix error text color in dark mode

In this update
 - Add Red75-Sunset Red to colors.xml
 - Add two styles for light mode and dark mode theme
 - Check current theme to give matched text appearance for the error text.

Bug: T173091
Change-Id: I3d5030f4fe173e0e50904a5ec771e876082a5e57
---
M app/src/main/java/org/wikipedia/views/TextInputDialog.java
M app/src/main/res/values/colors.xml
M app/src/main/res/values/styles.xml
3 files changed, 17 insertions(+), 0 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/views/TextInputDialog.java 
b/app/src/main/java/org/wikipedia/views/TextInputDialog.java
index f7e44d6..f676bdc 100644
--- a/app/src/main/java/org/wikipedia/views/TextInputDialog.java
+++ b/app/src/main/java/org/wikipedia/views/TextInputDialog.java
@@ -15,6 +15,7 @@
 import android.widget.EditText;
 
 import org.wikipedia.R;
+import org.wikipedia.WikipediaApp;
 import org.wikipedia.util.DeviceUtil;
 
 public final class TextInputDialog extends AlertDialog {
@@ -49,6 +50,12 @@
         editTextContainer = (TextInputLayout) 
rootView.findViewById(R.id.text_input_container);
         super.setView(rootView);
 
+        if (WikipediaApp.getInstance().getCurrentTheme().isLight()) {
+            
editTextContainer.setErrorTextAppearance(R.style.TextInputLayout_LightThemeErrorTextAppearance);
+        }else{
+            
editTextContainer.setErrorTextAppearance(R.style.TextInputLayout_DarkThemeErrorTextAppearance);
+        }
+
         editTextContainer.setErrorEnabled(true);
         return this;
     }
diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 07b569f..9072c79 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -22,6 +22,7 @@
     <color name="accent30">#2a4b8d</color> <!-- W AAA: Active buttons, Active 
links -->
     <color name="accent20">#223966</color>
     <color name="red90">#fee7e6</color> <!-- B AAA -->
+    <color name="red75">#FF6E6E</color> <!-- Destructive text (error messages, 
red links) -->
     <color name="red50">#d33</color> <!-- B&W AA Destructive: Destructive 
actions, Buttons and links, Alerts -->
     <color name="red30">#b32424</color> <!-- W AAA: Destructive active buttons 
and links -->
 
diff --git a/app/src/main/res/values/styles.xml 
b/app/src/main/res/values/styles.xml
index fa75205..7377ea3 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -255,4 +255,13 @@
         <item 
name="android:dropDownHorizontalOffset">@dimen/popup_menu_drop_down_horizontal_offset</item>
         <item 
name="android:dropDownVerticalOffset">@dimen/popup_menu_drop_down_vertical_offset</item>
     </style>
+
+    <style name="TextInputLayout_DarkThemeErrorTextAppearance" 
parent="TextAppearance.AppCompat.Caption">
+        <item name="android:textColor">@color/red75</item>
+    </style>
+
+    <style name="TextInputLayout_LightThemeErrorTextAppearance" 
parent="TextAppearance.AppCompat.Caption">
+        <item name="android:textColor">@color/red50</item>
+    </style>
+
 </resources>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d5030f4fe173e0e50904a5ec771e876082a5e57
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Cooltey <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to