mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Merge branch 'meshtastic:master' into osmdroid-phase3
This commit is contained in:
commit
cc1814b499
10 changed files with 49 additions and 65 deletions
|
|
@ -26,7 +26,6 @@ import com.geeksville.mesh.model.map.CustomTileSource
|
|||
import com.geeksville.mesh.model.map.NOAAWmsTileSource
|
||||
import com.geeksville.mesh.util.formatAgo
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.osmdroid.api.IMapController
|
||||
import org.osmdroid.config.Configuration
|
||||
|
|
@ -58,7 +57,6 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
|
|||
// UI Elements
|
||||
private lateinit var binding: MapViewBinding
|
||||
private lateinit var map: MapView
|
||||
private lateinit var downloadBtn: FloatingActionButton
|
||||
private lateinit var cacheEstimate: TextView
|
||||
private lateinit var executeJob: Button
|
||||
private var downloadPrompt: AlertDialog? = null
|
||||
|
|
@ -96,8 +94,6 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
|
|||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = MapViewBinding.inflate(inflater)
|
||||
downloadBtn = binding.root.findViewById(R.id.downloadButton)
|
||||
binding.cacheLayout.visibility = View.GONE
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
|
@ -138,7 +134,7 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
|
|||
}
|
||||
zoomToNodes(mapController)
|
||||
}
|
||||
downloadBtn.setOnClickListener(this)
|
||||
binding.downloadButton.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
|
|
@ -389,9 +385,9 @@ class MapFragment : ScreenFragment("Map"), Logging, View.OnClickListener {
|
|||
|
||||
private fun renderDownloadButton() {
|
||||
if (!(map.tileProvider.tileSource as OnlineTileSourceBase).tileSourcePolicy.acceptsBulkDownload()) {
|
||||
downloadBtn.hide()
|
||||
binding.downloadButton.hide()
|
||||
} else {
|
||||
downloadBtn.show()
|
||||
binding.downloadButton.show()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -299,14 +299,15 @@ class SettingsFragment : ScreenFragment("Settings"), Logging {
|
|||
model.localConfig.asLiveData().observe(viewLifecycleOwner) {
|
||||
if (!model.isConnected()) {
|
||||
val configCount = it.allFields.size
|
||||
binding.scanStatusText.text = "Device config ($configCount / 7)"
|
||||
if (configCount > 0)
|
||||
binding.scanStatusText.text = "Device config ($configCount / 7)"
|
||||
} else updateNodeInfo()
|
||||
}
|
||||
|
||||
model.channels.asLiveData().observe(viewLifecycleOwner) {
|
||||
if (!model.isConnected()) {
|
||||
val channelCount = it.protobuf.settingsCount
|
||||
if (channelCount > 0) binding.scanStatusText.text = "Channels ($channelCount / 8)"
|
||||
if (!model.isConnected()) it.protobuf.let { ch ->
|
||||
if (!ch.hasLoraConfig() && ch.settingsCount > 0)
|
||||
binding.scanStatusText.text = "Channels (${ch.settingsCount} / 8)"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue