Skip to content

Commit df5ef14

Browse files
authored
fix: tertiary selected button color [WPB-15120] (#3757)
1 parent 8792a6c commit df5ef14

File tree

4 files changed

+87
-28
lines changed

4 files changed

+87
-28
lines changed

app/src/main/kotlin/com/wire/android/ui/home/HomeTopBar.kt

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ fun HomeTopBar(
7070
}
7171
if (navigationItem.withUserAvatar) {
7272
val openLabel = stringResource(R.string.content_description_open_label)
73-
val contentDescription = if (shouldShowCreateTeamUnreadIndicator) {
74-
stringResource(R.string.content_description_home_profile_btn_with_notification)
75-
} else {
76-
stringResource(R.string.content_description_home_profile_btn)
77-
}
73+
val contentDescription = if (shouldShowCreateTeamUnreadIndicator) {
74+
stringResource(R.string.content_description_home_profile_btn_with_notification)
75+
} else {
76+
stringResource(R.string.content_description_home_profile_btn)
77+
}
7878
UserProfileAvatar(
7979
avatarData = userAvatarData,
8080
clickable = remember {
@@ -87,7 +87,7 @@ fun HomeTopBar(
8787
legalHoldIndicatorVisible = withLegalHoldIndicator
8888
),
8989
shouldShowCreateTeamUnreadIndicator = shouldShowCreateTeamUnreadIndicator,
90-
contentDescription = contentDescription
90+
contentDescription = contentDescription
9191
)
9292
}
9393
},
@@ -112,6 +112,27 @@ fun PreviewTopBar() {
112112
}
113113
}
114114

