Skip to content

feat(study-screen): nosuggest:type field filter#21097

Open
david-allison wants to merge 2 commits into
ankidroid:mainfrom
david-allison:no-suggest
Open

feat(study-screen): nosuggest:type field filter#21097
david-allison wants to merge 2 commits into
ankidroid:mainfrom
david-allison:no-suggest

Conversation

@david-allison
Copy link
Copy Markdown
Member

@david-allison david-allison commented May 19, 2026

Note

Assisted-by: Claude Opus 4.7 - the code and a lot of bad research

Purpose / Description

This removes suggestions from the IME, so a language learner can learn an orthography without hints. It also removes the 'swipe' operation on the keyboard without showing the incognito icon.

This input mode will not be for all users: it makes Mandarin Chinese keyboards output in QWERTY only mode, and likely will disable voice input.

It is to be treated as an advanced feature, and is currently a hidden feature, planned to be exposed by the FieldFilter class.

nosuggest needs to come before type in the field filter list: type is processed by the backend, and AnkiDroid processes the remaining 'custom' filters

Usage: {{nosuggest:type:Field}}

Fixes

Approach

  • add a {{nosuggest:type:Field}} field filter
  • Transformed to [[type:nosuggest:Field]] on the card
  • TypeAnswer picks this up, and properties are used to impact an EditText
  • Use InputType.TYPE_NULL to hude suggestions

How Has This Been Tested?

S21 5G: GBoard and Samsung Keyboard

image image

Learning (optional, can help others)

The following were considered:

TYPE_TEXT_FLAG_AUTO_COMPLETE = false
TYPE_TEXT_FLAG_AUTO_CORRECT = false
TYPE_TEXT_FLAG_AUTO_CORRECT = false
TYPE_TEXT_VARIATION_FILTER = true
IME_FLAG_NO_PERSONALIZED_LEARNING = true

The above are not sufficient for GBoard - incognito shows, and the strip showing suggested words is still visible

TYPE_TEXT_VARIATION_VISIBLE_PASSWORD removed suggestions, but with an in-IME hint to open the password manager and a monospaced font on the field

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the [Google Accessibility Scanner](https://play.google.com/store/apps/details?id=com.google.android.apps.accessibility.auditor

This removes suggestions from the IME, so a language learner can learn
an orthography without hints. It also removes the 'swipe' operation on
the keyboard without showing the incognito icon.

This input mode (TYPE_NULL) will not be for all users: it makes Mandarin
 Chinese keyboards output in QWERTY only mode, and likely will disable
 voice input.

It is to be treated as an advanced feature, and is currently a hidden
feature, planned to be exposed by the FieldFilter class.

`nosuggest` needs to come before `type` in the field filter list: `type`
 is  processed by the backend, and AnkiDroid processes the remaining
 'custom' filters

so: `{{nosuggest:type:Field}}` becomes [[type:nosuggest:Field]] which is
 exposed by TypeAnswer, and implemented by the study screen

----

The following were considered:

TYPE_TEXT_FLAG_AUTO_COMPLETE = false
TYPE_TEXT_FLAG_AUTO_CORRECT = false
TYPE_TEXT_FLAG_AUTO_CORRECT = false
TYPE_TEXT_VARIATION_FILTER = true
IME_FLAG_NO_PERSONALIZED_LEARNING = true

The above are not sufficient for GBoard - incognito shows, and the strip
 showing suggested words is still visible

`TYPE_TEXT_VARIATION_VISIBLE_PASSWORD` removed suggestions, but with an
in-IME hint to open the password manager and a monospaced font on the
field

Fixes 10352

https://developer.android.com/reference/android/text/InputType#TYPE_NULL

Assisted-by: Claude Opus 4.7 - the code and a lot of bad research
@github-actions
Copy link
Copy Markdown
Contributor

Snapshot diff report vs main. Open screenshot-diff for diffs.

  • PreferencesScreenshotTest: 1 change
All 1 changed screenshots

PreferencesScreenshotTest

  • ReviewerOptionsFragment_compare.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide keyboard suggestions when typing answers

1 participant