Created
July 31, 2022 11:47
-
-
Save rubenquadros/ea4dd61c61f1a60361df90dae1bc1993 to your computer and use it in GitHub Desktop.
Center controls for player view
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 PlayerControls(modifier: Modifier = Modifier) { | |
//black overlay across the video player | |
Box(modifier = modifier.background(Color.Black.copy(alpha = 0.6f))) { | |
Row( | |
modifier = Modifier.align(Alignment.Center).fillMaxWidth(), | |
horizontalArrangement = Arrangement.SpaceEvenly | |
) { | |
//replay button | |
IconButton(modifier = Modifier.size(40.dp), onClick = {}) { | |
Image( | |
modifier = Modifier.fillMaxSize(), | |
contentScale = ContentScale.Crop, | |
painter = painterResource(id = R.drawable.ic_replay_5), | |
contentDescription = "Replay 5 seconds" | |
) | |
} | |
//pause/play toggle button | |
IconButton(modifier = Modifier.size(40.dp), onClick = {}) { | |
Image( | |
modifier = Modifier.fillMaxSize(), | |
contentScale = ContentScale.Crop, | |
painter = painterResource(id = R.drawable.ic_play), | |
contentDescription = "Play/Pause" | |
) | |
} | |
//forward button | |
IconButton(modifier = Modifier.size(40.dp), onClick = {}) { | |
Image( | |
modifier = Modifier.fillMaxSize(), | |
contentScale = ContentScale.Crop, | |
painter = painterResource(id = R.drawable.ic_forward_10), | |
contentDescription = "Forward 10 seconds" | |
) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment