Added "download button" with icon and updated onMapTouch

This commit is contained in:
Jackson Rosenthal
2022-02-17 17:12:17 -05:00
parent 1ee500b14d
commit 068f2ba8b2
3 changed files with 44 additions and 19 deletions

View File

@@ -200,7 +200,6 @@ class MapFragment : ScreenFragment("Map"), Logging {
var mapView: MapView? = null
private fun showDownloadedRegions() {
// Get a list of tile regions that are currently available.
tileStore.getAllTileRegions { expected ->
@@ -265,6 +264,9 @@ class MapFragment : ScreenFragment("Map"), Logging {
//TODO: Setup Style menu for satellite view, street view, & outdoor view
// downloadOfflineRegion()
}
binding.downloadRegion.setOnClickListener {
downloadOfflineRegion()
}
// We might not have a real mapview if running with analytics
if ((requireContext().applicationContext as GeeksvilleApplication).isAnalyticsAllowed) {
val vIn = viewIn.findViewById<MapView>(R.id.mapView)
@@ -478,10 +480,12 @@ class MapFragment : ScreenFragment("Map"), Logging {
}
private val click = OnMapClickListener {
if (binding.fabStyleToggle.isVisible) {
if (binding.fabStyleToggle.isVisible && binding.downloadRegion.isVisible) {
binding.fabStyleToggle.visibility = View.INVISIBLE
binding.downloadRegion.visibility = View.INVISIBLE
} else {
binding.fabStyleToggle.visibility = View.VISIBLE
binding.downloadRegion.visibility = View.VISIBLE
}
return@OnMapClickListener true
}