Disable "IMAP path prefix" input when auto-detecting IMAP namespace
This commit is contained in:
parent
23add3be6f
commit
d8489c1cf1
2 changed files with 18 additions and 7 deletions
|
@ -19,6 +19,7 @@ fun TextInput(
|
|||
errorMessage: String? = null,
|
||||
contentPadding: PaddingValues = inputContentPadding(),
|
||||
isSingleLine: Boolean = true,
|
||||
isEnabled: Boolean = true,
|
||||
) {
|
||||
InputLayout(
|
||||
modifier = modifier,
|
||||
|
@ -29,6 +30,7 @@ fun TextInput(
|
|||
value = text,
|
||||
onValueChange = onTextChange,
|
||||
label = label,
|
||||
isEnabled = isEnabled,
|
||||
isRequired = isRequired,
|
||||
hasError = errorMessage != null,
|
||||
isSingleLine = isSingleLine,
|
||||
|
|
|
@ -194,13 +194,22 @@ internal fun AccountIncomingConfigContent(
|
|||
}
|
||||
|
||||
item {
|
||||
TextInput(
|
||||
text = state.imapPrefix.value,
|
||||
errorMessage = state.imapPrefix.error?.toResourceString(resources),
|
||||
onTextChange = { onEvent(Event.ImapPrefixChanged(it)) },
|
||||
label = stringResource(id = R.string.account_setup_incoming_config_imap_prefix_label),
|
||||
contentPadding = defaultItemPadding(),
|
||||
)
|
||||
if (state.imapAutodetectNamespaceEnabled) {
|
||||
TextInput(
|
||||
onTextChange = {},
|
||||
label = stringResource(id = R.string.account_setup_incoming_config_imap_prefix_label),
|
||||
contentPadding = defaultItemPadding(),
|
||||
isEnabled = false,
|
||||
)
|
||||
} else {
|
||||
TextInput(
|
||||
text = state.imapPrefix.value,
|
||||
errorMessage = state.imapPrefix.error?.toResourceString(resources),
|
||||
onTextChange = { onEvent(Event.ImapPrefixChanged(it)) },
|
||||
label = stringResource(id = R.string.account_setup_incoming_config_imap_prefix_label),
|
||||
contentPadding = defaultItemPadding(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
item {
|
||||
|
|
Loading…
Reference in a new issue