AccountsScreen code styling
This commit is contained in:
@ -60,9 +60,7 @@ import com.tutpro.baresip.CustomElements.AlertDialog
|
|||||||
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
import com.tutpro.baresip.CustomElements.verticalScrollbar
|
||||||
|
|
||||||
fun NavGraphBuilder.accountsScreenRoute(navController: NavController) {
|
fun NavGraphBuilder.accountsScreenRoute(navController: NavController) {
|
||||||
composable("accounts") {
|
composable("accounts") { AccountsScreen(navController) }
|
||||||
AccountsScreen(navController)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@ -96,9 +94,7 @@ fun AccountsScreen(navController: NavController) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
bottomBar = { NewAccount(navController) },
|
bottomBar = { NewAccount(navController) },
|
||||||
content = { contentPadding ->
|
content = { contentPadding -> AccountsContent(contentPadding, navController) },
|
||||||
AccountsContent(contentPadding, navController)
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,9 +133,7 @@ fun AccountsContent(contentPadding: PaddingValues, navController: NavController)
|
|||||||
val account = ua.account
|
val account = ua.account
|
||||||
val aor = account.aor
|
val aor = account.aor
|
||||||
val text = account.text()
|
val text = account.text()
|
||||||
Row(
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
) {
|
|
||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
@ -147,9 +141,7 @@ fun AccountsContent(contentPadding: PaddingValues, navController: NavController)
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 10.dp)
|
.padding(start = 10.dp)
|
||||||
.clickable {
|
.clickable { navController.navigate("account/$aor/old") }
|
||||||
navController.navigate("account/$aor/old")
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
val deleteAccountMessage = stringResource(R.string.delete_account)
|
val deleteAccountMessage = stringResource(R.string.delete_account)
|
||||||
SmallFloatingActionButton(
|
SmallFloatingActionButton(
|
||||||
@ -266,20 +258,17 @@ fun NewAccount(navController: NavController) {
|
|||||||
},
|
},
|
||||||
singleLine = false,
|
singleLine = false,
|
||||||
trailingIcon = {
|
trailingIcon = {
|
||||||
if (newAor.isNotEmpty()) {
|
if (newAor.isNotEmpty())
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Outlined.Clear,
|
Icons.Outlined.Clear,
|
||||||
contentDescription = "Clear",
|
contentDescription = "Clear",
|
||||||
modifier = Modifier.clickable { newAor = "" },
|
modifier = Modifier.clickable { newAor = "" },
|
||||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
)
|
)
|
||||||
}
|
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.new_account)) },
|
label = { Text(stringResource(R.string.new_account)) },
|
||||||
textStyle = TextStyle(fontSize = 18.sp),
|
textStyle = TextStyle(fontSize = 18.sp),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text)
|
||||||
keyboardType = KeyboardType.Text,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
SmallFloatingActionButton(
|
SmallFloatingActionButton(
|
||||||
modifier = Modifier.offset(y = 2.dp),
|
modifier = Modifier.offset(y = 2.dp),
|
||||||
|
|||||||
Reference in New Issue
Block a user