mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
placeholder channel screen
This commit is contained in:
parent
bdd6e5de6c
commit
bb2b11264d
4 changed files with 68 additions and 37 deletions
53
app/src/main/java/com/geeksville/mesh/ui/Channel.kt
Normal file
53
app/src/main/java/com/geeksville/mesh/ui/Channel.kt
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package com.geeksville.mesh.ui
|
||||
|
||||
import androidx.compose.Composable
|
||||
import androidx.ui.core.Text
|
||||
import androidx.ui.foundation.DrawImage
|
||||
import androidx.ui.layout.*
|
||||
import androidx.ui.material.MaterialTheme
|
||||
import androidx.ui.res.imageResource
|
||||
import androidx.ui.tooling.preview.Preview
|
||||
import androidx.ui.unit.dp
|
||||
import com.geeksville.mesh.R
|
||||
|
||||
/// The Compose IDE preview doesn't like the protobufs
|
||||
data class Channel(val name: String, val num: Int)
|
||||
|
||||
@Composable
|
||||
fun ChannelContent(channel: Channel = Channel("Default", 7)) {
|
||||
val typography = MaterialTheme.typography()
|
||||
|
||||
Column(modifier = LayoutSize.Fill + LayoutPadding(16.dp)) {
|
||||
Text(
|
||||
text = "Channel: ${channel.name}",
|
||||
modifier = LayoutGravity.Center,
|
||||
style = typography.h4
|
||||
)
|
||||
|
||||
Row {
|
||||
val image = imageResource(id = R.drawable.qrcode)
|
||||
Container(modifier = LayoutGravity.Center + LayoutSize.Min(320.dp, 320.dp)) {
|
||||
DrawImage(image = image)
|
||||
}
|
||||
}
|
||||
|
||||
Text(
|
||||
text = "Number: ${channel.num}",
|
||||
modifier = LayoutGravity.Center
|
||||
)
|
||||
Text(
|
||||
text = "Mode: Long range (but slow)",
|
||||
modifier = LayoutGravity.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun previewChannel() {
|
||||
// another bug? It seems modaldrawerlayout not yet supported in preview
|
||||
MaterialTheme(colors = palette) {
|
||||
ChannelContent()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue