feat: Navigation observer
This commit is contained in:
parent
9db0e3611c
commit
0a1c908a9d
4 changed files with 90 additions and 8 deletions
|
@ -32,7 +32,8 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private lateinit var mapControl: MapControl
|
||||
private val navigationObserver = NavigationObserver()
|
||||
private lateinit var navigationObserver: NavigationObserver
|
||||
private lateinit var initThread: Thread
|
||||
val permissionsHelper = PermissionsHelper(WeakReference(this))
|
||||
|
||||
init {
|
||||
|
@ -62,13 +63,27 @@ class MainActivity : AppCompatActivity() {
|
|||
.build()
|
||||
}
|
||||
}
|
||||
MapboxNavigationApp.current()?.startTripSession()
|
||||
mapControl = MapControl(this, binding.mapView, resources)
|
||||
mapControl = MapControl(binding.mapView, resources)
|
||||
mapControl.init()
|
||||
navigationObserver = NavigationObserver(mapControl)
|
||||
}
|
||||
initThread = Thread {
|
||||
while (true) {
|
||||
if (MapboxNavigationApp.current() != null) {
|
||||
MapboxNavigationApp.current()!!.startTripSession()
|
||||
threadCallback()
|
||||
}
|
||||
Thread.sleep(100)
|
||||
}
|
||||
}
|
||||
initThread.start()
|
||||
bluetoothInit()
|
||||
}
|
||||
|
||||
private fun threadCallback() {
|
||||
initThread.join()
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
// MapboxNavigationApp.current()?.registerRouteProgressObserver(routeProgressObserver)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue