summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorSatish Sampath <satish@android.com>2009-07-10 09:58:58 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-07-10 09:58:58 -0700
commit4524cc71312ba78e5b7430f347da45c0a3d3a74d (patch)
treecbeca11ab24f1310a19edba3767ecb5ce14ea206 /src/com
parentf450cd0d744da48a5bdd9cdb6cc23a2df8b31db4 (diff)
parent60d24e219b1763bc294974e042c67a1a6cadd8d5 (diff)
downloadpackages_apps_Browser-4524cc71312ba78e5b7430f347da45c0a3d3a74d.zip
packages_apps_Browser-4524cc71312ba78e5b7430f347da45c0a3d3a74d.tar.gz
packages_apps_Browser-4524cc71312ba78e5b7430f347da45c0a3d3a74d.tar.bz2
am 60d24e21: Make suggestion text color change based on the item state
Merge commit '60d24e219b1763bc294974e042c67a1a6cadd8d5' * commit '60d24e219b1763bc294974e042c67a1a6cadd8d5': Make suggestion text color change based on the item state
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/BrowserProvider.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/com/android/browser/BrowserProvider.java b/src/com/android/browser/BrowserProvider.java
index c1d2ef7..29c65e8 100644
--- a/src/com/android/browser/BrowserProvider.java
+++ b/src/com/android/browser/BrowserProvider.java
@@ -154,10 +154,10 @@ public class BrowserProvider extends ContentProvider {
private SearchManager mSearchManager;
- // The hex color string to be applied to urls of website suggestions, as derived from
+ // The ID of the ColorStateList to be applied to urls of website suggestions, as derived from
// the current theme. This is not set until/unless beautifyUrl is called, at which point
// this variable caches the color value.
- private static String mSearchUrlColorHex;
+ private static String mSearchUrlColorId;
public BrowserProvider() {
}
@@ -613,19 +613,15 @@ public class BrowserProvider extends ContentProvider {
* and adds html formatting to make it green.
*/
private String beautifyUrl(String url) {
- if (mSearchUrlColorHex == null) {
+ if (mSearchUrlColorId == null) {
// Get the color used for this purpose from the current theme.
TypedValue colorValue = new TypedValue();
getContext().getTheme().resolveAttribute(
com.android.internal.R.attr.textColorSearchUrl, colorValue, true);
- int color = getContext().getResources().getColor(colorValue.resourceId);
-
- // Convert the int color value into a hex string, and strip the first two
- // characters which will be the alpha transparency (html doesn't want this).
- mSearchUrlColorHex = Integer.toHexString(color).substring(2);
+ mSearchUrlColorId = Integer.toString(colorValue.resourceId);
}
- return "<font color=\"#" + mSearchUrlColorHex + "\">" + stripUrl(url) + "</font>";
+ return "<font color=\"@" + mSearchUrlColorId + "\">" + stripUrl(url) + "</font>";
}
}