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
@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
@Composable | |
fun HomeList( | |
editMode: Boolean, | |
items: SnapshotStateList<ListFile>, | |
clickItemHandler: (Int) -> Unit, | |
deleteItemHandler: (Int) -> Unit | |
) { | |
Column { | |
when (items.size) { | |
1 -> items.first().let { |
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
@Composable | |
fun HomeListLazy( | |
editMode: Boolean, | |
itemsSource: SnapshotStateList<ListFile>, | |
clickItemHandler: (Int) -> Unit, | |
deleteItemHandler: (Int) -> Unit | |
) { | |
LazyColumn { | |
when (itemsSource.size) { | |
1 -> itemsSource.first().let { |
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
data class ListFile(var fileName: String, var created: String) | |
@Preview | |
@Composable | |
fun ListTest() { | |
var editMode by remember { mutableStateOf(false) } | |
val data = remember { | |
mutableStateListOf<ListFile>( | |
ListFile("Test 1", "11/06/2021"), | |
ListFile("Test 2", "11/07/2021"), |
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
compose_version = "1.0.0-beta08" | |
kotlin_version = "1.5.10" | |
// Material icons: | |
implementation "androidx.compose.material:material-icons-extended:$compose_version" |
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
enum class CardFlipState { | |
FRONT_FACE, BACK_FACE | |
} | |
val cornerRadiusBig = 20.dp | |
val normalElevation = 1.dp | |
val backSideColor = Color(0xFFfef49c) | |
val secondaryColor = Color(0xffb2ffa1) | |
val tertiaryColor = Color(0xFFb6caff) |
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 color = if (side == CardFlipState.FRONT_FACE) backgroundColor | |
else backSideColor | |
Surface( | |
modifier = modifier, | |
shape = RoundedCornerShape(cornerRadiusBig), | |
color = color, | |
elevation = normalElevation, | |
content = { | |
Scaffold( | |
modifier = Modifier.fillMaxSize(), |
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
@Composable | |
fun StudyCardsContent(data: String, backgroundColor: Color) { | |
Column( | |
modifier = Modifier | |
.fillMaxHeight() | |
.fillMaxWidth() | |
.background(backgroundColor), | |
verticalArrangement = Arrangement.Center, | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { |