Skip to content

Commit

Permalink
Merge pull request #7372 from bernhard-fp/7361_disable_autocorrect_in…
Browse files Browse the repository at this point in the history
…_server_settings

Disable autocorrect in server settings input fields
  • Loading branch information
cketti authored Nov 24, 2023
2 parents b7a449a + be7310a commit 5815506
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
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

0 comments on commit 5815506

Please sign in to comment.