diff --git a/CHANGELOG.md b/CHANGELOG.md index f05df2f..af97e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ ## Unreleased * 🐛 Changed THEOplayer to be an `api` dependency in Gradle. ([#76](https://github.com/THEOplayer/android-ui/pull/76)) +* 🐛 The alpha value of the `UIController`'s background color is now correctly preserved. ([#78](https://github.com/THEOplayer/android-ui/issues/78), [#79](https://github.com/THEOplayer/android-ui/pull/79)) ## v1.13.0 (2025-09-12) diff --git a/ui/src/main/java/com/theoplayer/android/ui/UIController.kt b/ui/src/main/java/com/theoplayer/android/ui/UIController.kt index e378101..cb1216c 100644 --- a/ui/src/main/java/com/theoplayer/android/ui/UIController.kt +++ b/ui/src/main/java/com/theoplayer/android/ui/UIController.kt @@ -80,7 +80,7 @@ fun UIController( modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, - color: Color = Color.Black, + color: Color = Color.Black.copy(alpha = 0.5f), centerOverlay: (@Composable UIControllerScope.() -> Unit)? = null, errorOverlay: (@Composable UIControllerScope.() -> Unit)? = null, topChrome: (@Composable UIControllerScope.() -> Unit)? = null, @@ -126,7 +126,7 @@ fun UIController( fun UIController( modifier: Modifier = Modifier, player: Player = rememberPlayer(), - color: Color = Color.Black, + color: Color = Color.Black.copy(alpha = 0.5f), centerOverlay: (@Composable UIControllerScope.() -> Unit)? = null, errorOverlay: (@Composable UIControllerScope.() -> Unit)? = null, topChrome: (@Composable UIControllerScope.() -> Unit)? = null, @@ -187,7 +187,7 @@ fun UIController( } val background by animateColorAsState( label = "BackgroundAnimation", - targetValue = color.copy(alpha = if (backgroundVisible) 0.5f else 0f), + targetValue = if (backgroundVisible) color else color.copy(alpha = 0f), animationSpec = tween( easing = LinearEasing, durationMillis = if (backgroundVisible) {