Created
June 26, 2021 03:39
-
-
Save sergenes/fa47e58b73e0c94ec7bab36bcbedadc2 to your computer and use it in GitHub Desktop.
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 StudyCardsBottomBar( | |
index: Int, | |
count: Int, | |
side: CardFlipState = CardFlipState.FRONT_FACE, | |
frontSideColor: Color, | |
leftActionHandler: (CardFlipState) -> Unit = {}, | |
rightActionHandler: () -> Unit = {} | |
) { | |
Row( | |
verticalAlignment = Alignment.CenterVertically, | |
horizontalArrangement = Arrangement.SpaceEvenly, | |
modifier = Modifier.padding(smallSpace) | |
) { | |
val buttonColor = if (side == CardFlipState.FRONT_FACE) backSideColor else frontSideColor | |
val leftTitle = if (side == CardFlipState.FRONT_FACE) "Peep" else "Back" | |
val rightTitle = "Say" | |
NiceButton( | |
title = leftTitle, | |
backgroundColor = buttonColor, | |
onClick = { leftActionHandler.invoke(side) } | |
) | |
Spacer(Modifier.weight(1f)) | |
Text("${index + 1} of $count") | |
Spacer(Modifier.weight(1f)) | |
NiceButton( | |
title = rightTitle, | |
backgroundColor = buttonColor, | |
onClick = { rightActionHandler.invoke() } | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment