Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ spotless = "8.10.4"
versions = "0.66.0"

# Android
accompanistPermissions = "0.37.3"
activitycompose = "1.13.0"
androidx-core = "1.19.1"
androidx-startup = "1.2.0"
compose-bom = "2026.09.00"
constraintlayout = "2.2.2"
desugarJdkLibs = "2.1.5"
lifecycleRuntimeKtx = "2.11.0"

# Material
material = "1.14.0"
Expand All @@ -31,6 +34,9 @@ materialIconsExtendedAndroid = "1.7.8"
# Google Maps Platform
mapsecrets = "2.0.1"
mapsutils = "6.0.0"
navigation = "8.0.0"
places = "6.0.2"
playServicesLocation = "21.4.0"

# Testing
androidCore = "1.7.0"
Expand All @@ -48,21 +54,29 @@ truth = "1.4.5"
[libraries]
# Base
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }
desugar-jdk-libs = { module = "com.android.tools:desugar_jdk_libs_nio", version.ref = "desugarJdkLibs" }
dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
gradle-maven-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradleMavenPublishPlugin" }
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinxCoroutines" }
kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinxCoroutines" }

# Android
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanistPermissions" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activitycompose" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
androidx-compose-ui-preview-tooling = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycleRuntimeKtx" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleRuntimeKtx" }
androidx-startup-runtime = { module = "androidx.startup:startup-runtime", version.ref = "androidx-startup" }

# Material
Expand All @@ -75,6 +89,9 @@ material = { group = "com.google.android.material", name = "material", version.r
maps-utils-core = { module = "com.google.maps.android:android-maps-utils-core", version.ref = "mapsutils" }
maps-utils = { module = "com.google.maps.android:android-maps-utils", version.ref = "mapsutils" }
maps-secrets-plugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "mapsecrets" }
navigation = { module = "com.google.android.libraries.navigation:navigation", version.ref = "navigation" }
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
play-services-location = { module = "com.google.android.gms:play-services-location", version.ref = "playServicesLocation" }

# Testing
androidx-test-compose-ui = { module = "androidx.compose.ui:ui-test-junit4" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import android.view.ViewGroup
import android.widget.ImageView
import androidx.compose.runtime.Composable
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.MapView
import com.google.android.gms.maps.model.Marker

/**
Expand All @@ -34,11 +33,11 @@ import com.google.android.gms.maps.model.Marker
*
* [ComposeView][androidx.compose.ui.platform.ComposeView] content is therefore
* rendered into a plain [android.graphics.Bitmap] up front (while briefly attached
* to [mapView] to drive composition), and that bitmap is wrapped in a fresh,
* to [mapViewDelegate] to drive composition), and that bitmap is wrapped in a fresh,
* parent-less [ImageView] for the Maps SDK to use.
*/
internal class ComposeInfoWindowAdapter(
private val mapView: MapView,
private val mapViewDelegate: AbstractMapViewDelegate<*>,
private val markerNodeFinder: (Marker) -> MarkerNode?,
) : GoogleMap.InfoWindowAdapter {

Expand All @@ -55,9 +54,10 @@ internal class ComposeInfoWindowAdapter(
}

private fun renderToImageView(markerNode: MarkerNode, content: @Composable () -> Unit): View? {
val bitmap = mapView.renderComposableToBitmap(markerNode.compositionContext, content)
?: return null
return ImageView(mapView.context).apply {
val bitmap =
mapViewDelegate.renderComposableToBitmap(markerNode.compositionContext, content)
?: return null
return ImageView(mapViewDelegate.mapView.context).apply {
layoutParams = ViewGroup.LayoutParams(bitmap.width, bitmap.height)
scaleType = ImageView.ScaleType.FIT_XY
setImageBitmap(bitmap)
Expand Down
Loading
Loading