mirror of
https://github.com/lone-cloud/prism-android
synced 2026-06-03 11:03:10 -07:00
minor UI nits
This commit is contained in:
parent
59f66da6f0
commit
a4cd95835c
2 changed files with 24 additions and 12 deletions
|
|
@ -111,7 +111,7 @@ fun MainScreen(
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 20.dp),
|
||||||
horizontalAlignment = Alignment.Start,
|
horizontalAlignment = Alignment.Start,
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
) innerColumn@{
|
) innerColumn@{
|
||||||
|
|
@ -126,14 +126,14 @@ fun MainScreen(
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.registered_apps_heading),
|
text = stringResource(R.string.registered_apps_heading),
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleSmall,
|
||||||
color = MaterialTheme.colorScheme.primary,
|
color = MaterialTheme.colorScheme.primary,
|
||||||
modifier = Modifier.padding(bottom = 8.dp)
|
modifier = Modifier.padding(bottom = 6.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.padding(horizontal = 8.dp)
|
modifier = Modifier.padding(horizontal = 12.dp)
|
||||||
) {
|
) {
|
||||||
RegistrationList(viewModel.registrationsViewModel)
|
RegistrationList(viewModel.registrationsViewModel)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,12 @@ import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.rememberScrollState
|
import androidx.compose.foundation.rememberScrollState
|
||||||
import androidx.compose.foundation.verticalScroll
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.OpenInNew
|
||||||
import androidx.compose.material3.AlertDialog
|
import androidx.compose.material3.AlertDialog
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
import androidx.compose.material3.OutlinedButton
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
|
|
@ -183,7 +186,6 @@ fun ServerConfigScreen(
|
||||||
if (showServerChangeWarning) {
|
if (showServerChangeWarning) {
|
||||||
ServerChangeWarningDialog(
|
ServerChangeWarningDialog(
|
||||||
newUrl = normalizeUrl(url),
|
newUrl = normalizeUrl(url),
|
||||||
newApiKey = apiKey,
|
|
||||||
initialUrl = initialUrl,
|
initialUrl = initialUrl,
|
||||||
onConfirm = { normalizedUrl ->
|
onConfirm = { normalizedUrl ->
|
||||||
showServerChangeWarning = false
|
showServerChangeWarning = false
|
||||||
|
|
@ -210,20 +212,30 @@ fun ServerConfigScreen(
|
||||||
internal fun PrismInfoWithLink(uriHandler: androidx.compose.ui.platform.UriHandler) {
|
internal fun PrismInfoWithLink(uriHandler: androidx.compose.ui.platform.UriHandler) {
|
||||||
val learnMore = stringResource(R.string.prism_server_learn_more)
|
val learnMore = stringResource(R.string.prism_server_learn_more)
|
||||||
|
|
||||||
Text(
|
Row(
|
||||||
text = learnMore,
|
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
|
||||||
color = MaterialTheme.colorScheme.primary,
|
|
||||||
modifier = Modifier.clickable {
|
modifier = Modifier.clickable {
|
||||||
uriHandler.openUri("https://github.com/lone-cloud/prism")
|
uriHandler.openUri("https://github.com/lone-cloud/prism")
|
||||||
}
|
},
|
||||||
)
|
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = learnMore,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.primary
|
||||||
|
)
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.AutoMirrored.Filled.OpenInNew,
|
||||||
|
contentDescription = null,
|
||||||
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
|
modifier = Modifier.size(16.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ServerChangeWarningDialog(
|
private fun ServerChangeWarningDialog(
|
||||||
newUrl: String,
|
newUrl: String,
|
||||||
newApiKey: String,
|
|
||||||
initialUrl: String,
|
initialUrl: String,
|
||||||
onConfirm: (String) -> Unit,
|
onConfirm: (String) -> Unit,
|
||||||
onDismiss: () -> Unit
|
onDismiss: () -> Unit
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue