Skip to content

Commit

Permalink
For mozilla-mobile#26061: Make sure favicons are cropped correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketsroger committed Jul 27, 2022
1 parent 11a7085 commit 30093fe
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/org/mozilla/fenix/compose/Favicon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun Favicon(
modifier = modifier
.size(size)
.clip(RoundedCornerShape(2.dp)),
contentScale = ContentScale.Fit
contentScale = ContentScale.Crop,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private fun RecentBookmarkImage(bookmark: RecentBookmark) {
modifier = Modifier
.size(36.dp)
.clip(RoundedCornerShape(8.dp)),
contentScale = ContentScale.Fit
contentScale = ContentScale.Crop,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/library_site_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/favicon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
android:scaleType="centerCrop"
android:importantForAccessibility="no"
tools:src="@drawable/ic_folder_icon" />
<ImageView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
<style name="topSiteFavicon">
<item name="android:layout_width">@dimen/top_sites_favicon_size</item>
<item name="android:layout_height">@dimen/top_sites_favicon_size</item>
<item name="android:scaleType">fitCenter</item>
<item name="android:scaleType">centerCrop</item>
<item name="android:layout_gravity">center</item>
<item name="shapeAppearanceOverlay">@style/topSiteFaviconShape</item>
</style>
Expand Down

0 comments on commit 30093fe

Please sign in to comment.