Bug 1394641: AS FaviconView shares styles; add distribution comments. r=sebastian
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 05 Sep 2017 16:16:53 -0700
changeset 428991 07a89d9a16a7582cc337d7e65fb88dfefb3522a1
parent 428990 bb9842835b311940e25ce59b68875c8dbf32ff07
child 428992 57f74d890cfeda58712bd6b5d2a0e66116714c98
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1394641
milestone57.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 1394641: AS FaviconView shares styles; add distribution comments. r=sebastian MozReview-Commit-ID: 7d2aXNDTxZs
mobile/android/app/src/main/res/layout/activity_stream_overridable_page_icon_layout.xml
mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
mobile/android/app/src/photon/res/values/styles.xml
--- a/mobile/android/app/src/main/res/layout/activity_stream_overridable_page_icon_layout.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_overridable_page_icon_layout.xml
@@ -1,26 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- 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/. -->
 <merge xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:gecko="http://schemas.android.com/tools">
 
-    <!-- The default visibilities are set in code.
-
-         centerInside will center smaller favicons and draw a colored border around them. -->
+    <!-- The default visibilities are set in code. -->
     <org.mozilla.gecko.widget.FaviconView
             android:id="@+id/favicon_view"
+            style="@style/ActivityStreamFaviconView"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            gecko:enableRoundCorners="false"
-            gecko:overrideScaleType="false"
-            android:scaleType="centerInside"
-            />
+            android:layout_height="match_parent"/>
 
     <ImageView
             android:id="@+id/image_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             />
 
 </merge>
\ No newline at end of file
--- a/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
@@ -1,26 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <FrameLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:gecko="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_marginBottom="@dimen/activity_stream_base_margin">
 
-    <!-- centerInside will center smaller favicons and draw a colored border around them. -->
     <org.mozilla.gecko.widget.FaviconView
         android:id="@+id/favicon"
+        style="@style/ActivityStreamFaviconView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        gecko:enableRoundCorners="false"
-        tools:background="@drawable/favicon_globe"
-        android:scaleType="centerInside"
-        gecko:overrideScaleType="false" />
+        tools:background="@drawable/favicon_globe"/>
 
     <!-- scrollHorizontally=false allows drags on the TextView to scroll the ViewPager.
          See https://stackoverflow.com/a/18171834/2219998 -->
     <TextView
         android:id="@+id/title"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="#66000000"
--- a/mobile/android/app/src/photon/res/values/styles.xml
+++ b/mobile/android/app/src/photon/res/values/styles.xml
@@ -1,14 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- 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/. -->
 
-<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
+<resources
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:tools="http://schemas.android.com/tools"
+        xmlns:gecko="http://schemas.android.com/apk/res-auto">
 
     <!--
         Base application styles. This could be overridden in other res/values-XXX/themes.xml.
     -->
     <style name="Widget"/>
 
     <style name="Widget.BaseButton" parent="android:style/Widget.Button"/>
 
@@ -819,16 +822,25 @@
         <item name="android:listDivider">@drawable/as_contextmenu_divider</item>
     </style>
 
     <style name="ActivityStreamButton" parent="Widget.AppCompat.Button.Colored">
         <item name="colorButtonNormal">@color/link_blue</item>
         <item name="android:textColor">@android:color/white</item>
     </style>
 
+    <!-- centerInside will downscale larger icons to fit or center smaller favicons and allow us to draw a colored
+         border around them. When changing these values, consider favicons downloaded from the internet and
+         those provided by suggested sites, including suggested sites from distributions. -->
+    <style name="ActivityStreamFaviconView">
+        <item name="enableRoundCorners">false</item>
+        <item name="overrideScaleType">false</item>
+        <item name="android:scaleType">centerInside</item>
+    </style>
+
     <!-- URL bar - Site identity -->
     <style name="UrlBar.SiteIdentity" parent="UrlBar.V15.SiteIdentity"/>
     <style name="UrlBar.Base.SiteIdentity" parent="UrlBar.Button">
         <item name="android:layout_width">@dimen/browser_toolbar_site_security_width</item>
         <item name="android:layout_height">@dimen/browser_toolbar_url_height</item>
         <item name="android:scaleType">center</item>
     </style>
     <style name="UrlBar.V15.SiteIdentity" parent="UrlBar.Base.SiteIdentity">