@@ -43,8 +43,6 @@ import video.typetype.tv.ui.components.TextLabel
4343
4444class ScreensaverArt (val imageUrl : String , val title : String , val channel : String )
4545
46- // The mascot's animation was drawn on this colour; the same background keeps its soft glow seamless.
47- private val MascotBackground = Color (0xFF13151C )
4846private val DriftSpeed = 22 .dp
4947private const val SLIDE_MILLIS = 10_000L
5048private const val DRIFT_STEP_MILLIS = 100L
@@ -61,17 +59,17 @@ fun ScreensaverScreen(settings: Screensaver, artwork: List<ScreensaverArt>, modi
6159 // Fully darkened, nothing is drawn under the black: the screen stays still and costs nothing.
6260 if (settings.dimPercent >= FULL_DIM ) return @Box
6361 when (settings.style) {
64- ScreensaverStyle .Mascot -> Drifting (Modifier .background( MascotBackground ), MASCOT_HEIGHT , MASCOT_WIDTH ) { size -> Mascot (size) }
65- ScreensaverStyle .Logo -> Drifting (Modifier , LOGO_HEIGHT , LOGO_WIDTH ) { size -> BrandLogo (markSize = size) }
62+ ScreensaverStyle .Mascot -> Drifting (MASCOT_HEIGHT , MASCOT_WIDTH ) { size -> Mascot (size) }
63+ ScreensaverStyle .Logo -> Drifting (LOGO_HEIGHT , LOGO_WIDTH ) { size -> BrandLogo (markSize = size) }
6664 ScreensaverStyle .Thumbnails -> Thumbnails (artwork)
6765 }
6866 if (settings.dimPercent > 0 ) Box (Modifier .fillMaxSize().background(Color .Black .copy(alpha = settings.dimPercent / 100f )))
6967 }
7068}
7169
7270@Composable
73- private fun Drifting (background : Modifier , heightShare : Float , widthRatio : Float , content : @Composable (Dp ) -> Unit ) {
74- BoxWithConstraints (background .fillMaxSize()) {
71+ private fun Drifting (heightShare : Float , widthRatio : Float , content : @Composable (Dp ) -> Unit ) {
72+ BoxWithConstraints (Modifier .fillMaxSize()) {
7573 val density = LocalDensity .current
7674 val size = maxHeight * heightShare
7775 val freeWidth = with (density) { (maxWidth - size * widthRatio).roundToPx() }
@@ -106,7 +104,7 @@ private fun Mascot(size: Dp) {
106104@Composable
107105private fun Thumbnails (artwork : List <ScreensaverArt >) {
108106 if (artwork.isEmpty()) {
109- Drifting (Modifier , LOGO_HEIGHT , LOGO_WIDTH ) { size -> BrandLogo (markSize = size) }
107+ Drifting (LOGO_HEIGHT , LOGO_WIDTH ) { size -> BrandLogo (markSize = size) }
110108 return
111109 }
112110 var index by remember { mutableIntStateOf(0 ) }
0 commit comments