mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-24 00:33:14 -04:00
back to making maps work?
This commit is contained in:
@@ -185,6 +185,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
||||
val prefs = UIState.getPreferences(this)
|
||||
UIState.ownerName = prefs.getString("owner", "")!!
|
||||
UIState.meshService = null
|
||||
UIState.savedInstanceState = savedInstanceState
|
||||
|
||||
// Ensures Bluetooth is available on the device and it is enabled. If not,
|
||||
// displays a dialog requesting user permission to enable Bluetooth.
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.geeksville.mesh.model
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.RemoteException
|
||||
import androidx.compose.mutableStateOf
|
||||
import androidx.core.content.edit
|
||||
@@ -34,6 +35,8 @@ object UIState : Logging {
|
||||
/// If the app was launched because we received a new channel intent, the Url will be here
|
||||
var requestedChannelUrl: Uri? = null
|
||||
|
||||
var savedInstanceState: Bundle? = null
|
||||
|
||||
/**
|
||||
* Return the current channel info
|
||||
* FIXME, we should sim channels at the MeshService level if we are running on an emulator,
|
||||
|
||||
@@ -47,7 +47,7 @@ fun AppDrawer(
|
||||
|
||||
ScreenButton(Screen.messages)
|
||||
ScreenButton(Screen.users)
|
||||
// ScreenButton(Screen.map) // turn off for now
|
||||
ScreenButton(Screen.map) // turn off for now
|
||||
ScreenButton(Screen.channel)
|
||||
ScreenButton(Screen.settings)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
package com.geeksville.mesh.ui
|
||||
|
||||
import androidx.compose.Composable
|
||||
import androidx.ui.androidview.AndroidView
|
||||
import androidx.ui.core.ContextAmbient
|
||||
import androidx.ui.core.Text
|
||||
import androidx.ui.fakeandroidview.AndroidView
|
||||
import androidx.ui.layout.Column
|
||||
import androidx.ui.material.MaterialTheme
|
||||
import androidx.ui.tooling.preview.Preview
|
||||
import com.geeksville.android.Logging
|
||||
import com.geeksville.mesh.R
|
||||
import com.geeksville.mesh.model.UIState
|
||||
import com.mapbox.mapboxsdk.maps.MapView
|
||||
|
||||
object mapLog : Logging
|
||||
|
||||
@Composable
|
||||
fun MapContent() {
|
||||
@@ -15,7 +21,15 @@ fun MapContent() {
|
||||
val typography = MaterialTheme.typography()
|
||||
val context = ContextAmbient.current
|
||||
|
||||
AndroidView(R.layout.map_view) {
|
||||
Column {
|
||||
Text("hi")
|
||||
AndroidView(R.layout.map_view) { view ->
|
||||
view as MapView
|
||||
view.onCreate(UIState.savedInstanceState)
|
||||
view.getMapAsync {
|
||||
mapLog.info("In getmap")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user