Bug 720698: ICS should use blue outline color for URL bar. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Fri, 27 Jan 2012 12:28:45 -0800
changeset 86843 5b86c60b846137d20cb215bd3fa8c08492a064ac
parent 86842 266cd6aa74dc8f71b8318f29d5ca5ff018402c42
child 86844 28c8e1836673a5c97ae026fe128cccd1b53d542c
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs720698
milestone12.0a1
Bug 720698: ICS should use blue outline color for URL bar. [r=mfinkle]
mobile/android/base/BrowserToolbar.java
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -88,35 +88,43 @@ public class BrowserToolbar extends Line
     private TranslateAnimation mSlideDownOut;
 
     private int mCount;
 
     public BrowserToolbar(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
         mInflated = false;
+
+        // Get the device's highlight color
+        TypedArray typedArray;
+
+        if (Build.VERSION.SDK_INT >= 11) {            
+            typedArray = context.obtainStyledAttributes(new int[] { android.R.attr.textColorHighlight });
+        } else {
+            ContextThemeWrapper wrapper  = new ContextThemeWrapper(mContext, android.R.style.TextAppearance);
+            typedArray = wrapper.getTheme().obtainStyledAttributes(new int[] { android.R.attr.textColorHighlight });
+        }
+
+        mColor = typedArray.getColor(typedArray.getIndex(0), 0);
+        typedArray.recycle();
     }
 
     @Override
     protected void onFinishInflate () {
         super.onFinishInflate();
 
         // HACK: Without this, the onFinishInflate is called twice
         // This issue is due to a bug when Android inflates a layout with a
         // parent. Fixed in Honeycomb
         if (mInflated)
             return;
 
         mInflated = true;
 
-        // Get the device's highlight color
-        ContextThemeWrapper wrapper = new ContextThemeWrapper(mContext, android.R.style.TextAppearance);
-        TypedArray typedArray = wrapper.getTheme().obtainStyledAttributes(new int[] { android.R.attr.textColorHighlight });
-        mColor = typedArray.getColor(typedArray.getIndex(0), 0);
-
         mAwesomeBar = (Button) findViewById(R.id.awesome_bar);
         mAwesomeBar.setOnClickListener(new Button.OnClickListener() {
             public void onClick(View v) {
                 onAwesomeBarSearch();
             }
         });
 
         Resources resources = getResources();