Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java

Issue 2427853002: Revert "Inherit default text color from parent themes." (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
index 41c209062236cd3ba7aadae0764d46fbec919dbb..50de53333e99111ccdac0bd2f397b8138da8ea76 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
@@ -10,8 +10,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
-import android.support.annotation.ColorInt;
-import android.support.annotation.ColorRes;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.view.Gravity;
@@ -137,6 +135,9 @@ public class ItemChooserDialog {
// The background color of the highlighted item.
private final int mBackgroundHighlightColor;
+ // The color of the non-highlighted text.
+ private final int mDefaultTextColor;
+
// The zero-based index of the item currently selected in the dialog,
// or -1 (INVALID_POSITION) if nothing is selected.
private int mSelectedItem = ListView.INVALID_POSITION;
@@ -157,6 +158,8 @@ public class ItemChooserDialog {
mBackgroundHighlightColor = ApiCompatibilityUtils.getColor(getContext().getResources(),
R.color.light_active_color);
+ mDefaultTextColor = ApiCompatibilityUtils.getColor(getContext().getResources(),
+ R.color.default_text_color);
}
@Override
@@ -297,22 +300,18 @@ public class ItemChooserDialog {
R.layout.item_chooser_dialog_row, parent, false);
}
-
// Set highlighting for currently selected item.
if (position == mSelectedItem) {
view.setBackgroundColor(mBackgroundHighlightColor);
view.setTextColor(Color.WHITE);
} else {
view.setBackground(null);
-
- @ColorRes final int textColorId = isEnabled(position)
- ? R.color.default_text_color
- : R.color.primary_text_disabled_material_light;
-
- @ColorInt final int textColor = ApiCompatibilityUtils.getColor(
- getContext().getResources(), textColorId);
-
- view.setTextColor(textColor);
+ if (!isEnabled(position)) {
+ view.setTextColor(ApiCompatibilityUtils.getColor(getContext().getResources(),
+ R.color.primary_text_disabled_material_light));
+ } else {
+ view.setTextColor(mDefaultTextColor);
+ }
}
view.setText(getDisplayText(position));

Powered by Google App Engine
This is Rietveld 408576698