Bug 1920514 - Update tab strip item ui properties r=android-reviewers,calu

Differential Revision: https://phabricator.services.mozilla.com/D223284
This commit is contained in:
rahulsainani 2024-09-24 14:17:59 +00:00
parent afadfbae6f
commit 3a6127c2b7
2 changed files with 8 additions and 5 deletions

View File

@ -78,10 +78,10 @@ import org.mozilla.fenix.theme.Theme
private val minTabStripItemWidth = 160.dp
private val maxTabStripItemWidth = 280.dp
private val tabItemHeight = 40.dp
private val tabStripIconSize = 24.dp
private val spaceBetweenTabs = 4.dp
private val tabStripStartPadding = 8.dp
private val addTabIconSize = 20.dp
private val titleFadeWidth = 16.dp
/**
@ -160,7 +160,6 @@ private fun TabStripContent(
IconButton(onClick = onAddTabClick) {
Icon(
painter = painterResource(R.drawable.mozac_ic_plus_24),
modifier = Modifier.size(addTabIconSize),
tint = FirefoxTheme.colors.iconPrimary,
contentDescription = stringResource(R.string.add_tab),
)
@ -292,7 +291,7 @@ private fun TabItem(
val closeTabLabel = stringResource(R.string.close_tab)
TabStripCard(
modifier = modifier.fillMaxSize(),
modifier = modifier.height(tabItemHeight),
backgroundColor = backgroundColor,
elevation = if (state.isSelected) {
selectedTabStripCardElevation
@ -366,7 +365,11 @@ private fun TabItem(
) {
Icon(
painter = painterResource(R.drawable.mozac_ic_cross_20),
tint = FirefoxTheme.colors.iconPrimary,
tint = if (state.isSelected) {
FirefoxTheme.colors.iconPrimary
} else {
FirefoxTheme.colors.iconSecondary
},
contentDescription = stringResource(
id = R.string.close_tab_title,
state.title,

View File

@ -22,7 +22,7 @@ import org.mozilla.fenix.theme.FirefoxTheme
private val cardShape = RoundedCornerShape(8.dp)
internal val defaultTabStripCardElevation = 0.dp
internal val selectedTabStripCardElevation = 1.dp
internal val selectedTabStripCardElevation = 4.dp
/**
* Card composable used in Tab Strip items.