Tweak ValueSelectorDialog UI
This commit is contained in:
parent
78cbd9d129
commit
b7c11ad76d
1 changed files with 22 additions and 20 deletions
|
@ -21,7 +21,10 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.geometry.center
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.Shadow
|
||||||
import androidx.compose.ui.graphics.SolidColor
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
import androidx.compose.ui.text.TextRange
|
import androidx.compose.ui.text.TextRange
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
|
@ -274,30 +277,29 @@ inline fun <T> ValueSelectorDialog(
|
||||||
onValueSelected(value)
|
onValueSelected(value)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.padding(vertical = 8.dp, horizontal = 24.dp)
|
.padding(vertical = 12.dp, horizontal = 24.dp)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
) {
|
) {
|
||||||
if (selectedValue == value) {
|
if (selectedValue == value) {
|
||||||
Box(contentAlignment = Alignment.Center) {
|
Canvas(
|
||||||
Spacer(
|
modifier = Modifier
|
||||||
modifier = Modifier
|
.size(18.dp)
|
||||||
.size(18.dp)
|
.background(
|
||||||
.background(
|
color = colorPalette.primaryContainer,
|
||||||
color = colorPalette.primaryContainer,
|
shape = CircleShape
|
||||||
shape = CircleShape
|
)
|
||||||
)
|
) {
|
||||||
)
|
drawCircle(
|
||||||
|
color = colorPalette.onPrimaryContainer,
|
||||||
Spacer(
|
radius = 4.dp.toPx(),
|
||||||
modifier = Modifier
|
center = size.center,
|
||||||
.size(6.dp)
|
shadow = Shadow(
|
||||||
.background(
|
color = Color.Black.copy(alpha = 0.4f),
|
||||||
color = colorPalette.onPrimaryContainer,
|
blurRadius = 4.dp.toPx(),
|
||||||
shape = CircleShape
|
offset = Offset(x = 0f, y = 1.dp.toPx())
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Spacer(
|
Spacer(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
@ -334,4 +336,4 @@ inline fun <T> ValueSelectorDialog(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue