Bug 1189585 - Change SearchEngineBar to use the DrawableUtil class. r=sebastian
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 30 Jul 2015 18:41:13 -0700
changeset 287370 61e8be8a63d18490809565d31ab8e6e33c70a309
parent 287369 431678640625918feadb3eb599e2973257816260
child 287371 49f553e28a4c277b33ceef6cd41c2bcc88dd61af
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1189585
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1189585 - Change SearchEngineBar to use the DrawableUtil class. r=sebastian
mobile/android/base/home/SearchEngineBar.java
--- a/mobile/android/base/home/SearchEngineBar.java
+++ b/mobile/android/base/home/SearchEngineBar.java
@@ -5,31 +5,30 @@
 
  package org.mozilla.gecko.home;
 
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
 import android.graphics.drawable.Drawable;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.graphics.drawable.DrawableCompat;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
 import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.BaseAdapter;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.util.DrawableUtil;
 import org.mozilla.gecko.widget.TwoWayView;
 
 import java.util.ArrayList;
 import java.util.List;
 
 public class SearchEngineBar extends TwoWayView
                              implements AdapterView.OnItemClickListener {
     private static final String LOGTAG = "Gecko" + SearchEngineBar.class.getSimpleName();
@@ -179,19 +178,18 @@ public class SearchEngineBar extends Two
             }
         }
 
         private View getLabelView(View view, final ViewGroup parent) {
             if (view == null) {
                 view = LayoutInflater.from(getContext()).inflate(R.layout.search_engine_bar_label, parent, false);
             }
 
-            final Drawable icon = DrawableCompat.wrap(
-                    ContextCompat.getDrawable(parent.getContext(), R.drawable.search_icon_active).mutate());
-            DrawableCompat.setTint(icon, getResources().getColor(R.color.disabled_grey));
+            final Drawable icon =
+                    DrawableUtil.tintDrawable(parent.getContext(), R.drawable.search_icon_active, R.color.disabled_grey);
 
             final ImageView iconView = (ImageView) view.findViewById(R.id.search_engine_label);
             iconView.setImageDrawable(icon);
             iconView.setScaleType(ImageView.ScaleType.FIT_XY);
 
             return view;
         }