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
--- 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" />