fix: light mode text bugs
This commit is contained in:
parent
ff97c65d4f
commit
1b9560b601
|
@ -47,13 +47,13 @@ fun SubmitConfigurationTextBox(
|
||||||
|
|
||||||
CustomTextField(
|
CustomTextField(
|
||||||
isError = isErrorValue(stateValue),
|
isError = isErrorValue(stateValue),
|
||||||
textStyle = MaterialTheme.typography.bodySmall,
|
textStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurface),
|
||||||
value = stateValue,
|
value = stateValue,
|
||||||
onValueChange = { stateValue = it },
|
onValueChange = { stateValue = it },
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
label = { Text(label) },
|
label = { Text(label, color = MaterialTheme.colorScheme.onSurface, style = MaterialTheme.typography.labelMedium) },
|
||||||
containerColor = MaterialTheme.colorScheme.surface,
|
containerColor = MaterialTheme.colorScheme.surface,
|
||||||
placeholder = { Text(hint, style = MaterialTheme.typography.bodySmall) },
|
placeholder = { Text(hint, style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.outline) },
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
.padding(
|
.padding(
|
||||||
|
|
|
@ -65,11 +65,17 @@ fun TrustedNetworkTextBox(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CustomTextField(
|
CustomTextField(
|
||||||
textStyle = MaterialTheme.typography.bodySmall,
|
textStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurface),
|
||||||
value = currentText,
|
value = currentText,
|
||||||
onValueChange = onValueChange,
|
onValueChange = onValueChange,
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
label = { Text(stringResource(R.string.add_wifi_name)) },
|
label = {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.add_wifi_name),
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
)
|
||||||
|
},
|
||||||
containerColor = MaterialTheme.colorScheme.surface,
|
containerColor = MaterialTheme.colorScheme.surface,
|
||||||
supportingText = supporting,
|
supportingText = supporting,
|
||||||
modifier =
|
modifier =
|
||||||
|
|
|
@ -303,7 +303,13 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.private_key)) },
|
label = {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.private_key),
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
)
|
||||||
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(
|
Text(
|
||||||
|
@ -342,7 +348,13 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.public_key)) },
|
label = {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.public_key),
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
)
|
||||||
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(
|
Text(
|
||||||
|
@ -677,7 +689,8 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
hint = stringResource(R.string.base64_key),
|
hint = stringResource(R.string.base64_key),
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
val presharedKeyEnabled = (tunnelConfig == null) || isAuthenticated || peer.preSharedKey.isBlank()
|
val presharedKeyEnabled = (tunnelConfig == null) || isAuthenticated ||
|
||||||
|
with(configPair.second?.peers[index]?.preSharedKey) { this?.isEmpty == true || this?.isPresent == false }
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
textStyle = MaterialTheme.typography.labelLarge,
|
textStyle = MaterialTheme.typography.labelLarge,
|
||||||
modifier =
|
modifier =
|
||||||
|
@ -693,7 +706,13 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
},
|
},
|
||||||
enabled = presharedKeyEnabled,
|
enabled = presharedKeyEnabled,
|
||||||
onValueChange = { value -> peersState[index] = peersState[index].copy(preSharedKey = value) },
|
onValueChange = { value -> peersState[index] = peersState[index].copy(preSharedKey = value) },
|
||||||
label = { Text(stringResource(R.string.preshared_key)) },
|
label = {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.preshared_key),
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
)
|
||||||
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(
|
Text(
|
||||||
|
@ -720,7 +739,9 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
style = MaterialTheme.typography.labelMedium,
|
style = MaterialTheme.typography.labelMedium,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.persistent_keepalive), style = MaterialTheme.typography.labelMedium) },
|
label = {
|
||||||
|
Text(stringResource(R.string.persistent_keepalive), color = MaterialTheme.colorScheme.onSurface, style = MaterialTheme.typography.labelMedium)
|
||||||
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(stringResource(R.string.optional_no_recommend), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.outline)
|
Text(stringResource(R.string.optional_no_recommend), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.outline)
|
||||||
|
@ -746,7 +767,13 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
||||||
onValueChange = { value ->
|
onValueChange = { value ->
|
||||||
peersState[index] = peersState[index].copy(allowedIps = value)
|
peersState[index] = peersState[index].copy(allowedIps = value)
|
||||||
},
|
},
|
||||||
label = { Text(stringResource(R.string.allowed_ips)) },
|
label = {
|
||||||
|
Text(
|
||||||
|
stringResource(R.string.allowed_ips),
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
style = MaterialTheme.typography.labelMedium,
|
||||||
|
)
|
||||||
|
},
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(stringResource(R.string.comma_separated_list), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.outline)
|
Text(stringResource(R.string.comma_separated_list), style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.outline)
|
||||||
|
|
|
@ -87,8 +87,8 @@ fun Context.launchNotificationSettings() {
|
||||||
|
|
||||||
fun Context.launchShareFile(file: Uri) {
|
fun Context.launchShareFile(file: Uri) {
|
||||||
val shareIntent = Intent().apply {
|
val shareIntent = Intent().apply {
|
||||||
setAction(Intent.ACTION_SEND)
|
action = Intent.ACTION_SEND
|
||||||
setType("*/*")
|
type = "*/*"
|
||||||
putExtra(Intent.EXTRA_STREAM, file)
|
putExtra(Intent.EXTRA_STREAM, file)
|
||||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ fun Context.launchVpnSettings(): Result<Unit> {
|
||||||
fun Context.launchLocationServicesSettings(): Result<Unit> {
|
fun Context.launchLocationServicesSettings(): Result<Unit> {
|
||||||
return kotlin.runCatching {
|
return kotlin.runCatching {
|
||||||
val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS).apply {
|
val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS).apply {
|
||||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
}
|
}
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ fun Context.launchLocationServicesSettings(): Result<Unit> {
|
||||||
fun Context.launchSettings(): Result<Unit> {
|
fun Context.launchSettings(): Result<Unit> {
|
||||||
return kotlin.runCatching {
|
return kotlin.runCatching {
|
||||||
val intent = Intent(Settings.ACTION_SETTINGS).apply {
|
val intent = Intent(Settings.ACTION_SETTINGS).apply {
|
||||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
}
|
}
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ fun Context.launchAppSettings() {
|
||||||
kotlin.runCatching {
|
kotlin.runCatching {
|
||||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
||||||
data = Uri.fromParts("package", packageName, null)
|
data = Uri.fromParts("package", packageName, null)
|
||||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
}
|
}
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue