Skip to content

Commit 23a20d9

Browse files
committed
Display glow effect only while tiles are downloaded
1 parent eeda372 commit 23a20d9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

openmapview/src/main/kotlin/de/afarber/openmapview/MapController.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,13 @@ class MapController(
826826
onTileLoadedCallback = callback
827827
}
828828

829+
/**
830+
* Returns whether tiles are currently being downloaded.
831+
*
832+
* @return true if any tiles are actively downloading, false otherwise
833+
*/
834+
fun isDownloadingTiles(): Boolean = downloadingTiles.isNotEmpty()
835+
829836
/**
830837
* Updates the temporary pan offset during a drag gesture.
831838
*

openmapview/src/main/kotlin/de/afarber/openmapview/OpenMapView.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ class OpenMapView
105105
controller.setOnTileLoadedCallback {
106106
invalidate()
107107
}
108-
attributionOverlay.isGlowEnabled = uiSettings.isAttributionGlowEnabled
109108
}
110109

111110
override fun dispatchDraw(canvas: Canvas) {
@@ -114,7 +113,7 @@ class OpenMapView
114113
if (uiSettings.isZoomControlsEnabled) {
115114
zoomControlsOverlay.draw(canvas, width, height)
116115
}
117-
attributionOverlay.isGlowEnabled = uiSettings.isAttributionGlowEnabled
116+
attributionOverlay.isGlowEnabled = uiSettings.isAttributionGlowEnabled && controller.isDownloadingTiles()
118117
attributionOverlay.draw(canvas, width, height)
119118
}
120119

0 commit comments

Comments
 (0)