louiskirsch / QuickDynalist

Add new items to dynalist quickly (native android app)
https://play.google.com/store/apps/details?id=com.louiskirsch.quickdynalist
GNU General Public License v3.0
35 stars 5 forks source link

Quick add input field does not autocorrect #3

Closed jaynavar closed 5 years ago

jaynavar commented 5 years ago

When I use quick add the input text box it does not perform autocorrections as I type. It does show the autocorrect bar, but it won't actually make active corrections. I believe this is a setting in the EditText box.

Can you change this to perform active corrections, or was this intentional? I think it would be a really useful change, and if this was intentional it would be nice to have a settings toggle for this as I'm sure others want this as well.

Loving the app, thanks for all of the hard work!

louiskirsch commented 5 years ago

I was not aware that this is a setting -- will look into it. Thanks.

jaynavar commented 5 years ago

Developer reference here: https://developer.android.com/training/keyboard-input/style

You want to enable textAutoCorrect value for android:inputType attribute in EditText.

louiskirsch commented 5 years ago

It seems like the fix does not work with the Google Keyboard, but works with SwiftKey.

jaynavar commented 5 years ago

It looks like SwiftKey always ignores app EditText flags in favor of user preferences: https://stackoverflow.com/a/21047514/903996

So the autocorrect behavior has probably always been like that with SwiftKey, whereas GBoard adheres to Google Developer guidelines.

Based on code use of textAutoCorrect on Github it looks like android:inputType="text|textAutoCorrect" is rarely used, it's usually just android:inputType="textAutoCorrect": https://github.com/search?q=textAutoCorrect&type=Code

I'm not sure why that would cause the issue as I would think that textAutoCorrect flag would take precedence, but it probably is worth investigating.

jaynavar commented 5 years ago

I think this is the culprit: https://github.com/timediv/QuickDynalist/blob/2ac2c29fcd03283ef7fc81b8387d27a6e542eae5/app/src/main/java/com/louiskirsch/quickdynalist/utils/Extensions.kt#L32

inputType is being set programmatically overriding the layout value. So this should include or InputType.TYPE_TEXT_FLAG_AUTO_CORRECT.

louiskirsch commented 5 years ago

You are right, thanks.

jaynavar commented 5 years ago

I have a PR ready with the change (#8). If it looks okay, can you merge it in?

louiskirsch commented 5 years ago

Will do!