do most of the steps to upgrade to compose dev08

pull/12/head
geeksville 2020-04-05 22:17:40 -07:00
rodzic f0492d3ee4
commit d11cf34b3f
13 zmienionych plików z 27 dodań i 31 usunięć

Wyświetl plik

@ -45,7 +45,7 @@ android {
composeOptions {
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
kotlinCompilerExtensionVersion "0.1.0-dev07"
kotlinCompilerExtensionVersion "$compose_version"
}
}

Wyświetl plik

@ -3,7 +3,7 @@ package com.geeksville.mesh.ui
import androidx.annotation.DrawableRes
import androidx.compose.Composable
import androidx.ui.core.Modifier
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.foundation.shape.corner.RoundedCornerShape
import androidx.ui.graphics.Color
import androidx.ui.layout.*
@ -26,7 +26,7 @@ fun AppDrawer(
Row(modifier = LayoutPadding(16.dp)) {
VectorImage(
id = R.drawable.ic_launcher_new_foreground,
tint = (MaterialTheme.colors()).primary
tint = MaterialTheme.colors.primary
)
Spacer(LayoutWidth(8.dp))
// VectorImage(id = R.drawable.ic_launcher_new_foreground)
@ -61,7 +61,7 @@ private fun DrawerButton(
isSelected: Boolean,
action: () -> Unit
) {
val colors = MaterialTheme.colors()
val colors = MaterialTheme.colors
val textIconColor = if (isSelected) {
colors.primary
} else {
@ -93,7 +93,7 @@ private fun DrawerButton(
Spacer(LayoutWidth(16.dp))
Text(
text = label,
style = (MaterialTheme.typography()).body2.copy(
style = (MaterialTheme.typography).body2.copy(
color = textIconColor
),
modifier = LayoutWidth.Fill

Wyświetl plik

@ -13,7 +13,7 @@ import androidx.compose.Model
import androidx.compose.frames.modelMapOf
import androidx.compose.onCommit
import androidx.ui.core.ContextAmbient
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.layout.Column
import androidx.ui.layout.LayoutGravity
import androidx.ui.material.CircularProgressIndicator
@ -179,7 +179,7 @@ fun BTScanScreen() {
Column {
ScanUIState.devices.values.forEach {
// disabled pending https://issuetracker.google.com/issues/149528535
ProvideEmphasis(emphasis = if (it.bonded) MaterialTheme.emphasisLevels().high else MaterialTheme.emphasisLevels().disabled) {
ProvideEmphasis(emphasis = if (it.bonded) MaterialTheme.emphasisLevels.high else MaterialTheme.emphasisLevels.disabled) {
RadioGroupTextItem(
selected = (it.isSelected),
onSelect = {

Wyświetl plik

@ -3,7 +3,7 @@ package com.geeksville.mesh.ui
import android.content.Intent
import androidx.compose.Composable
import androidx.ui.core.ContextAmbient
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.input.ImeAction
import androidx.ui.layout.*
import androidx.ui.material.MaterialTheme
@ -25,7 +25,7 @@ object ChannelLog : Logging
fun ChannelContent(channel: Channel?) {
analyticsScreen(name = "channel")
val typography = MaterialTheme.typography()
val typography = MaterialTheme.typography
val context = ContextAmbient.current
Column(modifier = LayoutSize.Fill + LayoutPadding(16.dp)) {

Wyświetl plik

@ -77,7 +77,6 @@ private val mapLifecycleCallbacks = object : Application.ActivityLifecycleCallba
fun MapContent() {
analyticsScreen(name = "map")
val typography = MaterialTheme.typography()
val context = ContextAmbient.current
onCommit(AppStatus.currentScreen) {
@ -161,7 +160,7 @@ fun MapContent() {
bounds.includes(nodesWithPosition.map { it.position!! }
.map { LatLng(it.latitude, it.longitude) })
CameraUpdateFactory.newLatLngBounds(bounds.build(), 100)
CameraUpdateFactory.newLatLngBounds(bounds.build(), 150)
} else {
// Only one node, just zoom in on it
val it = nodesWithPosition[0].position!!

Wyświetl plik

@ -2,12 +2,9 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.compose.state
import androidx.ui.core.Text
import androidx.ui.layout.Container
import androidx.ui.layout.LayoutSize
import androidx.ui.foundation.Text
import androidx.ui.material.*
import androidx.ui.tooling.preview.Preview
import androidx.ui.unit.dp
import com.geeksville.android.Logging
import com.geeksville.mesh.R
import com.geeksville.mesh.model.UIState
@ -57,11 +54,11 @@ private fun AppContent(openDrawer: () -> Unit) {
TopAppBar(
title = { Text(text = "Meshtastic") },
navigationIcon = {
Container(LayoutSize(40.dp, 40.dp)) {
VectorImageButton(R.drawable.ic_launcher_new_foreground) {
openDrawer()
}
//Container(LayoutSize(40.dp, 40.dp)) {
VectorImageButton(R.drawable.ic_launcher_new_foreground) {
openDrawer()
}
//}
}
)
}) {

Wyświetl plik

@ -3,7 +3,7 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.compose.state
import androidx.ui.core.Modifier
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.foundation.VerticalScroller
import androidx.ui.graphics.Color
import androidx.ui.input.ImeAction
@ -52,7 +52,7 @@ fun MessageCard(msg: TextMessage, modifier: Modifier = Modifier.None) {
Text(
text = dateFormat.format(msg.date),
modifier = LayoutPadding(start = 8.dp),
style = MaterialTheme.typography().caption
style = MaterialTheme.typography.caption
)
}
}

Wyświetl plik

@ -1,7 +1,7 @@
package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.layout.*
import androidx.ui.material.MaterialTheme
import androidx.ui.material.ProvideEmphasis
@ -46,10 +46,10 @@ fun CompassHeading(modifier: Modifier1 = Modifier1.None, node: NodeInfo) {
@Composable
fun NodeHeading(node: NodeInfo) {
ProvideEmphasis(emphasis = MaterialTheme.emphasisLevels().high) {
ProvideEmphasis(emphasis = MaterialTheme.emphasisLevels.high) {
Text(
node.user?.longName ?: "unknown",
style = MaterialTheme.typography().subtitle1
style = MaterialTheme.typography.subtitle1
//modifier = LayoutWidth.Fill
)
}

Wyświetl plik

@ -3,7 +3,7 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.compose.state
import androidx.ui.core.ContextAmbient
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.input.ImeAction
import androidx.ui.layout.*
import androidx.ui.material.MaterialTheme
@ -52,7 +52,7 @@ fun SettingsContent() {
val bonded = RadioInterfaceService.getBondedDeviceAddress(context) != null
if (!bonded) {
val typography = MaterialTheme.typography()
val typography = MaterialTheme.typography
Text(
text =

Wyświetl plik

@ -3,7 +3,7 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.compose.state
import androidx.ui.core.Modifier
import androidx.ui.core.TextField
import androidx.ui.foundation.TextField
import androidx.ui.foundation.shape.corner.RoundedCornerShape
import androidx.ui.graphics.Color
import androidx.ui.input.ImeAction
@ -47,7 +47,7 @@ fun StyledTextField(
shape = RoundedCornerShape(4.dp)
) {
val showingHint = state { value.isEmpty() }
val level = if (showingHint.value) HintEmphasis else MaterialTheme.emphasisLevels().medium
val level = if (showingHint.value) HintEmphasis else MaterialTheme.emphasisLevels.medium
ProvideEmphasis(level) {
TextField(

Wyświetl plik

@ -2,7 +2,7 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.ui.core.Modifier
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.layout.Column
import androidx.ui.layout.LayoutGravity
import androidx.ui.layout.LayoutWidth

Wyświetl plik

@ -2,7 +2,7 @@ package com.geeksville.mesh.ui
import androidx.compose.Composable
import androidx.ui.core.ContextAmbient
import androidx.ui.core.Text
import androidx.ui.foundation.Text
import androidx.ui.layout.Column
import androidx.ui.layout.LayoutPadding
import androidx.ui.layout.Row

Wyświetl plik

@ -2,7 +2,7 @@
buildscript {
ext.kotlin_version = '1.3.61'
ext.compose_version = '0.1.0-dev07'
ext.compose_version = '0.1.0-dev08'
ext.coroutines_version = "1.3.5"
repositories {