Bug 1301718: FaviconView extends AppCompatImageView. r=liuche draft
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 04 Aug 2017 16:06:58 -0700
changeset 646210 68d193dcee21a53d1378669065a359504374fa72
parent 646207 824d4f269c6323e1ad2bd8ebeb6496d60b8ba3e5
child 646211 e0cd3213174d6cd6f42fa84e41fe7335049b6d97
push id74026
push usermichael.l.comella@gmail.com
push dateMon, 14 Aug 2017 23:50:46 +0000
reviewersliuche
bugs1301718
milestone57.0a1
Bug 1301718: FaviconView extends AppCompatImageView. r=liuche This change is unrelated to this bug. According to my IDE warning: ``` This custom view should extend android.support.v7.widget.AppCompatImageView instead. In order to support features such as tinting, the appcompat library will automatically load special appcompat replacements for the builtin widgets. However, this does not work for your custom views. Instead of extending the android.widget classes directly, you should instead extend one of the delegate classes in android.support.v7.widget.AppCompat. ``` Seems reasonable and I don't see any documentation telling me not to. :) MozReview-Commit-ID: H60bYGVgTIT
mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
--- a/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
@@ -1,16 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.widget;
 
 import android.graphics.Color;
+import android.support.v7.widget.AppCompatImageView;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.icons.IconCallback;
 import org.mozilla.gecko.icons.IconResponse;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
@@ -26,17 +27,17 @@ import android.widget.ImageView;
 
 import java.lang.ref.WeakReference;
 
 /**
  * Special version of ImageView for favicons.
  * Displays solid colour background around Favicon to fill space not occupied by the icon. Colour
  * selected is the dominant colour of the provided Favicon.
  */
-public class FaviconView extends ImageView {
+public class FaviconView extends AppCompatImageView {
 
     // Default x/y-radius of the oval used to round the corners of the background (dp)
     private static final int DEFAULT_CORNER_RADIUS_DP = 2;
 
     /**
      * True if we're capable of, and want to, display an image, false otherwise. This acts as a switch: if we
      * don't want to show an image, most other state will be ignored because we don't need it to draw.
      *