如何将常用电子邮件域(gmail / yahoo / hotmail)的快捷方式添加到 android 电视键盘?

How to add shortcuts of common email domains (gmail / yahoo / hotmail) to android tv keyboard?

我正在尝试改善用户在我的应用中输入电子邮件地址的用户体验。知道如何将常用电子邮件域添加为键盘快捷键吗?

请看我附加的其他应用程序的键盘以供参考。我正在尝试找到用 gmail / yahoo / hotmail 域填充我的键盘的方法(就像在图片中一样)。

尝试查看 Creating an Input Method 文档,因为它谈到了输入法编辑器 (IME),它是一个允许用户输入文本的用户控件。

If you haven't worked with IMEs before, you should read the introductory article Onscreen Input Methods first. Also, the SoftKeyboard sample app included in the SDK contains sample code that you can modify to start building your own IME.

Designing the Input Method UI

There are two main visual elements for an IME: the input view and the candidates view. You only have to implement the elements that are relevant to the input method you're designing.

Input view

The input view is the UI where the user inputs text in the form of keyclicks, handwriting or gestures. When the IME is displayed for the first time, the system calls the onCreateInputView() callback. In your implementation of this method, you create the layout you want to display in the IME window and return the layout to the system. This snippet is an example of implementing the onCreateInputView() method:

  @Override
    public View onCreateInputView() {
        MyKeyboardView inputView =
            (MyKeyboardView) getLayoutInflater().inflate( R.layout.input, null);

        inputView.setOnKeyboardActionListener(this);
inputView.setKeyboard(mLatinKeyboard);

        return mInputView;
    }

In this example, MyKeyboardView is an instance of a custom implementation of KeyboardView that renders a Keyboard. If you’re building a traditional QWERTY keyboard, see the KeyboardView class.