fix: light mode text bugs
This commit is contained in:
parent
ff97c65d4f
commit
1b9560b601
|
@ -47,13 +47,13 @@ fun SubmitConfigurationTextBox(
|
|||
|
||||
CustomTextField(
|
||||
isError = isErrorValue(stateValue),
|
||||
textStyle = MaterialTheme.typography.bodySmall,
|
||||
textStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurface),
|
||||
value = stateValue,
|
||||
onValueChange = { stateValue = it },
|
||||
interactionSource = interactionSource,
|
||||
label = { Text(label) },
|
||||
label = { Text(label, color = MaterialTheme.colorScheme.onSurface, style = MaterialTheme.typography.labelMedium) },
|
||||
containerColor = MaterialTheme.colorScheme.surface,
|
||||
placeholder = { Text(hint, style = MaterialTheme.typography.bodySmall) },
|
||||
placeholder = { Text(hint, style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.outline) },
|
||||
modifier =
|
||||
Modifier
|
||||
.padding(
|
||||
|
|
|
@ -65,11 +65,17 @@ fun TrustedNetworkTextBox(
|
|||
}
|
||||
}
|
||||
CustomTextField(
|
||||
textStyle = MaterialTheme.typography.bodySmall,
|
||||
textStyle = MaterialTheme.typography.bodySmall.copy(color = MaterialTheme.colorScheme.onSurface),
|
||||
value = currentText,
|
||||
onValueChange = onValueChange,
|
||||
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,
|
||||
supportingText = supporting,
|
||||
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,
|
||||
placeholder = {
|
||||
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,
|
||||
placeholder = {
|
||||
Text(
|
||||
|
@ -677,7 +689,8 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
|||
hint = stringResource(R.string.base64_key),
|
||||
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(
|
||||
textStyle = MaterialTheme.typography.labelLarge,
|
||||
modifier =
|
||||
|
@ -693,7 +706,13 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
|||
},
|
||||
enabled = presharedKeyEnabled,
|
||||
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,
|
||||
placeholder = {
|
||||
Text(
|
||||
|
@ -720,7 +739,9 @@ fun ConfigScreen(tunnelConfig: TunnelConfig?, appViewModel: AppViewModel) {
|
|||
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,
|
||||
placeholder = {
|
||||
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 ->
|
||||
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,
|
||||
placeholder = {
|
||||
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) {
|
||||
val shareIntent = Intent().apply {
|
||||
setAction(Intent.ACTION_SEND)
|
||||
setType("*/*")
|
||||
action = Intent.ACTION_SEND
|
||||
type = "*/*"
|
||||
putExtra(Intent.EXTRA_STREAM, file)
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ fun Context.launchVpnSettings(): Result<Unit> {
|
|||
fun Context.launchLocationServicesSettings(): Result<Unit> {
|
||||
return kotlin.runCatching {
|
||||
val intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS).apply {
|
||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ fun Context.launchLocationServicesSettings(): Result<Unit> {
|
|||
fun Context.launchSettings(): Result<Unit> {
|
||||
return kotlin.runCatching {
|
||||
val intent = Intent(Settings.ACTION_SETTINGS).apply {
|
||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ fun Context.launchAppSettings() {
|
|||
kotlin.runCatching {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
||||
data = Uri.fromParts("package", packageName, null)
|
||||
setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue