Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable autocorrect in server settings input fields #7372

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package app.k9mail.core.ui.compose.designsystem.atom.textfield

import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -21,6 +22,7 @@ fun TextFieldOutlined(
isRequired: Boolean = false,
hasError: Boolean = false,
isSingleLine: Boolean = true,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
) {
MaterialOutlinedTextField(
value = value,
Expand All @@ -32,6 +34,7 @@ fun TextFieldOutlined(
readOnly = isReadOnly,
isError = hasError,
singleLine = isSingleLine,
keyboardOptions = keyboardOptions,
)
}

Expand All @@ -52,8 +55,8 @@ internal fun TextFieldOutlinedWithLabelPreview() {
PreviewWithThemes {
TextFieldOutlined(
value = "Input text",
label = "Label",
onValueChange = {},
label = "Label",
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app.k9mail.core.ui.compose.designsystem.molecule.input

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -20,6 +21,7 @@ fun TextInput(
contentPadding: PaddingValues = inputContentPadding(),
isSingleLine: Boolean = true,
isEnabled: Boolean = true,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
) {
InputLayout(
modifier = modifier,
Expand All @@ -35,6 +37,7 @@ fun TextInput(
hasError = errorMessage != null,
isSingleLine = isSingleLine,
modifier = Modifier.fillMaxWidth(),
keyboardOptions = keyboardOptions,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.res.Resources
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.requiredHeight
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.designsystem.molecule.input.NumberInput
Expand Down Expand Up @@ -53,6 +54,7 @@ internal fun LazyListScope.incomingFormItems(
onTextChange = { onEvent(Event.ServerChanged(it)) },
label = stringResource(id = R.string.account_server_settings_server_label),
contentPadding = defaultItemPadding(),
keyboardOptions = KeyboardOptions(autoCorrect = false),
)
}

Expand Down Expand Up @@ -95,6 +97,7 @@ internal fun LazyListScope.incomingFormItems(
onTextChange = { onEvent(Event.UsernameChanged(it)) },
label = stringResource(id = R.string.account_server_settings_username_label),
contentPadding = defaultItemPadding(),
keyboardOptions = KeyboardOptions(autoCorrect = false),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.res.Resources
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.requiredHeight
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.designsystem.molecule.input.NumberInput
Expand Down Expand Up @@ -42,6 +43,7 @@ internal fun LazyListScope.outgoingFormItems(
label = stringResource(id = R.string.account_server_settings_server_label),
isRequired = true,
contentPadding = defaultItemPadding(),
keyboardOptions = KeyboardOptions(autoCorrect = false),
)
}

Expand Down Expand Up @@ -87,6 +89,7 @@ internal fun LazyListScope.outgoingFormItems(
label = stringResource(id = R.string.account_server_settings_username_label),
isRequired = true,
contentPadding = defaultItemPadding(),
keyboardOptions = KeyboardOptions(autoCorrect = false),
)
}
}
Expand Down