Deepak Gahlot
05/11/2021, 9:48 AMDeepak Gahlot
05/11/2021, 9:51 AM.selectable(
selected = false,
onClick = { },
indication = ???
),
Deepak Gahlot
05/11/2021, 9:55 AMCicero
05/11/2021, 10:08 AMDeepak Gahlot
05/11/2021, 10:51 AMCicero
05/11/2021, 10:54 AM@Composable
fun SelectableItem(
modifier: Modifier = Modifier,
text: String,
selected: Boolean = false,
onClick: (() -> Unit)? = null,
) {
Button(
onClick = { onClick?.invoke() },
modifier = modifier
.height(gu17)
.fillMaxWidth()
.defaultMinSize(minHeight = gu15),
elevation = ButtonDefaults.elevation(Elevation),
border = if (selected) BorderStroke(SelectableItemBorderStroke, AppColor.SelectableItemBorder) else null,
colors = ButtonDefaults.buttonColors(backgroundColor = AppColor.SelectableItemBackground),
) {
Text(
modifier = Modifier.padding(gu1),
text = text,
style = SelectiableItem(),
fontStyle = null,
fontWeight = null,
fontFamily = null,
textDecoration = null,
textAlign = TextAlign.Center,
overflow = TextOverflow.Ellipsis,
softWrap = true,
maxLines = 3
)
}
}
Cicero
05/11/2021, 10:54 AMCicero
05/11/2021, 10:54 AMDeepak Gahlot
05/11/2021, 10:55 AMste
05/11/2021, 3:43 PMDeepak Gahlot
05/11/2021, 3:44 PM