From a1eb644369249385de03e91cc9ba18dbe5bbedac Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Sun, 29 Mar 2026 17:51:39 +0530 Subject: [PATCH] feat: add RecyclerView dependency and improve content color handling in theme --- composeApp/build.gradle.kts | 1 + .../commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index b7fe7d8d7..654fe0bd0 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -53,6 +53,7 @@ kotlin { androidMain.dependencies { implementation(libs.compose.uiToolingPreview) implementation(libs.androidx.activity.compose) + implementation("androidx.recyclerview:recyclerview:1.4.0") implementation(libs.ktor.client.android) implementation(libs.androidx.media3.exoplayer.hls) implementation(libs.androidx.media3.exoplayer.dash) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt index 7ac076ffe..b7cda5580 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioTheme.kt @@ -12,6 +12,7 @@ import androidx.compose.material3.darkColorScheme import androidx.compose.runtime.Composable import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.luminance import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Density @@ -24,11 +25,14 @@ val MaterialTheme.appTheme: AppTheme @ReadOnlyComposable get() = LocalAppTheme.current +private fun contentColorFor(background: Color): Color = + if (background.luminance() > 0.5f) Color(0xFF111111) else Color(0xFFF5F7F8) + private fun buildColorScheme(palette: ThemeColorPalette, amoled: Boolean = false) = darkColorScheme( primary = palette.secondary, onPrimary = palette.onSecondary, primaryContainer = palette.focusBackground, - onPrimaryContainer = palette.onSecondary, + onPrimaryContainer = contentColorFor(palette.focusBackground), secondary = palette.secondaryVariant, onSecondary = palette.onSecondaryVariant, background = if (amoled) Color.Black else palette.background,