From 015b79f833a42030ea9b04b5f1b673e2da710690 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Wed, 27 Jul 2022 17:00:23 -0400 Subject: [PATCH] For #26061: Make sure favicons are cropped correctly --- app/src/main/java/org/mozilla/fenix/compose/Favicon.kt | 2 +- .../mozilla/fenix/home/recentbookmarks/view/RecentBookmarks.kt | 2 +- .../java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt | 3 ++- app/src/main/res/layout/library_site_item.xml | 3 ++- app/src/main/res/values/styles.xml | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/compose/Favicon.kt b/app/src/main/java/org/mozilla/fenix/compose/Favicon.kt index cbb6c2846427..10f4e3c9c6bb 100644 --- a/app/src/main/java/org/mozilla/fenix/compose/Favicon.kt +++ b/app/src/main/java/org/mozilla/fenix/compose/Favicon.kt @@ -67,7 +67,7 @@ fun Favicon( modifier = modifier .size(size) .clip(RoundedCornerShape(2.dp)), - contentScale = ContentScale.Fit + contentScale = ContentScale.Crop, ) } } diff --git a/app/src/main/java/org/mozilla/fenix/home/recentbookmarks/view/RecentBookmarks.kt b/app/src/main/java/org/mozilla/fenix/home/recentbookmarks/view/RecentBookmarks.kt index f91c63706f8d..8ad3026a5bcc 100644 --- a/app/src/main/java/org/mozilla/fenix/home/recentbookmarks/view/RecentBookmarks.kt +++ b/app/src/main/java/org/mozilla/fenix/home/recentbookmarks/view/RecentBookmarks.kt @@ -164,7 +164,7 @@ private fun RecentBookmarkImage(bookmark: RecentBookmark) { modifier = Modifier .size(36.dp) .clip(RoundedCornerShape(8.dp)), - contentScale = ContentScale.Fit + contentScale = ContentScale.Crop, ) } } diff --git a/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt b/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt index a9834a769770..da3aae1de3c3 100644 --- a/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt +++ b/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt @@ -159,7 +159,8 @@ private fun RecentTabItem( RecentTabIcon( url = tab.state.content.url, modifier = Modifier.size(18.dp).clip(RoundedCornerShape(2.dp)), - icon = tab.state.content.icon + contentScale = ContentScale.Crop, + icon = tab.state.content.icon, ) Spacer(modifier = Modifier.width(8.dp)) diff --git a/app/src/main/res/layout/library_site_item.xml b/app/src/main/res/layout/library_site_item.xml index 9fb89e41c2ba..3706deb56851 100644 --- a/app/src/main/res/layout/library_site_item.xml +++ b/app/src/main/res/layout/library_site_item.xml @@ -19,11 +19,12 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"> - @dimen/top_sites_favicon_size @dimen/top_sites_favicon_size - fitCenter + centerCrop center @style/topSiteFaviconShape