parent
89f6dec357
commit
f5a62cba1b
|
@ -542,15 +542,27 @@ fun ConfigScreen(tunnelId: Int, focusRequester: FocusRequester) {
|
||||||
hint = stringResource(R.string.base64_key),
|
hint = stringResource(R.string.base64_key),
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
ConfigurationTextBox(
|
OutlinedTextField(
|
||||||
|
modifier =
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clickable { showAuthPrompt = true },
|
||||||
value = peer.preSharedKey,
|
value = peer.preSharedKey,
|
||||||
|
visualTransformation =
|
||||||
|
if ((tunnelId == Constants.MANUAL_TUNNEL_CONFIG_ID.toInt()) || isAuthenticated) {
|
||||||
|
VisualTransformation.None
|
||||||
|
} else {
|
||||||
|
PasswordVisualTransformation()
|
||||||
|
},
|
||||||
|
enabled = (tunnelId == Constants.MANUAL_TUNNEL_CONFIG_ID.toInt()) || isAuthenticated || peer.preSharedKey.isEmpty(),
|
||||||
onValueChange = { value ->
|
onValueChange = { value ->
|
||||||
viewModel.onPreSharedKeyChange(index, value)
|
viewModel.onPreSharedKeyChange(index, value)
|
||||||
},
|
},
|
||||||
|
label = { Text(stringResource(R.string.preshared_key)) },
|
||||||
|
singleLine = true,
|
||||||
|
placeholder = { Text(stringResource(R.string.optional)) },
|
||||||
|
keyboardOptions = keyboardOptions,
|
||||||
keyboardActions = keyboardActions,
|
keyboardActions = keyboardActions,
|
||||||
label = stringResource(R.string.preshared_key),
|
|
||||||
hint = stringResource(R.string.optional),
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
)
|
)
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
|
Loading…
Reference in New Issue