Skip to content
Snippets Groups Projects
Commit 6922e094 authored by cypherpunks1's avatar cypherpunks1 Committed by morgan
Browse files

fixup! [android] Modify UI/UX

Bug 43052: Hide normal and synced tabs in the tabs tray
parent 192b9bf7
2 merge requests!1203Bug 43052: Hide normal and synced tabs in the tabs tray (Android),!1202Bug_43099: 2024 YEC Strings
Pipeline #204774 passed
......@@ -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,
)
*/
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment