begin adding map view

This commit is contained in:
geeksville
2020-03-11 14:45:49 -07:00
parent fb2304ba82
commit 9be189f89c
10 changed files with 64 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import com.geeksville.android.GeeksvilleApplication
import com.geeksville.android.Logging
import com.geeksville.util.Exceptions
import com.google.firebase.crashlytics.FirebaseCrashlytics
import com.mapbox.mapboxsdk.Mapbox
class MeshUtilApplication : GeeksvilleApplication(null, "58e72ccc361883ea502510baa46580e3") {
@@ -26,5 +27,8 @@ class MeshUtilApplication : GeeksvilleApplication(null, "58e72ccc361883ea502510b
crashlytics.recordException(exception)
}
}
// Mapbox Access token
Mapbox.getInstance(this, getString(R.string.mapbox_access_token))
}
}

View File

@@ -47,6 +47,7 @@ fun AppDrawer(
ScreenButton(Screen.messages)
ScreenButton(Screen.users)
ScreenButton(Screen.map)
ScreenButton(Screen.channel)
ScreenButton(Screen.settings)
}

View File

@@ -0,0 +1,33 @@
package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.ui.core.ContextAmbient
import androidx.ui.layout.Column
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.LayoutSize
import androidx.ui.material.MaterialTheme
import androidx.ui.tooling.preview.Preview
import androidx.ui.unit.dp
@Composable
fun MapContent() {
analyticsScreen(name = "channel")
val typography = MaterialTheme.typography()
val context = ContextAmbient.current
Column(modifier = LayoutSize.Fill + LayoutPadding(16.dp)) {
}
}
@Preview
@Composable
fun previewMap() {
// another bug? It seems modaldrawerlayout not yet supported in preview
MaterialTheme(colors = palette) {
MapContent()
}
}

View File

@@ -146,6 +146,7 @@ private fun AppContent(openDrawer: () -> Unit) {
Screen.settings -> SettingsContent()
Screen.users -> HomeContent()
Screen.channel -> ChannelContent()
Screen.map -> MapContent()
else -> TODO()
}
}

View File

@@ -12,6 +12,7 @@ object Screen {
val channel = ScreenInfo(R.drawable.ic_twotone_contactless_24, "Channel")
val users = ScreenInfo(R.drawable.ic_twotone_people_24, "Users")
val messages = ScreenInfo(R.drawable.ic_twotone_message_24, "Messages")
val map = ScreenInfo(R.drawable.ic_twotone_map_24, "Map")
}