tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 2ae1f29444bfb772c6824debd877a09d546a3882
parent 4647a493653b457e1e838d10fbf436695be29ec7
Author: Devota Aabel <daabel@mozilla.com>
Date:   Sat,  6 Dec 2025 01:03:10 +0000

Bug 2002321- Update jump back in homepage section to match new card style. r=gl,android-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D275310

Diffstat:
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/fake/FakeHomepagePreview.kt | 1+
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt | 33+++++++++++++++++++--------------
2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/fake/FakeHomepagePreview.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/fake/FakeHomepagePreview.kt @@ -301,6 +301,7 @@ internal object FakeHomepagePreview { id = randomId(), content = ContentState( url = URL, + title = "A title that is really really really long", ), ), ), diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/recenttabs/view/RecentTabs.kt @@ -14,15 +14,12 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Card -import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text @@ -60,6 +57,8 @@ import org.mozilla.fenix.compose.Image import org.mozilla.fenix.compose.TabThumbnail import org.mozilla.fenix.home.fake.FakeHomepagePreview import org.mozilla.fenix.home.recenttabs.RecentTab +import org.mozilla.fenix.home.topsites.ui.HomepageCard +import org.mozilla.fenix.home.topsites.ui.homepageCardImageShape import org.mozilla.fenix.theme.FirefoxTheme private const val THUMBNAIL_SIZE = 108 @@ -121,33 +120,39 @@ private fun RecentTabItem( ) { var isMenuExpanded by remember { mutableStateOf(false) } - Card( + HomepageCard( modifier = Modifier .fillMaxWidth() - .height(112.dp) + .wrapContentHeight() .combinedClickable( enabled = true, onClick = { onRecentTabClick(tab.state.id) }, onLongClick = { isMenuExpanded = true }, ), - shape = RoundedCornerShape(8.dp), - colors = CardDefaults.cardColors(containerColor = backgroundColor), - elevation = CardDefaults.cardElevation(defaultElevation = 6.dp), + backgroundColor = backgroundColor, ) { Row( - modifier = Modifier.padding(16.dp), + modifier = Modifier.padding( + start = FirefoxTheme.layout.space.static50, + top = FirefoxTheme.layout.space.static50, + bottom = FirefoxTheme.layout.space.static50, + end = FirefoxTheme.layout.space.static100, + ), + verticalAlignment = Alignment.CenterVertically, ) { RecentTabImage( tab = tab, modifier = Modifier .size(108.dp, 80.dp) - .clip(RoundedCornerShape(8.dp)), + .clip(homepageCardImageShape), ) - Spacer(modifier = Modifier.width(16.dp)) + Spacer(modifier = Modifier.width(FirefoxTheme.layout.space.static100)) Column( - modifier = Modifier.fillMaxSize(), + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight(), verticalArrangement = Arrangement.SpaceBetween, ) { Text( @@ -162,7 +167,7 @@ private fun RecentTabItem( overflow = TextOverflow.Ellipsis, ) - Row { + Row(verticalAlignment = Alignment.CenterVertically) { RecentTabIcon( url = tab.state.content.url, modifier = Modifier