android Unselect onscreen Keyboard on dpad navigation (blur focus)

632 views Asked by At

I have a keyboard on the screen (As a component inside LinearLayout. So it's always on the screen.) I'm developing the app on an Amazon FireTV so I made an onscreen keyboard where I can use DPAD for navigation. It all works great except the highlight seems to persist even when I'm not focusing on the keyboard.

import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;

private KeyboardView mKeyboardView;
private Keyboard mKeyboard;

mKeyboard = new Keyboard(getActivity(), R.xml.search_keyboard);
mKeyboardView = (KeyboardView) view.findViewById(R.id.keyboard);
mKeyboardView.setKeyboard(mKeyboard);

Below the keyboard is a focusable view. When I select the new view, I expect the key highlight on the keyboard to go away. But that's not happening. (If I was selecting K, K would be highlighted in yellow (This is expected) but when I navigate away from the keyboard, the highlight will stay as if the keyboard is still focused.

Any insights will be much appreciated. Thank you!

0

There are 0 answers