[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-153.0esr-16.0-1] fixup! [android] Modify UI/UX



Title: GitLab

Dan Ballard pushed to branch tor-browser-153.0esr-16.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • ecded608
    by clairehurst at 2026-07-21T16:14:06-06:00
    fixup! [android] Modify UI/UX
    
    Bug 45067: Clean up our TorHomePage padding
    

2 changed files:

Changes:

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
    ... ... @@ -575,7 +575,7 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    575 575
         private fun initComposeTorHomePageView(view: ComposeView) {
    
    576 576
             view.setContent {
    
    577 577
                 FirefoxTheme {
    
    578
    -                val isToolbarAtTop = requireComponents.settings.toolbarPosition == ToolbarPosition.TOP
    
    578
    +                val isToolbarAtTop = components.settings.toolbarPosition == ToolbarPosition.TOP
    
    579 579
                     Scaffold(
    
    580 580
                         modifier = Modifier
    
    581 581
                             .fillMaxSize()
    
    ... ... @@ -591,8 +591,8 @@ class HomeFragment : Fragment(), UserInteractionHandler {
    591 591
                             }
    
    592 592
                         },
    
    593 593
                         containerColor = Color.Transparent,
    
    594
    -                ) { _ ->
    
    595
    -                    TorHomePage(toolBarAtTop = isToolbarAtTop)
    
    594
    +                ) { innerPadding ->
    
    595
    +                    TorHomePage(innerPadding = innerPadding)
    
    596 596
                     }
    
    597 597
                 }
    
    598 598
             }
    

  • mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorHomePage.kt
    ... ... @@ -2,6 +2,7 @@ package org.mozilla.fenix.tor
    2 2
     
    
    3 3
     import androidx.compose.foundation.Image
    
    4 4
     import androidx.compose.foundation.layout.Column
    
    5
    +import androidx.compose.foundation.layout.PaddingValues
    
    5 6
     import androidx.compose.foundation.layout.Row
    
    6 7
     import androidx.compose.foundation.layout.Spacer
    
    7 8
     import androidx.compose.foundation.layout.fillMaxSize
    
    ... ... @@ -20,29 +21,34 @@ import androidx.compose.ui.graphics.Brush
    20 21
     import androidx.compose.ui.graphics.Color
    
    21 22
     import androidx.compose.ui.graphics.painter.BrushPainter
    
    22 23
     import androidx.compose.ui.res.colorResource
    
    23
    -import androidx.compose.ui.res.dimensionResource
    
    24 24
     import androidx.compose.ui.res.painterResource
    
    25 25
     import androidx.compose.ui.res.stringResource
    
    26 26
     import androidx.compose.ui.text.TextStyle
    
    27 27
     import androidx.compose.ui.text.font.FontWeight
    
    28 28
     import androidx.compose.ui.text.style.TextAlign
    
    29
    +import androidx.compose.ui.tooling.preview.PreviewParameter
    
    30
    +import androidx.compose.ui.tooling.preview.PreviewParameterProvider
    
    29 31
     import androidx.compose.ui.unit.dp
    
    30 32
     import androidx.compose.ui.unit.sp
    
    31 33
     import mozilla.components.compose.base.annotation.FlexibleWindowLightDarkPreview
    
    32 34
     import org.mozilla.fenix.R
    
    33 35
     
    
    36
    +class PaddingValuesParameterProvider : PreviewParameterProvider<PaddingValues> {
    
    37
    +    override val values = sequenceOf(
    
    38
    +        PaddingValues(top = 60.dp),
    
    39
    +        PaddingValues(bottom = 60.dp),
    
    40
    +    )
    
    41
    +}
    
    42
    +
    
    34 43
     @Composable
    
    35 44
     @FlexibleWindowLightDarkPreview
    
    36 45
     fun TorHomePage(
    
    37
    -    toolBarAtTop: Boolean = true,
    
    46
    +    @PreviewParameter(PaddingValuesParameterProvider::class) innerPadding: PaddingValues,
    
    38 47
     ) {
    
    39 48
         Column(
    
    40 49
             modifier = Modifier
    
    41 50
                 .fillMaxSize()
    
    42
    -            .padding(
    
    43
    -                top = if (toolBarAtTop) dimensionResource(R.dimen.browser_navbar_height) else 0.dp,
    
    44
    -                bottom = if (!toolBarAtTop) dimensionResource(R.dimen.browser_navbar_height) else 0.dp,
    
    45
    -            )
    
    51
    +            .padding(innerPadding)
    
    46 52
                 .paint(
    
    47 53
                     BrushPainter(
    
    48 54
                         Brush.linearGradient(
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx