Skip to content

Commit 3fa4edb

Browse files
committed
Added cover in vertical and horizontal page, when song is a video
1 parent 70940f7 commit 3fa4edb

File tree

1 file changed

+42
-0
lines changed
  • composeApp/src/androidMain/kotlin/it/fast4x/riplay/ui/screens/player/unified

1 file changed

+42
-0
lines changed

composeApp/src/androidMain/kotlin/it/fast4x/riplay/ui/screens/player/unified/UnifiedPlayer.kt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,27 @@ fun UnifiedPlayer(
27082708
}
27092709
}
27102710
}
2711+
} else {
2712+
// if isVideo
2713+
Box(
2714+
modifier = Modifier
2715+
.zIndex(
2716+
if (index == pagerState.currentPage) 1f
2717+
else if (index == (pagerState.currentPage + 1) || index == (pagerState.currentPage - 1)) 0.85f
2718+
else if (index == (pagerState.currentPage + 2) || index == (pagerState.currentPage - 2)) 0.78f
2719+
else if (index == (pagerState.currentPage + 3) || index == (pagerState.currentPage - 3)) 0.73f
2720+
else if (index == (pagerState.currentPage + 4) || index == (pagerState.currentPage - 4)) 0.68f
2721+
else if (index == (pagerState.currentPage + 5) || index == (pagerState.currentPage - 5)) 0.63f
2722+
else 0.57f
2723+
)
2724+
) {
2725+
Image(
2726+
painter = coverPainter,
2727+
contentDescription = "",
2728+
contentScale = ContentScale.Fit,
2729+
modifier = Modifier.fillMaxSize(.5f).align(Alignment.Center)
2730+
)
2731+
}
27112732
}
27122733
}
27132734

@@ -3559,6 +3580,27 @@ fun UnifiedPlayer(
35593580
}
35603581
}
35613582
}
3583+
} else {
3584+
// if isVideo
3585+
Box(
3586+
modifier = coverModifier
3587+
.zIndex(
3588+
if (index == pagerState.currentPage) 1f
3589+
else if (index == (pagerState.currentPage + 1) || index == (pagerState.currentPage - 1)) 0.85f
3590+
else if (index == (pagerState.currentPage + 2) || index == (pagerState.currentPage - 2)) 0.78f
3591+
else if (index == (pagerState.currentPage + 3) || index == (pagerState.currentPage - 3)) 0.73f
3592+
else if (index == (pagerState.currentPage + 4) || index == (pagerState.currentPage - 4)) 0.68f
3593+
else if (index == (pagerState.currentPage + 5) || index == (pagerState.currentPage - 5)) 0.63f
3594+
else 0.57f
3595+
)
3596+
) {
3597+
Image(
3598+
painter = coverPainter,
3599+
contentDescription = "",
3600+
contentScale = ContentScale.Fit,
3601+
modifier = Modifier.fillMaxSize(.5f).align(Alignment.Center)
3602+
)
3603+
}
35623604
}
35633605

35643606
}

0 commit comments

Comments
 (0)