mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-22 16:14:23 +01:00
Apply testing fixes
This commit is contained in:
@@ -30,23 +30,10 @@ fun FeatureButton(
|
||||
) {
|
||||
ScreenSection(onClick = onClick) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(160.dp),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Box( modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = stringResource(id = nameCode),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
modifier = Modifier.fillMaxWidth().align(Alignment.BottomCenter),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Image(
|
||||
painter = painterResource(iconId),
|
||||
contentDescription = stringResource(id = name),
|
||||
@@ -61,14 +48,12 @@ fun FeatureButton(
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Box( modifier = Modifier.weight(1f)) {
|
||||
Text(
|
||||
text = stringResource(id = name),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.fillMaxWidth().align(Alignment.TopCenter),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = stringResource(id = name),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.fillMaxWidth().height(42.dp),
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
package no.nordicsemi.android.nrftoolbox
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalUriHandler
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import no.nordicsemi.android.theme.view.CloseIconAppBar
|
||||
import no.nordicsemi.android.theme.view.TitleAppBar
|
||||
|
||||
@Composable
|
||||
fun HomeScreen() {
|
||||
val viewModel: HomeViewModel = hiltViewModel()
|
||||
|
||||
Column {
|
||||
val context = LocalContext.current
|
||||
CloseIconAppBar(stringResource(id = R.string.app_name)) {
|
||||
(context as? Activity)?.finish()
|
||||
}
|
||||
TitleAppBar(stringResource(id = R.string.app_name))
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
@@ -104,7 +99,7 @@ fun HomeScreen() {
|
||||
|
||||
val uriHandler = LocalUriHandler.current
|
||||
FeatureButton(R.drawable.ic_dfu, R.string.dfu_module, R.string.dfu_module_full) {
|
||||
uriHandler.openUri("https://github.com/NordicSemiconductor/Android-nRF-Toolbox")
|
||||
uriHandler.openUri("https://github.com/NordicSemiconductor/Android-DFU-Library")
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Reference in New Issue
Block a user