From 636cfed2489847e452ffe8c698575126c4476330 Mon Sep 17 00:00:00 2001 From: "DESKTOP-M49RTHN\\cthuc" Date: Fri, 10 May 2024 12:09:31 +0200 Subject: [PATCH] update: [ANDROAPP-6097] code formatted --- .../dhis/common/screens/others/ChipsScreen.kt | 17 +++++++---------- .../ui/designsystem/component/AssistChip.kt | 16 +++++++--------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/others/ChipsScreen.kt b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/others/ChipsScreen.kt index e54453dbc..da5dc682e 100644 --- a/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/others/ChipsScreen.kt +++ b/common/src/commonMain/kotlin/org/hisp/dhis/common/screens/others/ChipsScreen.kt @@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Search import androidx.compose.material3.AssistChipDefaults -import androidx.compose.material3.FilterChipDefaults import androidx.compose.material3.Icon import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -66,12 +65,11 @@ fun ChipsScreen() { FilterChip(label = "Label", selected = false, badge = "3") Spacer(Modifier.size(Spacing.Spacing18)) - SubTitle("Assist Chips") - //var isSelected5 by remember { mutableStateOf(false) } + // var isSelected5 by remember { mutableStateOf(false) } AssistChip( label = "Label", - onClick = { } + onClick = { }, ) AssistChip( label = "Label", @@ -80,14 +78,13 @@ fun ChipsScreen() { imageVector = Icons.Filled.Search, contentDescription = "search icon", modifier = Modifier - .size(AssistChipDefaults.IconSize) + .size(AssistChipDefaults.IconSize), ) }, - onClick = { } + onClick = { }, ) Spacer(Modifier.size(Spacing.Spacing18)) - SubTitle("Assist Chips With badges") AssistChip( label = "Label", @@ -96,16 +93,16 @@ fun ChipsScreen() { imageVector = Icons.Filled.Search, contentDescription = "search icon", modifier = Modifier - .size(AssistChipDefaults.IconSize) + .size(AssistChipDefaults.IconSize), ) }, onClick = {}, - badge = "2" + badge = "2", ) AssistChip( label = "Label", onClick = {}, - badge = "4" + badge = "4", ) } } diff --git a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/AssistChip.kt b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/AssistChip.kt index 76475f62b..74bbd8677 100644 --- a/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/AssistChip.kt +++ b/designsystem/src/commonMain/kotlin/org/hisp/dhis/mobile/ui/designsystem/component/AssistChip.kt @@ -8,7 +8,6 @@ import androidx.compose.material.ripple.LocalRippleTheme import androidx.compose.material3.AssistChip import androidx.compose.material3.AssistChipDefaults import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.FilterChip import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider @@ -47,7 +46,6 @@ fun AssistChip( onClick: (() -> Unit), badge: String? = null, ) { - val interactionSource = remember { MutableInteractionSource() } val isPressed by interactionSource.collectIsPressedAsState() @@ -60,20 +58,20 @@ fun AssistChip( colors = if (isPressed) { AssistChipDefaults.assistChipColors( containerColor = SurfaceColor.Container, - leadingIconContentColor = TextColor.OnSurfaceVariant + leadingIconContentColor = TextColor.OnSurfaceVariant, ) } else { AssistChipDefaults.assistChipColors( containerColor = SurfaceColor.SurfaceBright, - leadingIconContentColor = TextColor.OnSurfaceVariant + leadingIconContentColor = TextColor.OnSurfaceVariant, ) - }, + }, border = AssistChipDefaults.assistChipBorder( - borderColor = Outline.Dark, - ), + borderColor = Outline.Dark, + ), leadingIcon = { icon?.invoke() - } + }, ) } @@ -88,4 +86,4 @@ fun AssistChip( ) } } -} \ No newline at end of file +}