Android : Disable full screen editing for soft keyboards

In Android, Mobile Apps, Software Development by admin

Android provides Input Method Editors which can capture user input ranging from typed in characters to voice and more.
Characters can be typed in using an on-screen keyboard also called a soft keyboard. I focus here on one specific use case of a soft keyboard involving the popular EditText widget.
A particularly irritating feature of the EditText widget in Android is when the soft keyboard occupies the full screen and every input is mirrored as the user types out characters. This usually happens when the user changes the device’s configuration to landscape mode. The soft keyboard would now occupy the whole screen with only a portion of the active view visible to the user in the background. As the user types out characters these get mirrored as output before landing in the EditText box.
Although this may be an essential feature in some cases, the keyboard occupying the whole screen is quite a jarring experience.

In order to avoid this all that needs to be done is to set a specific IME option known as ‘flagNoExtractUi’ which ensures that the IME does not mirror the extracted text on the UI.

Setting the above flag ensures that a portion of the application view is still visible to the user and the soft keyboard does not occupy the whole screen.

References
https://developer.android.com/reference/android/widget/TextView#attr_android:imeOptions
https://developer.android.com/guide/topics/text/creating-input-method