Skip to content
2 changes: 1 addition & 1 deletion firebase-ai/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.savedstate)
implementation(libs.kotlinx.serialization.json)

// Material
// Material for XML-based theme
implementation(libs.material)

// Firebase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,26 +310,6 @@ fun ChatBubbleItem(
}
}

// Use WebSettingsCompat to safely set the dark mode on API < 23.
// This is a no-op on API >= 23. On versions > 23, the WebView
// will correctly use the system theme.
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
if (isDarkTheme) {
WebSettingsCompat.setForceDark(
settings,
WebSettingsCompat.FORCE_DARK_ON
)
} else {
WebSettingsCompat.setForceDark(
settings,
WebSettingsCompat.FORCE_DARK_OFF
)
}
}

// The HTML content from the backend has its own styling.
// Set the WebView background to transparent to let the chat bubble's
// background show through.
setBackgroundColor(android.graphics.Color.TRANSPARENT)
loadDataWithBaseURL(
null,
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ activityCompose = "1.10.1"
composeBom = "2025.04.00"
googleServices = "4.4.2"
composeNavigation = "2.8.9"
material = "1.12.0"
webkit = "1.11.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -41,6 +43,8 @@ androidx-material3 = { group = "androidx.compose.material3", name = "material3"
compose-navigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "composeNavigation"}
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinxSerializationCore" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationCore" }
androidx-webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" }
material = { module = "com.google.android.material:material", version.ref = "material" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand Down
Loading