Bug 1390620: Set centerInside StreamPageIconLayout's FaviconView; add comments. r=sebastian draft
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 15 Aug 2017 13:54:57 -0700
changeset 646943 7f227b4e284cf6e8c77d9d0b9c50019959ad97af
parent 646884 7ff4c2f1fe11f6b98686f783294692893b1e1e8b
child 726365 5585cb0733984639f4f66feafd3e09a043e5726f
push id74253
push usermichael.l.comella@gmail.com
push dateTue, 15 Aug 2017 20:58:54 +0000
reviewerssebastian
bugs1390620
milestone57.0a1
Bug 1390620: Set centerInside StreamPageIconLayout's FaviconView; add comments. r=sebastian See in-code comments for why centerInside is necessary. Note that the code I failed to rebase actually used `fitCenter`, but I think it should be consistent with TopSites and use `centerInside`. MozReview-Commit-ID: 5s6aCzcfUn7
mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
mobile/android/app/src/main/res/layout/activity_stream_page_icon_layout.xml
mobile/android/app/src/main/res/layout/activity_stream_topsites_card.xml
--- a/mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_card_history_item.xml
@@ -22,17 +22,16 @@
                 android:layout_width="@dimen/favicon_bg"
                 android:layout_height="@dimen/favicon_bg"
                 android:layout_marginStart="@dimen/activity_stream_base_margin"
                 android:layout_marginLeft="@dimen/activity_stream_base_margin"
                 android:layout_marginTop="@dimen/activity_stream_base_margin"
                 android:layout_marginBottom="@dimen/activity_stream_base_margin"
                 android:layout_gravity="center"
                 tools:background="@drawable/favicon_globe" />
-        <!-- todo: overrideScaleType, scaleType=fitCnetetr -->
 
     </FrameLayout>
 
     <ImageView
         android:id="@+id/menu"
         android:layout_width="32dp"
         android:layout_height="48dp"
         android:layout_alignParentEnd="true"
--- a/mobile/android/app/src/main/res/layout/activity_stream_page_icon_layout.xml
+++ b/mobile/android/app/src/main/res/layout/activity_stream_page_icon_layout.xml
@@ -1,21 +1,25 @@
 <?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. -->
+    <!-- The default visibilities are set in code.
+
+         centerInside will center smaller favicons and draw a colored border around them. -->
     <org.mozilla.gecko.widget.FaviconView
             android:id="@+id/favicon_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             gecko:enableRoundCorners="false"
+            gecko:overrideScaleType="false"
+            android:scaleType="centerInside"
             />
 
     <ImageView
             android:id="@+id/image_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             />
 
--- 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
@@ -2,16 +2,17 @@
 <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"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         gecko:enableRoundCorners="false"
         tools:background="@drawable/favicon_globe"
         android:scaleType="centerInside"
         gecko:overrideScaleType="false" />