Skip to content

Commit

Permalink
Disable "IMAP path prefix" input when auto-detecting IMAP namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
cketti committed Jul 17, 2023
1 parent 23add3b commit d8489c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fun TextInput(
errorMessage: String? = null,
contentPadding: PaddingValues = inputContentPadding(),
isSingleLine: Boolean = true,
isEnabled: Boolean = true,
) {
InputLayout(
modifier = modifier,
Expand All @@ -29,6 +30,7 @@ fun TextInput(
value = text,
onValueChange = onTextChange,
label = label,
isEnabled = isEnabled,
isRequired = isRequired,
hasError = errorMessage != null,
isSingleLine = isSingleLine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d8489c1

Please sign in to comment.