mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-19 15:34:26 +01:00
Migrate to material compose alpha10
This commit is contained in:
@@ -32,9 +32,6 @@ fun StringListDialog(config: StringListDialogConfig) {
|
||||
fun StringListView(config: StringListDialogConfig) {
|
||||
Card(
|
||||
modifier = Modifier.height(300.dp),
|
||||
backgroundColor = MaterialTheme.colorScheme.surfaceVariant,
|
||||
shape = RoundedCornerShape(10.dp),
|
||||
elevation = 0.dp
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(16.dp),
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package no.nordicsemi.android.uart.view
|
||||
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.lazy.GridCells
|
||||
import androidx.compose.foundation.lazy.GridItemSpan
|
||||
import androidx.compose.foundation.lazy.LazyVerticalGrid
|
||||
import androidx.compose.foundation.lazy.grid.GridCells
|
||||
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
@@ -38,7 +37,6 @@ import no.nordicsemi.android.utils.EMPTY
|
||||
|
||||
private const val GRID_SIZE = 5
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
internal fun UARTAddMacroDialog(macro: UARTMacro?, onEvent: (UARTViewEvent) -> Unit) {
|
||||
val newLineChar = rememberSaveable { mutableStateOf(macro?.newLineChar ?: MacroEol.LF) }
|
||||
@@ -62,7 +60,7 @@ internal fun UARTAddMacroDialog(macro: UARTMacro?, onEvent: (UARTViewEvent) -> U
|
||||
)
|
||||
|
||||
LazyVerticalGrid(
|
||||
cells = GridCells.Fixed(GRID_SIZE),
|
||||
columns = GridCells.Fixed(GRID_SIZE),
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp)
|
||||
.wrapContentHeight()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package no.nordicsemi.android.uart.view
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.layout.RowScopeInstance.weight
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
@@ -36,10 +35,12 @@ internal fun UARTContentView(
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.padding(16.dp)
|
||||
modifier = Modifier.padding(16.dp).fillMaxSize()
|
||||
) {
|
||||
|
||||
ScreenSection(modifier = Modifier.fillMaxSize()) {
|
||||
OutputSection(state.displayMessages, onEvent)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.size(16.dp))
|
||||
|
||||
@@ -207,7 +208,6 @@ private fun DeleteConfigurationDialog(onEvent: (UARTViewEvent) -> Unit, onDismis
|
||||
|
||||
@Composable
|
||||
private fun OutputSection(records: List<UARTRecord>, onEvent: (UARTViewEvent) -> Unit) {
|
||||
ScreenSection(modifier = Modifier.weight(1f)) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
@@ -244,7 +244,6 @@ private fun OutputSection(records: List<UARTRecord>, onEvent: (UARTViewEvent) ->
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -21,7 +21,7 @@ dependencyResolutionManagement {
|
||||
library('nordic-theme', 'no.nordicsemi.android.common', 'theme').versionRef('commonlibraries')
|
||||
|
||||
library('localbroadcastmanager', 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0')
|
||||
library('material', 'com.google.android.material:material:1.6.0-alpha02')
|
||||
library('material', 'com.google.android.material:material:1.6.0-rc01')
|
||||
|
||||
version('lifecycle', '2.4.1')
|
||||
library('lifecycle-activity', 'androidx.lifecycle', 'lifecycle-runtime-ktx').versionRef('lifecycle')
|
||||
@@ -39,7 +39,7 @@ dependencyResolutionManagement {
|
||||
|
||||
version('compose', '1.1.0')
|
||||
library('compose-ui', 'androidx.compose.ui', 'ui').versionRef('compose')
|
||||
library('compose-material', 'androidx.compose.material3:material3:1.0.0-alpha05')
|
||||
library('compose-material', 'androidx.compose.material3:material3:1.0.0-alpha10')
|
||||
library('compose-tooling-preview', 'androidx.compose.ui', 'ui-tooling-preview').versionRef('compose')
|
||||
library('compose-navigation', 'androidx.navigation:navigation-compose:2.4.1')
|
||||
bundle('compose', ['compose-ui', 'compose-material', 'compose-tooling-preview', 'compose-navigation'])
|
||||
|
||||
Reference in New Issue
Block a user