commit 45c84061957b41bd9d8cb8ea76fb0f62fbba829e
parent f9eb64b2d14e6eef8a2fc1bc3bb3ea3f0f83d47f
Author: Devota Aabel <daabel@mozilla.com>
Date: Thu, 11 Dec 2025 17:46:07 +0000
Bug 2004080- When there's only one row of top sites, remove the extra space below it. r=gl,android-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D276002
Diffstat:
1 file changed, 0 insertions(+), 26 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/topsites/TopSites.kt
@@ -146,7 +146,6 @@ fun TopSites(
onTopSitesItemBound: () -> Unit,
) {
val topSitesToShow = topSites.take(TOP_SITES_TO_SHOW).chunked(TOP_SITES_PER_ROW)
- val needsInvisibleRow = topSites.size <= (TOP_SITES_TO_SHOW - TOP_SITES_PER_ROW)
Column(
modifier = Modifier
@@ -192,37 +191,12 @@ fun TopSites(
Spacer(modifier = Modifier.height(12.dp))
}
}
-
- if (needsInvisibleRow) {
- InvisibleRow()
- }
}
}
}
}
/**
- * Workaround for when the second pager page only has one row, and the pager shrinks to fit. This
- * invisible row mimics top sites items to match the correct height.
- */
-@Composable
-private fun InvisibleRow() {
- Spacer(modifier = Modifier.height(4.dp + TOP_SITES_FAVICON_CARD_SIZE.dp + 6.dp))
-
- Text(
- text = "",
- style = FirefoxTheme.typography.caption,
- )
-
- Text(
- text = "",
- fontSize = 10.sp,
- )
-
- Spacer(modifier = Modifier.height(12.dp))
-}
-
-/**
* Represents the colors used by top sites.
*/
data class TopSiteColors(