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

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

Issue 2896883003: Unify toolbar, NTP, and tab switcher text styles (Closed)
Patch Set: Change color for suggestion url Created 3 years, 7 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/omnibox/AnswerTextBuilder.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
index a3c91085f3bf8b4c45d2c096af0bf88e9a3c93b4..4ec51cc7c7f4fc876ceffa79931ccca08bd608ac 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.omnibox;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@@ -69,10 +70,6 @@ class SuggestionView extends ViewGroup {
private static final long RELAYOUT_DELAY_MS = 20;
- static final int TITLE_COLOR_STANDARD_FONT_DARK = 0xFF333333;
- private static final int TITLE_COLOR_STANDARD_FONT_LIGHT = 0xFFFFFFFF;
- private static final int URL_COLOR = 0xFF5595FE;
-
private static final float ANSWER_IMAGE_SCALING_FACTOR = 1.15f;
private final LocationBar mLocationBar;
@@ -83,6 +80,10 @@ class SuggestionView extends ViewGroup {
private final int mSuggestionAnswerHeight;
private int mNumAnswerLines = 1;
+ private final int mDarkTitleColorStandardFont;
+ private final int mLightTitleColorStandardFont;
+ private final int mUrlColor;
+
private OmniboxResultItem mSuggestionItem;
private OmniboxSuggestion mSuggestion;
private OmniboxSuggestionDelegate mSuggestionDelegate;
@@ -117,6 +118,13 @@ class SuggestionView extends ViewGroup {
context.getResources().getDimensionPixelOffset(
R.dimen.omnibox_suggestion_answer_height);
+ Resources resources = getResources();
+ mDarkTitleColorStandardFont =
+ ApiCompatibilityUtils.getColor(resources, R.color.url_emphasis_default_text);
+ mLightTitleColorStandardFont =
+ ApiCompatibilityUtils.getColor(resources, R.color.url_emphasis_light_default_text);
+ mUrlColor = ApiCompatibilityUtils.getColor(resources, R.color.suggestion_url);
+
TypedArray a = getContext().obtainStyledAttributes(
new int [] {R.attr.selectableItemBackground});
Drawable itemBackground = a.getDrawable(0);
@@ -372,8 +380,8 @@ class SuggestionView extends ViewGroup {
}
private int getStandardFontColor() {
- return (mUseDarkColors == null || mUseDarkColors)
- ? TITLE_COLOR_STANDARD_FONT_DARK : TITLE_COLOR_STANDARD_FONT_LIGHT;
+ return (mUseDarkColors == null || mUseDarkColors) ? mDarkTitleColorStandardFont
+ : mLightTitleColorStandardFont;
}
@Override
@@ -455,7 +463,7 @@ class SuggestionView extends ViewGroup {
// Force left-to-right rendering for URLs. See UrlBar constructor for details.
if (isUrl) {
- textLine.setTextColor(URL_COLOR);
+ textLine.setTextColor(mUrlColor);
ApiCompatibilityUtils.setTextDirection(textLine, TEXT_DIRECTION_LTR);
} else {
textLine.setTextColor(getStandardFontColor());
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/omnibox/AnswerTextBuilder.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698