Skip to content

Instantly share code, notes, and snippets.

@arildojr7
Last active November 22, 2021 18:59
Show Gist options
  • Save arildojr7/f6fde329c80baf585242426abcf21571 to your computer and use it in GitHub Desktop.
Save arildojr7/f6fde329c80baf585242426abcf21571 to your computer and use it in GitHub Desktop.
@Composable
fun TunerScreen(tunerState: TunerState) {
Column(
modifier = Modifier.fillMaxSize().background(tunerState.bgColor),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Row(verticalAlignment = Alignment.CenterVertically) {
LeftArrow(isVisible = tunerState is TunerState.Down)
TextNote(note = tunerState.note.title)
RightArrow(isVisible = tunerState is TunerState.Up)
}
}
}
@Preview(widthDp = 200, heightDp = 200)
@Composable
fun TunedView() = TunerScreen(TunerState.Tuned(NotesEnum.A))
@Preview(widthDp = 200, heightDp = 200)
@Composable
fun OutOfTuneViewDown() = TunerScreen(TunerState.Down(NotesEnum.A))
@Preview(widthDp = 200, heightDp = 200)
@Composable
fun OutOfTuneViewUp() = TunerScreen(TunerState.Up(NotesEnum.A))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment