mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-22 19:02:12 +00:00
Update: Favorites' chip layout
This commit is contained in:
parent
ca7900234a
commit
1e597c48c7
@ -35,7 +35,6 @@ import androidx.compose.ui.unit.Dp
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.machiav3lli.fdroid.ui.compose.icons.Phosphor
|
import com.machiav3lli.fdroid.ui.compose.icons.Phosphor
|
||||||
import com.machiav3lli.fdroid.ui.compose.icons.phosphor.Check
|
import com.machiav3lli.fdroid.ui.compose.icons.phosphor.Check
|
||||||
import com.machiav3lli.fdroid.ui.compose.utils.compositeOverBackground
|
|
||||||
|
|
||||||
private enum class SelectionState { Unselected, Selected }
|
private enum class SelectionState { Unselected, Selected }
|
||||||
|
|
||||||
@ -64,10 +63,7 @@ private fun categoryChipTransition(selected: Boolean): CategoryChipTransition {
|
|||||||
val contentColor = transition.animateColor(label = "chip_content_alpha") { state ->
|
val contentColor = transition.animateColor(label = "chip_content_alpha") { state ->
|
||||||
when (state) {
|
when (state) {
|
||||||
SelectionState.Unselected -> MaterialTheme.colorScheme.surface
|
SelectionState.Unselected -> MaterialTheme.colorScheme.surface
|
||||||
SelectionState.Selected -> MaterialTheme.colorScheme.primaryContainer.compositeOverBackground(
|
SelectionState.Selected -> MaterialTheme.colorScheme.primaryContainer
|
||||||
alpha = 0.8f,
|
|
||||||
background = MaterialTheme.colorScheme.onBackground
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val checkScale = transition.animateFloat(
|
val checkScale = transition.animateFloat(
|
||||||
@ -104,7 +100,7 @@ fun CategoryChip(
|
|||||||
clip = true
|
clip = true
|
||||||
},
|
},
|
||||||
color = categoryChipTransitionState.contentColor,
|
color = categoryChipTransitionState.contentColor,
|
||||||
tonalElevation = 8.dp
|
tonalElevation = 48.dp
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -116,7 +112,7 @@ fun CategoryChip(
|
|||||||
Icon(
|
Icon(
|
||||||
imageVector = Phosphor.Check,
|
imageVector = Phosphor.Check,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = MaterialTheme.colorScheme.onSurface,
|
tint = MaterialTheme.colorScheme.onPrimaryContainer,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.wrapContentSize()
|
.wrapContentSize()
|
||||||
.graphicsLayer {
|
.graphicsLayer {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user