This file contains 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
fun drawArcPath(size: Size): Path { | |
return Path().apply { | |
reset() | |
// go from (0,0) to (width, 0) | |
lineTo(size.width, 0f) | |
// go from (width, 0) to (width, height) | |
lineTo(size.width, size.height) |
This file contains 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 GameImage( | |
image: String, | |
modifier: Modifier = Modifier | |
) { | |
Image( | |
modifier = | |
modifier | |
.fillMaxWidth() | |
.height(300.dp) |
This file contains 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 GameDescription(description: String) { | |
val maxLines = remember { mutableStateOf(4) } | |
val toggle = remember { | |
mutableStateOf(DescriptionStatus.DEFAULT) | |
} | |
Column { | |
// Desctiption text |
This file contains 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
class GameDetailsTest { | |
@get:Rule val composeTestRule = createComposeRule() | |
@Test | |
fun game_details_should_be_shown() { | |
composeTestRule.setContent { | |
EpicWorldTheme { | |
GameDetails( | |
gameDetails = |
This file contains 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 ShowGameVideos(gameVideos: GameVideosEntity) { | |
Column(modifier = Modifier.fillMaxSize()) { | |
// video player | |
VideoPlayer( | |
modifier = | |
Modifier.fillMaxWidth() | |
.weight(1f, fill = true) | |
.background(Color.Black) | |
) |
This file contains 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 VideoPlayer(modifier: Modifier = Modifier) { | |
val context = LocalContext.current | |
// create our player | |
val exoPlayer = remember { | |
SimpleExoPlayer.Builder(context).build().apply { | |
this.prepare() | |
} | |
} |
This file contains 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 VideoPlayer( | |
modifier: Modifier = Modifier, | |
gameVideos: List<VideoResultEntity> | |
) { | |
val context = LocalContext.current | |
val mediaItems = arrayListOf<MediaItem>() | |
// create MediaItem | |
gameVideos.forEach { |
This file contains 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
@ExperimentalAnimationApi | |
@Composable | |
fun VideoPlayer( | |
modifier: Modifier = Modifier, | |
gameVideos: List<VideoResultEntity> | |
) { | |
val context = LocalContext.current | |
val mediaItems = arrayListOf<MediaItem>() | |
val videoTitle = remember { |
This file contains 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 VideoPlayList( | |
modifier: Modifier = Modifier, | |
gameVideos: List<VideoResultEntity> | |
) { | |
LazyColumn(modifier = modifier) { | |
itemsIndexed( | |
items = gameVideos, | |
key = { _, item -> item.id } | |
) { index, item -> |
This file contains 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 VideoItem(index: Int, video: VideoResultEntity) { | |
val currentlyPlaying = remember { mutableStateOf(true) } | |
ConstraintLayout( | |
modifier = | |
Modifier.testTag("VideoParent") | |
.padding(8.dp) | |
.wrapContentSize() | |
) { |