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

morgan (@morgan) git at gitlab.torproject.org
Mon Sep 16 19:12:53 UTC 2024



morgan pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser


Commits:
6922e094 by cypherpunks1 at 2024-09-16T19:11:44+00:00
fixup! [android] Modify UI/UX

Bug 43052: Hide normal and synced tabs in the tabs tray

- - - - -


1 changed file:

- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayBanner.kt


Changes:

=====================================
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tabstray/TabsTrayBanner.kt
=====================================
@@ -50,6 +50,7 @@ import org.mozilla.fenix.compose.Divider
 import org.mozilla.fenix.compose.MenuItem
 import org.mozilla.fenix.compose.TabCounter
 import org.mozilla.fenix.compose.annotation.LightDarkPreview
+import org.mozilla.fenix.ext.settings
 import org.mozilla.fenix.tabstray.ext.getMenuItems
 import org.mozilla.fenix.theme.FirefoxTheme
 import kotlin.math.max
@@ -192,6 +193,7 @@ private fun TabPageBanner(
     onTabPageIndicatorClicked: (Page) -> Unit,
     onDismissClick: () -> Unit,
 ) {
+    val shouldDisableNormalMode = LocalContext.current.settings().shouldDisableNormalMode
     val selectedColor = FirefoxTheme.colors.iconActive
     val inactiveColor = FirefoxTheme.colors.iconPrimaryInactive
     var showMenu by remember { mutableStateOf(false) }
@@ -216,22 +218,24 @@ private fun TabPageBanner(
         ) {
             CompositionLocalProvider(LocalRippleTheme provides DisabledRippleTheme) {
                 TabRow(
-                    selectedTabIndex = selectedPage.ordinal,
+                    selectedTabIndex = if (shouldDisableNormalMode) 0 else selectedPage.ordinal,
                     modifier = Modifier.fillMaxWidth(MAX_WIDTH_TAB_ROW_PERCENT),
                     backgroundColor = Color.Transparent,
                     contentColor = selectedColor,
                     divider = {},
                 ) {
-                    Tab(
-                        selected = selectedPage == Page.NormalTabs,
-                        onClick = { onTabPageIndicatorClicked(Page.NormalTabs) },
-                        modifier = Modifier
-                            .fillMaxHeight()
-                            .testTag(TabsTrayTestTag.normalTabsPageButton),
-                        selectedContentColor = selectedColor,
-                        unselectedContentColor = inactiveColor,
-                    ) {
-                        TabCounter(tabCount = normalTabCount)
+                    if (!shouldDisableNormalMode) {
+                        Tab(
+                            selected = selectedPage == Page.NormalTabs,
+                            onClick = { onTabPageIndicatorClicked(Page.NormalTabs) },
+                            modifier = Modifier
+                                .fillMaxHeight()
+                                .testTag(TabsTrayTestTag.normalTabsPageButton),
+                            selectedContentColor = selectedColor,
+                            unselectedContentColor = inactiveColor,
+                        ) {
+                            TabCounter(tabCount = normalTabCount)
+                        }
                     }
 
                     Tab(
@@ -250,6 +254,7 @@ private fun TabPageBanner(
                         unselectedContentColor = inactiveColor,
                     )
 
+/*
                     Tab(
                         selected = selectedPage == Page.SyncedTabs,
                         onClick = { onTabPageIndicatorClicked(Page.SyncedTabs) },
@@ -265,6 +270,7 @@ private fun TabPageBanner(
                         selectedContentColor = selectedColor,
                         unselectedContentColor = inactiveColor,
                     )
+*/
                 }
             }
 



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/6922e09486f9896d911ef7a55cd12eb6c46bde93

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/6922e09486f9896d911ef7a55cd12eb6c46bde93
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240916/a60e104a/attachment-0001.htm>


More information about the tor-commits mailing list