Merge "When apn is read only, hide the save button." into main
This commit is contained in:
@@ -101,6 +101,7 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
|
|||||||
RegularScaffold(
|
RegularScaffold(
|
||||||
title = if (apnDataInit.newApn) stringResource(id = R.string.apn_add) else stringResource(id = R.string.apn_edit),
|
title = if (apnDataInit.newApn) stringResource(id = R.string.apn_add) else stringResource(id = R.string.apn_edit),
|
||||||
actions = {
|
actions = {
|
||||||
|
if (!apnData.customizedConfig.readOnlyApn) {
|
||||||
IconButton(onClick = {
|
IconButton(onClick = {
|
||||||
if (!apnData.validEnabled) apnData = apnData.copy(validEnabled = true)
|
if (!apnData.validEnabled) apnData = apnData.copy(validEnabled = true)
|
||||||
val valid = validateAndSaveApnData(
|
val valid = validateAndSaveApnData(
|
||||||
@@ -112,6 +113,7 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
|
|||||||
)
|
)
|
||||||
if (valid) navController.navigateBack()
|
if (valid) navController.navigateBack()
|
||||||
}) { Icon(imageVector = Icons.Outlined.Done, contentDescription = null) }
|
}) { Icon(imageVector = Icons.Outlined.Done, contentDescription = null) }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Column {
|
Column {
|
||||||
@@ -212,7 +214,9 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
|
|||||||
emptyVal = stringResource(R.string.network_type_unspecified),
|
emptyVal = stringResource(R.string.network_type_unspecified),
|
||||||
enabled = apnData.networkTypeEnabled
|
enabled = apnData.networkTypeEnabled
|
||||||
) {}
|
) {}
|
||||||
if (!apnData.newApn) {
|
if (!apnData.newApn && !apnData.customizedConfig.readOnlyApn
|
||||||
|
&& apnData.customizedConfig.isAddApnAllowed
|
||||||
|
) {
|
||||||
Preference(
|
Preference(
|
||||||
object : PreferenceModel {
|
object : PreferenceModel {
|
||||||
override val title = stringResource(R.string.menu_delete)
|
override val title = stringResource(R.string.menu_delete)
|
||||||
|
Reference in New Issue
Block a user