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

Fix #304 (take two): In Utils.autoCapitalizeCheck, use input type of current editor #909

Merged

Conversation

mpsijm
Copy link
Contributor

@mpsijm mpsijm commented May 18, 2024

I checked the documentation again, and it says about reqModes:

[...] you can simply pass the current TextBoxAttribute.contentType value directly in to here.

I assume that ime.currentInputEditorInfo.inputType is what we're looking for, in that case 😄

To make sure that this can be tested in the TestOutTextField, I set it to auto-capitalize sentences.

Besides the test-out text field, I've tested this in these apps, and it looks like everything is as expected:

  • The built-in Messages app (only auto-capitalizes sentences when the auto-capitalize behaviour setting in Thumb-key is enabled)
  • The built-in Contacts app (only auto-capitalizes every word in a name when the setting is enabled)
  • JuiceSSH (no auto-capitalization, regardless of the setting)
  • Termux (no auto-capitalization, regardless of the setting)

Hopefully, this really fixes #304 😄

@mpsijm mpsijm requested a review from dessalines as a code owner May 18, 2024 18:37
…t type of current editor

I checked the documentation[1] again, and it says about `reqModes`:
> [...] you can simply pass the current `TextBoxAttribute.contentType`
>  value directly in to here.

I assume that `ime.currentInputEditorInfo.inputType` is what we're
looking for, in that case 😄

To make sure that this can be tested in the TestOutTextField,
I set it to auto-capitalize sentences.

[1]: https://developer.android.com/reference/android/view/inputmethod/InputConnection#getCursorCapsMode(int)
@mpsijm mpsijm force-pushed the 304-auto-capitalize-from-input-type branch from dbc986e to 3adb2b1 Compare May 19, 2024 11:01
Copy link
Owner

@dessalines dessalines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thx for doing this work. Wish they all would just use the standard correctly.

@dessalines dessalines merged commit 2a5f70f into dessalines:main May 21, 2024
1 check passed
@mpsijm mpsijm deleted the 304-auto-capitalize-from-input-type branch May 21, 2024 20:25
@mpsijm
Copy link
Contributor Author

mpsijm commented May 21, 2024

No problem, thanks for merging! 😄

The apps that I tested, appear to use the standard correctly 🙂 I just misunderstood the getCursorCapsMode function in #890 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bugs in Termux
2 participants