Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

513 - Highest emphasis buttons - Set background color to primary #514

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.rememberBottomSheetScaffoldState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand All @@ -42,14 +44,21 @@ import com.orange.ods.compose.theme.OdsTheme
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun ComponentButtons(variant: Variant) {
val customizationState = rememberButtonCustomizationState()
val customizationState = rememberButtonCustomizationState(buttonStyle = rememberSaveable {
mutableStateOf(
when (variant) {
Variant.ButtonsPrimary -> OdsButtonStyle.Primary
Variant.ButtonsFunctional -> OdsButtonStyle.FunctionalPositive
else -> OdsButtonStyle.Default
}
)
})

with(customizationState) {
ComponentCustomizationBottomSheetScaffold(
bottomSheetScaffoldState = rememberBottomSheetScaffoldState(),
bottomSheetContent = {
if (variant == Variant.ButtonsFunctional) {
this.buttonStyle.value = OdsButtonStyle.FunctionalPositive
Subtitle(textRes = R.string.component_button_style_functional, horizontalPadding = true)
OdsChoiceChipsFlowRow(
selectedChip = buttonStyle,
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- \[App\] Fix a bug where avatar have a default image ([#504](https://github.com/Orange-OpenSource/ods-android/issues/504))
- \[App\] Fix highest emphasis buttons background color ([#513](https://github.com/Orange-OpenSource/ods-android/issues/513))

## [0.12.0](https://github.com/Orange-OpenSource/ods-android/compare/0.11.1...0.12.0) - 2023-04-06

Expand Down