From ff63ad5755e39fce6374036203d85c294e97bf55 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 20 Nov 2026 21:39:50 -0800 Subject: [PATCH 1/2] Say the map is drawing when nothing new is being added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit onAddStart now comes with total 0 for a filter that only hides cells and while the camera moves to undrawn tiles; show "Drawing the map…" then instead of "Adding to the map… 0 / 0". --- .../mapconductor/example/pages/circle/AntennaHorizonsPage.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt b/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt index e3e28851..01adf666 100644 --- a/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt +++ b/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt @@ -221,7 +221,8 @@ fun AntennaHorizonsPage( error ?: if (rows.isEmpty()) "Loading OpenCellID data…" else "${states.size} / ${rows.size} circles", ) - adding?.let { (added, total) -> Text("Adding to the map… $added / $total") } + // total is 0 when nothing new is added: a filter that only hides cells, or the camera moving. + adding?.let { (added, total) -> Text(if (total == 0) "Drawing the map…" else "Adding to the map… $added / $total") } TextButton(onClick = { alaska = !alaska }) { Text(if (alaska) "US overview" else "Alaska") } Row(Modifier.padding(vertical = 8.dp), horizontalArrangement = Arrangement.spacedBy(6.dp)) { carrierNames.forEachIndexed { index, name -> From 39a51974a0dd55b4fa815214bdc3695f96bf58ea Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Fri, 20 Nov 2026 22:07:57 -0800 Subject: [PATCH 2/2] Show the antenna sample's progress over the map Between onAddStart and onAddEnd the sample only changed a line in the card under the map. It now also shows a spinner with that line over the map, after 150 ms as the web sample's overlay does, without taking touches so the map can still be moved while it draws. --- .../pages/circle/AntennaHorizonsPage.kt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt b/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt index 01adf666..cff1e49d 100644 --- a/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt +++ b/example-app/src/main/java/com/mapconductor/example/pages/circle/AntennaHorizonsPage.kt @@ -1,5 +1,8 @@ package com.mapconductor.example.pages.circle +import kotlinx.coroutines.delay +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.foundation.background import androidx.annotation.DrawableRes import androidx.compose.foundation.Image import androidx.compose.foundation.border @@ -213,6 +216,12 @@ fun AntennaHorizonsPage( } } } + adding?.let { (added, total) -> + DrawingOverlay( + if (total == 0) "Drawing the map…" else "Adding to the map… $added / $total", + Modifier.padding(top = padding.calculateTopPadding()), + ) + } } Card(Modifier.fillMaxWidth().padding(12.dp)) { Column(Modifier.padding(12.dp)) { @@ -305,3 +314,34 @@ private fun CarrierToggle( Text(name, style = MaterialTheme.typography.labelSmall, textAlign = TextAlign.Center) } } + +/** + * Over the map while circles are added or their tiles drawn (between onAddStart + * and onAddEnd). Shown after 150 ms, as the web sample's overlay is, so that a + * short redraw does not flash; it does not take touches, so the map can still + * be moved while it draws. + */ +@Composable +private fun DrawingOverlay( + text: String, + modifier: Modifier = Modifier, +) { + var visible by remember { mutableStateOf(false) } + LaunchedEffect(Unit) { + delay(150) + visible = true + } + if (!visible) return + Box(modifier.fillMaxSize().background(Color(0x330F172A)), contentAlignment = Alignment.Center) { + Card { + Column( + Modifier.padding(horizontal = 20.dp, vertical = 16.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.spacedBy(10.dp), + ) { + CircularProgressIndicator(modifier = Modifier.size(28.dp), strokeWidth = 3.dp) + Text(text, style = MaterialTheme.typography.bodyMedium) + } + } + } +}