Repository navigation
Android TV: open the keyboard on OK, not when the D-pad reaches a field - #107
Conversation
Avalonia.Android shows the soft keyboard as soon as a TextBox gets the focus (AndroidInputMethod.SetClient -> ShowSoftInput). On a touch screen that is a tap on the field; with a TV remote it fires whenever the D-pad merely passes through one. The Library search box sits between the toolbar and the filters, so moving down the page opened a keyboard over half the screen, and the keyboard then took the D-pad. On a TV (UiModeManager reports Television) a TextBox that gets the focus now has the keyboard hidden again right after Avalonia opens it, and OK (D-pad centre, which Avalonia maps to Key.Space, or Enter) on the field opens it; that key does nothing else. Back closes it as before, and the D-pad then moves on. Phones and tablets are not affected. Checked on an Android TV 16 emulator with D-pad input only: Down from the toolbar focuses the search box without a keyboard, OK opens it, typed text lands in the box, Back closes it, Down moves on to the group filter with no keyboard. Fixes #103
PR Summary by QodoAndroid TV: open text-field keyboard on OK instead of D-pad focus
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. OK can insert a space after Back
|
On a TV (
UiModeManagerreports Television), a text field that gets the focus no longer keeps the soft keyboard Avalonia opens for it; OK (D-pad centre / Enter) on the field opens it, Back closes it, and the D-pad moves on. Phones and tablets are not affected. NewPlatform/TvSoftKeyboard.cs, installed fromMainActivity.OnCreate.Checked on an Android TV 16 emulator: the Library search box is passed through without a keyboard, OK opens it, typing works, Back closes it.
Fixes #103