mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-23 01:14:26 +01:00
Migration to Material You
This commit is contained in:
@@ -48,6 +48,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation libs.nordic.theme
|
||||||
|
|
||||||
//Hilt requires to implement every module in the main app module
|
//Hilt requires to implement every module in the main app module
|
||||||
//https://github.com/google/dagger/issues/2123
|
//https://github.com/google/dagger/issues/2123
|
||||||
implementation project(':profile_bps')
|
implementation project(':profile_bps')
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -21,7 +22,6 @@ import androidx.compose.ui.layout.ContentScale
|
|||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import no.nordicsemi.android.theme.NordicColors
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun FeatureButton(@DrawableRes iconId: Int, @StringRes nameId: Int, onClick: () -> Unit) {
|
fun FeatureButton(@DrawableRes iconId: Int, @StringRes nameId: Int, onClick: () -> Unit) {
|
||||||
@@ -29,7 +29,7 @@ fun FeatureButton(@DrawableRes iconId: Int, @StringRes nameId: Int, onClick: ()
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable { onClick() }
|
.clickable { onClick() }
|
||||||
.background(NordicColors.ItemHighlight.value())
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -2,21 +2,21 @@ package no.nordicsemi.android.nrftoolbox
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material.Surface
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import no.nordicsemi.android.theme.TestTheme
|
import no.nordicsemi.android.material.you.NordicActivity
|
||||||
|
import no.nordicsemi.android.material.you.NordicTheme
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : NordicActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
TestTheme {
|
NordicTheme {
|
||||||
Surface(color = MaterialTheme.colors.background) {
|
Surface(color = MaterialTheme.colorScheme.background) {
|
||||||
HomeScreen()
|
HomeScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package no.nordicsemi.android.permission.bonding.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package no.nordicsemi.android.permission.bonding.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package no.nordicsemi.android.permission.bonding
|
package no.nordicsemi.android.permission.bonding.view
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
|||||||
@@ -11,10 +11,8 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -73,7 +71,6 @@ fun BluetoothNotEnabledScreen(finish: () -> Unit) {
|
|||||||
)
|
)
|
||||||
Spacer(Modifier.height(32.dp))
|
Spacer(Modifier.height(32.dp))
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { launcher.launch(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)) }
|
onClick = { launcher.launch(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.scanner__bluetooth_open_settings))
|
Text(text = stringResource(id = R.string.scanner__bluetooth_open_settings))
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.fillMaxHeight
|
import androidx.compose.foundation.layout.fillMaxHeight
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -39,7 +37,6 @@ private fun NotConnectedView(
|
|||||||
Text(text = stringResource(id = R.string.csc_no_connection))
|
Text(text = stringResource(id = R.string.csc_no_connection))
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { connect() }
|
onClick = { connect() }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.csc_connect))
|
Text(text = stringResource(id = R.string.csc_connect))
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ apply from: rootProject.file("library.gradle")
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation libs.material
|
implementation libs.material
|
||||||
|
|
||||||
|
implementation libs.nordic.theme
|
||||||
|
|
||||||
implementation libs.bundles.compose
|
implementation libs.bundles.compose
|
||||||
implementation libs.compose.lifecycle
|
implementation libs.compose.lifecycle
|
||||||
implementation libs.compose.activity
|
implementation libs.compose.activity
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
package no.nordicsemi.android.theme
|
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
|
|
||||||
object NordicColors {
|
|
||||||
val AlmostWhite = Color(0xFFDADADA)
|
|
||||||
val NordicBlue = Color(0xFF00A9CE)
|
|
||||||
val NordicLake = Color(0xFF008CD2)
|
|
||||||
|
|
||||||
val NordicDarkGray = ThemedColor(Color(0xFF333F48), Color(0xFFCCCBC8))
|
|
||||||
|
|
||||||
// val NordicGray4 = ThemedColor(Color(0xFFD1D1D6), Color(0xFF3A3A3C))
|
|
||||||
val NordicGray4 = ThemedColor(Color.White, Color(0xFF3A3A3C))
|
|
||||||
|
|
||||||
val NordicGray5 = ThemedColor(Color(0xFFE5E5EA), Color(0xFF2C2C2E))
|
|
||||||
val NordicLightGray = NeutralColor(Color(0xFF929CA2))
|
|
||||||
val NordicMediumGray = NeutralColor(Color(0xFF929CA2))
|
|
||||||
|
|
||||||
val NordicFall = ThemedColor(Color(0xFFF99535), Color(0xFFFF9F0A))
|
|
||||||
val NordicGreen = ThemedColor(Color(0xFF3ED052), Color(0xFF32D74B))
|
|
||||||
|
|
||||||
val NordicOrange = ThemedColor(Color(0xFFDF9B16), Color(0xFFFF9F0A))
|
|
||||||
val NordicRed = ThemedColor(Color(0xFFD03E51), Color(0xFFFF453A))
|
|
||||||
val NordicSky = NeutralColor(Color(0xFF6AD1E3))
|
|
||||||
val NordicYellow = ThemedColor(Color(0xFFF9EE35), Color(0xFFFFD60A))
|
|
||||||
val TableViewBackground = NeutralColor(Color(0xFFF2F2F6))
|
|
||||||
val TableViewSeparator = NeutralColor(Color(0xFFD2D2D6))
|
|
||||||
|
|
||||||
val Primary = ThemedColor(Color(0xFF00A9CE), Color(0xFF00A9CE))
|
|
||||||
val PrimaryVariant = ThemedColor(Color(0xFF008CD2), Color(0xFF00A9CE))
|
|
||||||
val Secondary = ThemedColor(Color(0xFF00A9CE), Color(0xFF00A9CE))
|
|
||||||
val SecondaryVariant = ThemedColor(Color(0xFF008CD2), Color(0xFF00A9CE))
|
|
||||||
val OnPrimary = ThemedColor(Color.White, Color.White)
|
|
||||||
val OnSecondary = ThemedColor(Color.White, Color.White)
|
|
||||||
val OnBackground = ThemedColor(Color.Black, Color.White)
|
|
||||||
val OnSurface = ThemedColor(Color.Black, Color.White)
|
|
||||||
val ItemHighlight = ThemedColor(Color.White, Color(0xFF1E1E1E))
|
|
||||||
val Background = ThemedColor(Color(0xFFF5F5F5), Color(0xFF121212))
|
|
||||||
val Surface = ThemedColor(Color(0xFFF5F5F5), Color(0xFF121212))
|
|
||||||
}
|
|
||||||
|
|
||||||
sealed class NordicColor {
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
abstract fun value(): Color
|
|
||||||
}
|
|
||||||
|
|
||||||
data class ThemedColor(val light: Color, val dark: Color): NordicColor() {
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
override fun value(): Color {
|
|
||||||
return if (isSystemInDarkTheme()) {
|
|
||||||
dark
|
|
||||||
} else {
|
|
||||||
light
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data class NeutralColor(val color: Color): NordicColor() {
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
override fun value(): Color {
|
|
||||||
return color
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package no.nordicsemi.android.theme
|
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.material.Shapes
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
|
|
||||||
val Shapes = Shapes(
|
|
||||||
small = RoundedCornerShape(4.dp),
|
|
||||||
medium = RoundedCornerShape(4.dp),
|
|
||||||
large = RoundedCornerShape(0.dp)
|
|
||||||
)
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package no.nordicsemi.android.theme
|
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.darkColors
|
|
||||||
import androidx.compose.material.lightColors
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun TestTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
|
|
||||||
|
|
||||||
val darkColorPalette = darkColors(
|
|
||||||
primary = NordicColors.Primary.value(),
|
|
||||||
primaryVariant = NordicColors.PrimaryVariant.value(),
|
|
||||||
secondary = NordicColors.Secondary.value(),
|
|
||||||
secondaryVariant = NordicColors.SecondaryVariant.value(),
|
|
||||||
onSecondary = NordicColors.OnSecondary.value(),
|
|
||||||
onPrimary = NordicColors.OnPrimary.value(),
|
|
||||||
onBackground = NordicColors.OnBackground.value(),
|
|
||||||
onSurface = NordicColors.OnSurface.value(),
|
|
||||||
background = NordicColors.Background.value(),
|
|
||||||
surface = NordicColors.Surface.value(),
|
|
||||||
)
|
|
||||||
|
|
||||||
val lightColorPalette = lightColors(
|
|
||||||
primary = NordicColors.Primary.value(),
|
|
||||||
primaryVariant = NordicColors.PrimaryVariant.value(),
|
|
||||||
secondary = NordicColors.Secondary.value(),
|
|
||||||
secondaryVariant = NordicColors.SecondaryVariant.value(),
|
|
||||||
onSecondary = NordicColors.OnSecondary.value(),
|
|
||||||
onPrimary = NordicColors.OnPrimary.value(),
|
|
||||||
onBackground = NordicColors.OnBackground.value(),
|
|
||||||
onSurface = NordicColors.OnSurface.value(),
|
|
||||||
background = NordicColors.Background.value(),
|
|
||||||
surface = NordicColors.Surface.value(),
|
|
||||||
)
|
|
||||||
|
|
||||||
val colors = if (darkTheme) {
|
|
||||||
darkColorPalette
|
|
||||||
} else {
|
|
||||||
lightColorPalette
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialTheme(
|
|
||||||
colors = colors,
|
|
||||||
typography = Typography,
|
|
||||||
shapes = Shapes,
|
|
||||||
content = content
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
package no.nordicsemi.android.theme
|
|
||||||
|
|
||||||
import androidx.compose.material.Typography
|
|
||||||
import androidx.compose.ui.text.TextStyle
|
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
|
|
||||||
// Set of Material typography styles to start with
|
|
||||||
val Typography = Typography(
|
|
||||||
body1 = TextStyle(
|
|
||||||
fontFamily = FontFamily.Default,
|
|
||||||
fontWeight = FontWeight.Normal,
|
|
||||||
fontSize = 16.sp
|
|
||||||
)
|
|
||||||
/* Other default text styles to override
|
|
||||||
button = TextStyle(
|
|
||||||
fontFamily = FontFamily.Default,
|
|
||||||
fontWeight = FontWeight.W500,
|
|
||||||
fontSize = 14.sp
|
|
||||||
),
|
|
||||||
caption = TextStyle(
|
|
||||||
fontFamily = FontFamily.Default,
|
|
||||||
fontWeight = FontWeight.Normal,
|
|
||||||
fontSize = 12.sp
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
)
|
|
||||||
@@ -3,10 +3,10 @@ package no.nordicsemi.android.theme.view
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import no.nordicsemi.android.theme.NordicColors
|
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun KeyValueField(key: String, value: String) {
|
fun KeyValueField(key: String, value: String) {
|
||||||
@@ -16,7 +16,7 @@ fun KeyValueField(key: String, value: String) {
|
|||||||
) {
|
) {
|
||||||
Text(text = key)
|
Text(text = key)
|
||||||
Text(
|
Text(
|
||||||
color = NordicColors.NordicDarkGray.value(),
|
color = MaterialTheme.colorScheme.onBackground,
|
||||||
text = value
|
text = value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,11 @@ package no.nordicsemi.android.theme.view
|
|||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.width
|
|
||||||
import androidx.compose.material.RadioButton
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import no.nordicsemi.android.material.you.RadioButton
|
||||||
|
import no.nordicsemi.android.material.you.RadioButtonItem
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun <T> SelectItemRadioGroup(
|
fun <T> SelectItemRadioGroup(
|
||||||
@@ -35,11 +32,10 @@ internal fun <T> SelectItemRadioButton(
|
|||||||
) {
|
) {
|
||||||
Row {
|
Row {
|
||||||
RadioButton(
|
RadioButton(
|
||||||
selected = (selectedItem == displayedItem.unit),
|
RadioButtonItem(displayedItem.label, selectedItem == displayedItem.unit),
|
||||||
onClick = { onEvent(displayedItem) }
|
) {
|
||||||
)
|
onEvent(displayedItem)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
}
|
||||||
Text(text = displayedItem.label)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ package no.nordicsemi.android.theme.view
|
|||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.Card
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import no.nordicsemi.android.theme.NordicColors
|
import no.nordicsemi.android.material.you.Card
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ScreenSection(content: @Composable () -> Unit) {
|
fun ScreenSection(content: @Composable () -> Unit) {
|
||||||
Card(
|
Card(
|
||||||
backgroundColor = NordicColors.ItemHighlight.value(),
|
backgroundColor = MaterialTheme.colorScheme.background,
|
||||||
shape = RoundedCornerShape(4.dp),
|
shape = RoundedCornerShape(4.dp),
|
||||||
elevation = 0.dp
|
elevation = 0.dp
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -1,20 +1,30 @@
|
|||||||
package no.nordicsemi.android.theme.view
|
package no.nordicsemi.android.theme.view
|
||||||
|
|
||||||
import androidx.compose.material.Icon
|
|
||||||
import androidx.compose.material.IconButton
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.material.TopAppBar
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Close
|
import androidx.compose.material.icons.filled.Close
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.SmallTopAppBar
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TopAppBarDefaults
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.res.colorResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import no.nordicsemi.android.theme.R
|
import no.nordicsemi.android.theme.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CloseIconAppBar(text: String, onClick: () -> Unit) {
|
fun CloseIconAppBar(text: String, onClick: () -> Unit) {
|
||||||
TopAppBar(
|
SmallTopAppBar(
|
||||||
title = { Text(text) },
|
title = { Text(text) },
|
||||||
|
colors = TopAppBarDefaults.smallTopAppBarColors(
|
||||||
|
scrolledContainerColor = MaterialTheme.colorScheme.primary,
|
||||||
|
containerColor = colorResource(id = R.color.appBarColor),
|
||||||
|
titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
actionIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
navigationIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = { onClick() }) {
|
IconButton(onClick = { onClick() }) {
|
||||||
Icon(
|
Icon(
|
||||||
@@ -28,8 +38,15 @@ fun CloseIconAppBar(text: String, onClick: () -> Unit) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BackIconAppBar(text: String, onClick: () -> Unit) {
|
fun BackIconAppBar(text: String, onClick: () -> Unit) {
|
||||||
TopAppBar(
|
SmallTopAppBar(
|
||||||
title = { Text(text) },
|
title = { Text(text) },
|
||||||
|
colors = TopAppBarDefaults.smallTopAppBarColors(
|
||||||
|
scrolledContainerColor = MaterialTheme.colorScheme.primary,
|
||||||
|
containerColor = colorResource(id = R.color.appBarColor),
|
||||||
|
titleContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
actionIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
navigationIconContentColor = MaterialTheme.colorScheme.onPrimary,
|
||||||
|
),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = { onClick() }) {
|
IconButton(onClick = { onClick() }) {
|
||||||
Icon(
|
Icon(
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
import androidx.compose.material.Card
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.material.TextButton
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -25,7 +24,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.compose.ui.window.Dialog
|
import androidx.compose.ui.window.Dialog
|
||||||
import no.nordicsemi.android.theme.NordicColors
|
import no.nordicsemi.android.material.you.Card
|
||||||
import no.nordicsemi.android.theme.R
|
import no.nordicsemi.android.theme.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -39,7 +38,6 @@ fun StringListDialog(config: StringListDialogConfig) {
|
|||||||
fun StringListView(config: StringListDialogConfig) {
|
fun StringListView(config: StringListDialogConfig) {
|
||||||
Card(
|
Card(
|
||||||
modifier = Modifier.height(300.dp),
|
modifier = Modifier.height(300.dp),
|
||||||
backgroundColor = NordicColors.NordicGray4.value(),
|
|
||||||
shape = RoundedCornerShape(10.dp),
|
shape = RoundedCornerShape(10.dp),
|
||||||
elevation = 0.dp
|
elevation = 0.dp
|
||||||
) {
|
) {
|
||||||
@@ -72,9 +70,9 @@ fun StringListView(config: StringListDialogConfig) {
|
|||||||
modifier = Modifier.padding(horizontal = 4.dp),
|
modifier = Modifier.padding(horizontal = 4.dp),
|
||||||
painter = painterResource(it),
|
painter = painterResource(it),
|
||||||
contentDescription = "Content image",
|
contentDescription = "Content image",
|
||||||
colorFilter = ColorFilter.tint(
|
// colorFilter = ColorFilter.tint(
|
||||||
NordicColors.NordicDarkGray.value()
|
// NordicColors.NordicDarkGray.value()
|
||||||
)
|
// )
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package no.nordicsemi.android.bps.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -27,7 +25,6 @@ internal fun BPSContentView(state: BPSData, onEvent: (BPSScreenViewEvent) -> Uni
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ dependencies {
|
|||||||
implementation libs.nordic.ble.common
|
implementation libs.nordic.ble.common
|
||||||
|
|
||||||
implementation libs.nordic.log
|
implementation libs.nordic.log
|
||||||
|
implementation libs.nordic.theme
|
||||||
|
|
||||||
implementation libs.bundles.compose
|
implementation libs.bundles.compose
|
||||||
implementation libs.androidx.core
|
implementation libs.androidx.core
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package no.nordicsemi.android.csc.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.ButtonDefaults
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -38,7 +38,6 @@ internal fun CSCContentView(state: CSCData, onEvent: (CSCViewEvent) -> Unit) {
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(OnDisconnectButtonClick) }
|
onClick = { onEvent(OnDisconnectButtonClick) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import androidx.compose.ui.res.stringArrayResource
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import no.nordicsemi.android.csc.R
|
import no.nordicsemi.android.csc.R
|
||||||
import no.nordicsemi.android.theme.TestTheme
|
import no.nordicsemi.android.material.you.NordicTheme
|
||||||
import no.nordicsemi.android.theme.view.dialog.FlowCanceled
|
import no.nordicsemi.android.theme.view.dialog.FlowCanceled
|
||||||
import no.nordicsemi.android.theme.view.dialog.ItemSelectedResult
|
import no.nordicsemi.android.theme.view.dialog.ItemSelectedResult
|
||||||
import no.nordicsemi.android.theme.view.dialog.StringListDialog
|
import no.nordicsemi.android.theme.view.dialog.StringListDialog
|
||||||
@@ -40,7 +40,7 @@ private fun createConfig(entries: Array<String>, onResult: (StringListDialogResu
|
|||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
internal fun DefaultPreview() {
|
internal fun DefaultPreview() {
|
||||||
TestTheme {
|
NordicTheme {
|
||||||
val wheelEntries = stringArrayResource(R.array.wheel_entries)
|
val wheelEntries = stringArrayResource(R.array.wheel_entries)
|
||||||
StringListDialog(createConfig(wheelEntries) {})
|
StringListDialog(createConfig(wheelEntries) {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package no.nordicsemi.android.csc.view
|
package no.nordicsemi.android.csc.view
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.material.Icon
|
|
||||||
import androidx.compose.material.IconButton
|
|
||||||
import androidx.compose.material.OutlinedTextField
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Edit
|
import androidx.compose.material.icons.filled.Edit
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.IconButton
|
||||||
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@@ -16,14 +15,15 @@ import no.nordicsemi.android.csc.data.CSCData
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun WheelSizeView(state: CSCData, onEvent: (CSCViewEvent) -> Unit) {
|
internal fun WheelSizeView(state: CSCData, onEvent: (CSCViewEvent) -> Unit) {
|
||||||
OutlinedTextField(
|
//TODO
|
||||||
modifier = Modifier.fillMaxWidth(),
|
// OutlinedTextField(
|
||||||
value = state.wheelSizeDisplay,
|
// modifier = Modifier.fillMaxWidth(),
|
||||||
onValueChange = { },
|
// value = state.wheelSizeDisplay,
|
||||||
enabled = false,
|
// onValueChange = { },
|
||||||
label = { Text(text = stringResource(id = R.string.csc_field_wheel_size)) },
|
// enabled = false,
|
||||||
trailingIcon = { EditIcon(onEvent = onEvent) }
|
// label = { Text(text = stringResource(id = R.string.csc_field_wheel_size)) },
|
||||||
)
|
// trailingIcon = { EditIcon(onEvent = onEvent) }
|
||||||
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -45,7 +43,6 @@ internal fun GLSContentView(state: GLSData, onEvent: (GLSScreenViewEvent) -> Uni
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -5,10 +5,8 @@ import androidx.compose.foundation.layout.Column
|
|||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -40,7 +38,6 @@ internal fun HRSContentView(state: HRSData, onEvent: (HRSScreenViewEvent) -> Uni
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -6,10 +6,8 @@ import androidx.compose.foundation.layout.Spacer
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -55,7 +53,6 @@ internal fun HTSContentView(state: HTSData, onEvent: (HTSScreenViewEvent) -> Uni
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package no.nordicsemi.android.prx.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@@ -40,7 +38,6 @@ internal fun ContentView(state: PRXData, onEvent: (PRXScreenViewEvent) -> Unit)
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ package no.nordicsemi.android.rscs.view
|
|||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.material.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material.ButtonDefaults
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.material.MaterialTheme
|
|
||||||
import androidx.compose.material.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -28,7 +26,6 @@ internal fun RSCSContentView(state: RSCSData, onEvent: (RSCScreenViewEvent) -> U
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.secondary),
|
|
||||||
onClick = { onEvent(DisconnectEvent) }
|
onClick = { onEvent(DisconnectEvent) }
|
||||||
) {
|
) {
|
||||||
Text(text = stringResource(id = R.string.disconnect))
|
Text(text = stringResource(id = R.string.disconnect))
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ dependencyResolutionManagement {
|
|||||||
|
|
||||||
versionCatalogs {
|
versionCatalogs {
|
||||||
libs {
|
libs {
|
||||||
|
alias('nordic-theme').to('no.nordicsemi.android.common:theme:1.0.0')
|
||||||
alias('nordic-ble-common').to('no.nordicsemi.android:ble-common:2.2.0')
|
alias('nordic-ble-common').to('no.nordicsemi.android:ble-common:2.2.0')
|
||||||
alias('nordic-log').to('no.nordicsemi.android:log:2.3.0')
|
alias('nordic-log').to('no.nordicsemi.android:log:2.3.0')
|
||||||
alias('nordic-scanner').to('no.nordicsemi.android.support.v18:scanner:1.5.0')
|
alias('nordic-scanner').to('no.nordicsemi.android.support.v18:scanner:1.5.0')
|
||||||
|
|
||||||
alias('localbroadcastmanager').to('androidx.localbroadcastmanager:localbroadcastmanager:1.0.0')
|
alias('localbroadcastmanager').to('androidx.localbroadcastmanager:localbroadcastmanager:1.0.0')
|
||||||
alias('material').to('com.google.android.material:material:1.4.0')
|
alias('material').to('com.google.android.material:material:1.5.0-beta01')
|
||||||
|
|
||||||
version('lifecycle', '2.3.1')
|
version('lifecycle', '2.3.1')
|
||||||
alias('lifecycle-activity').to('androidx.lifecycle', 'lifecycle-runtime-ktx').versionRef('lifecycle')
|
alias('lifecycle-activity').to('androidx.lifecycle', 'lifecycle-runtime-ktx').versionRef('lifecycle')
|
||||||
@@ -29,7 +30,7 @@ dependencyResolutionManagement {
|
|||||||
version('compose', '1.0.2')
|
version('compose', '1.0.2')
|
||||||
alias('compose-livedata').to('androidx.compose.runtime', 'runtime-livedata').versionRef('compose')
|
alias('compose-livedata').to('androidx.compose.runtime', 'runtime-livedata').versionRef('compose')
|
||||||
alias('compose-ui').to('androidx.compose.ui', 'ui').versionRef('compose')
|
alias('compose-ui').to('androidx.compose.ui', 'ui').versionRef('compose')
|
||||||
alias('compose-material').to('androidx.compose.material', 'material').versionRef('compose')
|
alias('compose-material').to('androidx.compose.material3:material3:1.0.0-alpha01')
|
||||||
alias('compose-tooling-preview').to('androidx.compose.ui', 'ui-tooling-preview').versionRef('compose')
|
alias('compose-tooling-preview').to('androidx.compose.ui', 'ui-tooling-preview').versionRef('compose')
|
||||||
alias('compose-navigation').to('androidx.navigation:navigation-compose:2.4.0-alpha09')
|
alias('compose-navigation').to('androidx.navigation:navigation-compose:2.4.0-alpha09')
|
||||||
bundle('compose', ['compose-livedata', 'compose-ui', 'compose-material', 'compose-tooling-preview', 'compose-navigation'])
|
bundle('compose', ['compose-livedata', 'compose-ui', 'compose-material', 'compose-tooling-preview', 'compose-navigation'])
|
||||||
|
|||||||
Reference in New Issue
Block a user