115+
@PreviewMultipleThemes
116+
@Composable
117+
fun PreviewTopBarWithSelectedFilter() {
118+
WireTheme {
119+
HomeTopBar(
120+
navigationItem = HomeDestination.Group,
121+
userAvatarData = UserAvatarData(
122+
asset = null,
123+
availabilityStatus = UserAvailabilityStatus.AVAILABLE,
124+
nameBasedAvatar = NameBasedAvatar("Jon Doe", -1)
125+
),
126+
elevation = 0.dp,
127+
withLegalHoldIndicator = false,
128+
shouldShowCreateTeamUnreadIndicator = false,
129+
onHamburgerMenuClick = {},
130+
onNavigateToSelfUserProfile = {},
131+
onOpenConversationFilter = {}
132+
)
133+
}
134+
}
135+
115136
@PreviewMultipleThemes
116137
@Composable
117138
fun PreviewSettingsTopBarWithoutAvatar() {

core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryButton.kt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@ import androidx.compose.runtime.remember
3232
import androidx.compose.ui.Modifier
3333
import androidx.compose.ui.graphics.Shape
3434
import androidx.compose.ui.text.TextStyle
35-
import androidx.compose.ui.tooling.preview.Preview
3635
import androidx.compose.ui.unit.Dp
3736
import androidx.compose.ui.unit.DpSize
3837
import androidx.compose.ui.unit.dp
3938
import com.wire.android.model.ClickBlockParams
4039
import com.wire.android.ui.common.Icon
40+
import com.wire.android.ui.theme.WireTheme
4141
import com.wire.android.ui.theme.wireDimensions
4242
import com.wire.android.ui.theme.wireTypography
43+
import com.wire.android.util.PreviewMultipleThemes
4344

4445
@Composable
4546
fun WireTertiaryButton(
@@ -93,15 +94,15 @@ fun WireTertiaryButton(
9394
description = description
9495
)
9596

96-
@Preview(name = "Default WireSecondaryButton")
97+
@PreviewMultipleThemes
9798
@Composable
98-
fun PreviewWireTertiaryButton() {
99+
fun PreviewWireTertiaryButton() = WireTheme {
99100
WireTertiaryButton(onClick = { }, text = "text")
100101
}
101102

102-
@Preview(name = "Default narrow WireTertiaryButton with icon")
103+
@PreviewMultipleThemes
103104
@Composable
104-
fun PreviewWireTertiaryButtonNarrowWithIcons() {
105+
fun PreviewWireTertiaryButtonNarrowWithIcons() = WireTheme {
105106
WireTertiaryButton(
106107
onClick = { },
107108
text = "text",
@@ -111,9 +112,9 @@ fun PreviewWireTertiaryButtonNarrowWithIcons() {
111112
)
112113
}
113114

114-
@Preview(name = "Default narrow WireTertiaryButton only icon")
115+
@PreviewMultipleThemes
115116
@Composable
116-
fun PreviewWireTertiaryButtonNarrowOnlyIcons() {
117+
fun PreviewWireTertiaryButtonNarrowOnlyIcons() = WireTheme {
117118
WireTertiaryButton(
118119
onClick = { },
119120
leadingIcon = Icons.Filled.Search.Icon(),
@@ -122,20 +123,20 @@ fun PreviewWireTertiaryButtonNarrowOnlyIcons() {
122123
)
123124
}
124125

125-
@Preview(name = "Default narrow Disabled WireSecondaryButton")
126+
@PreviewMultipleThemes
126127
@Composable
127-
fun PreviewWireTertiaryButtonDisabled() {
128+
fun PreviewWireTertiaryButtonDisabled() = WireTheme {
128129
WireTertiaryButton(onClick = { }, state = WireButtonState.Disabled, text = "text", fillMaxWidth = false)
129130
}
130131

131-
@Preview(name = "Selected narrow WireSecondaryButton")
132+
@PreviewMultipleThemes
132133
@Composable
133-
fun PreviewWireTertiaryButtonSelected() {
134+
fun PreviewWireTertiaryButtonSelected() = WireTheme {
134135
WireTertiaryButton(onClick = { }, state = WireButtonState.Selected, text = "text", fillMaxWidth = false)
135136
}
136137

137-
@Preview(name = "Error narrow WireSecondaryButton")
138+
@PreviewMultipleThemes
138139
@Composable
139-
fun PreviewWireTertiaryButtonError() {
140+
fun PreviewWireTertiaryButtonError() = WireTheme {
140141
WireTertiaryButton(onClick = { }, state = WireButtonState.Error, text = "text", fillMaxWidth = false)
141142
}

core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireTertiaryIconButton.kt

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ import androidx.compose.ui.Modifier
3131
import androidx.compose.ui.graphics.Shape
3232
import androidx.compose.ui.res.painterResource
3333
import androidx.compose.ui.res.stringResource
34-
import androidx.compose.ui.tooling.preview.Preview
3534
import androidx.compose.ui.unit.Dp
3635
import androidx.compose.ui.unit.DpSize
3736
import androidx.compose.ui.unit.dp
3837
import com.wire.android.model.ClickBlockParams
3938
import com.wire.android.ui.common.R
4039
import com.wire.android.ui.common.dimensions
40+
import com.wire.android.ui.common.preview.MultipleThemePreviews
41+
import com.wire.android.ui.theme.WireTheme
4142
import com.wire.android.ui.theme.wireDimensions
4243

4344
@Composable
@@ -78,21 +79,57 @@ fun WireTertiaryIconButton(
7879
)
7980
}
8081

81-
@Preview
82+
@MultipleThemePreviews
8283
@Composable
83-
fun PreviewWireTertiaryIconButton() {
84+
fun PreviewWireTertiaryIconButton() = WireTheme {
8485
WireTertiaryIconButton({}, loading = false, iconResource = R.drawable.ic_close, contentDescription = 0)
8586
}
8687

87-
@Preview
88+
@MultipleThemePreviews
8889
@Composable
89-
fun PreviewWireTertiaryIconButtonLoading() {
90+
fun PreviewWireTertiaryIconButtonSelected() = WireTheme {
91+
WireTertiaryIconButton(
92+
{},
93+
loading = false,
94+
iconResource = R.drawable.ic_close,
95+
contentDescription = 0,
96+
state = WireButtonState.Selected,
97+
)
98+
}
99+
100+
@MultipleThemePreviews
101+
@Composable
102+
fun PreviewWireTertiaryIconButtonError() = WireTheme {
103+
WireTertiaryIconButton(
104+
{},
105+
loading = false,
106+
iconResource = R.drawable.ic_close,
107+
contentDescription = 0,
108+
state = WireButtonState.Error,
109+
)
110+
}
111+
112+
@MultipleThemePreviews
113+
@Composable
114+
fun PreviewWireTertiaryIconButtonDisabled() = WireTheme {
115+
WireTertiaryIconButton(
116+
{},
117+
loading = false,
118+
iconResource = R.drawable.ic_close,
119+
contentDescription = 0,
120+
state = WireButtonState.Disabled,
121+
)
122+
}
123+
124+
@MultipleThemePreviews
125+
@Composable
126+
fun PreviewWireTertiaryIconButtonLoading() = WireTheme {
90127
WireTertiaryIconButton({}, loading = true, iconResource = R.drawable.ic_close, contentDescription = 0)
91128
}
92129

93-
@Preview
130+
@MultipleThemePreviews
94131
@Composable
95-
fun PreviewWireTertiaryIconButtonRound() {
132+
fun PreviewWireTertiaryIconButtonRound() = WireTheme {
96133
WireTertiaryIconButton(
97134
{},
98135
loading = false,

core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ private val DarkWireColorScheme = WireColorScheme(
227227
secondaryButtonRipple = Color.White,
228228
tertiaryButtonEnabled = Color.Transparent, onTertiaryButtonEnabled = Color.White,
229229
tertiaryButtonDisabled = Color.Transparent, onTertiaryButtonDisabled = WireColorPalette.Gray60,
230-
tertiaryButtonSelected = WireColorPalette.DarkBlue50, onTertiaryButtonSelected = WireColorPalette.DarkBlue500,
231-
tertiaryButtonSelectedOutline = WireColorPalette.DarkBlue300,
230+
tertiaryButtonSelected = WireColorPalette.DarkBlue800, onTertiaryButtonSelected = WireColorPalette.DarkBlue500,
231+
tertiaryButtonSelectedOutline = WireColorPalette.DarkBlue800,
232232
tertiaryButtonRipple = Color.White,
233233

234234
// strokes and shadows

0 commit comments

Comments
 (0)