From ac03d57356f53490f4c82a0eb93e2ccf775742a2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:19:01 +0000 Subject: [PATCH 1/3] Initial plan From af25e9fd03f0dfd1223508e8e0093da3d4ab4e42 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:20:57 +0000 Subject: [PATCH 2/3] Fix: Ensure contentView is attached to hierarchy for Fabric measure/layout Agent-Logs-Url: https://github.com/dacoto/maps/sessions/bf453bb6-bc43-4f90-bd8f-49ade6ac8526 Co-authored-by: dacoto <16915053+dacoto@users.noreply.github.com> --- .../main/java/com/luggmaps/LuggMarkerView.kt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/android/src/main/java/com/luggmaps/LuggMarkerView.kt b/android/src/main/java/com/luggmaps/LuggMarkerView.kt index 2da19ca..2b23bfe 100644 --- a/android/src/main/java/com/luggmaps/LuggMarkerView.kt +++ b/android/src/main/java/com/luggmaps/LuggMarkerView.kt @@ -3,6 +3,7 @@ package com.luggmaps import android.content.Context import android.graphics.Canvas import android.view.View +import android.view.ViewGroup import androidx.core.graphics.createBitmap import androidx.core.view.isNotEmpty import com.facebook.react.views.view.ReactViewGroup @@ -23,6 +24,10 @@ interface LuggMarkerViewDelegate { class LuggMarkerView(context: Context) : ReactViewGroup(context) { private var scaleUpdateRunnable: Runnable? = null + companion object { + private const val OFFSCREEN_TRANSLATION_X = -10000f + } + var name: String? = null private set @@ -170,10 +175,28 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) { visibility = GONE } + private var contentViewAttached = false + + private fun ensureContentViewAttached() { + if (!contentViewAttached) { + contentViewAttached = true + // Add contentView to the hierarchy so Fabric triggers measure/layout, + // but push it offscreen so it is never visually rendered on the map. + // createContentBitmap() calls contentView.draw(canvas) which draws + // relative to the view's own coordinate space, unaffected by translation. + contentView.translationX = OFFSCREEN_TRANSLATION_X + super.addView(contentView, 0, ViewGroup.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT + )) + } + } + override fun addView(child: View, index: Int) { if (child is LuggCalloutView) { calloutView = child } else { + ensureContentViewAttached() contentView.addView(child, index) } didLayout = false From 761b72a320cbec1aff433e60314da435e549787a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Cort=C3=A9s?= <16915053+dacoto@users.noreply.github.com> Date: Sat, 28 Mar 2026 00:35:50 +0100 Subject: [PATCH 3/3] Update android/src/main/java/com/luggmaps/LuggMarkerView.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- android/src/main/java/com/luggmaps/LuggMarkerView.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/android/src/main/java/com/luggmaps/LuggMarkerView.kt b/android/src/main/java/com/luggmaps/LuggMarkerView.kt index 2b23bfe..dc08703 100644 --- a/android/src/main/java/com/luggmaps/LuggMarkerView.kt +++ b/android/src/main/java/com/luggmaps/LuggMarkerView.kt @@ -175,11 +175,8 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) { visibility = GONE } - private var contentViewAttached = false - private fun ensureContentViewAttached() { - if (!contentViewAttached) { - contentViewAttached = true + if (contentView.parent == null) { // Add contentView to the hierarchy so Fabric triggers measure/layout, // but push it offscreen so it is never visually rendered on the map. // createContentBitmap() calls contentView.draw(canvas) which draws