This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Preview | |
@Composable | |
fun TestSingle() { | |
HomeListItem("Item Name", "03/13/21", SINGLE, false, {}, {}) | |
} | |
@Preview | |
@Composable | |
fun TestTop() { | |
HomeListItem("Item Name", "03/13/21", TOP, false, {}, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (editMode && deleteMode) { | |
Button( | |
onClick = { | |
onDelete() | |
deleteMode = false | |
}, | |
modifier = Modifier | |
.width(deleteButtonWidth) | |
.fillMaxHeight(), | |
shape = RoundedCornerShape(noRadius), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!editMode && !deleteMode) { | |
Icon( | |
imageVector = Icons.Filled.ChevronRight, | |
contentDescription = "forward", | |
modifier = Modifier.align(Alignment.CenterVertically) | |
) | |
Spacer(Modifier.width(normalRadius)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column(Modifier.weight(1f)) { | |
Column( | |
horizontalAlignment = Alignment.Start, | |
modifier = Modifier.padding(normalSpace) | |
) { | |
Text( | |
title, | |
style = MaterialTheme.typography.subtitle1, | |
color = secondaryColor, | |
maxLines = 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var deleteMode by remember { mutableStateOf(false) } | |
if (editMode && !deleteMode) { | |
Button( | |
onClick = { | |
deleteMode = !deleteMode | |
}, modifier = Modifier | |
.width(deleteButtonWidth) | |
.fillMaxHeight(), | |
shape = RoundedCornerShape(noRadius), | |
colors = ButtonDefaults.outlinedButtonColors( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Row( | |
verticalAlignment = Alignment.CenterVertically, | |
modifier = Modifier | |
.clickable(onClick = onClick) | |
.padding(normalSpace, noSpace, normalSpace, noSpace) | |
.fillMaxWidth() | |
.height(rowHeight) | |
.clip(shape) | |
.background(color = primaryColor) | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Column { | |
Row(){ | |
... | |
} | |
if (type != RowType.BOTTOM && type != RowType.SINGLE) { | |
Divider( | |
modifier = Modifier | |
.padding(normalSpace, noSpace, normalSpace, noSpace), | |
color = Color.White, | |
thickness = dividerNormalThickness |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val shape = when (type) { | |
RowType.TOP -> { | |
RoundedCornerShape(normalRadius, normalRadius) | |
} | |
RowType.BOTTOM -> { | |
RoundedCornerShape( | |
noRadius, | |
noRadius, | |
normalRadius, | |
normalRadius) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val primaryTextColor = Color(0xFF444444) | |
val primaryColor = Color(0xffadf4ff) | |
val normalSpace = 16.dp | |
val smallSpace = 8.dp | |
val noSpace = 0.dp | |
val normalTouchableHeight = 44.dp | |
val noRadius = 0.dp | |
val normalRadius = 16.dp | |
val rowHeight = 84.dp |