FileDocCategorySizeDatePackage
LatinKeyboard.javaAPI DocAndroid 1.5 API3682Wed May 06 22:41:08 BST 2009com.example.android.softkeyboard

LatinKeyboard

public class LatinKeyboard extends android.inputmethodservice.Keyboard

Fields Summary
private android.inputmethodservice.Keyboard.Key
mEnterKey
Constructors Summary
public LatinKeyboard(android.content.Context context, int xmlLayoutResId)

        super(context, xmlLayoutResId);
    
public LatinKeyboard(android.content.Context context, int layoutTemplateResId, CharSequence characters, int columns, int horizontalPadding)

        super(context, layoutTemplateResId, characters, columns, horizontalPadding);
    
Methods Summary
protected android.inputmethodservice.Keyboard.KeycreateKeyFromXml(android.content.res.Resources res, android.inputmethodservice.Keyboard.Row parent, int x, int y, android.content.res.XmlResourceParser parser)

        Key key = new LatinKey(res, parent, x, y, parser);
        if (key.codes[0] == 10) {
            mEnterKey = key;
        }
        return key;
    
voidsetImeOptions(android.content.res.Resources res, int options)
This looks at the ime options given by the current editor, to set the appropriate label on the keyboard's enter key (if it has one).

        if (mEnterKey == null) {
            return;
        }
        
        switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
            case EditorInfo.IME_ACTION_GO:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_go_key);
                break;
            case EditorInfo.IME_ACTION_NEXT:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_next_key);
                break;
            case EditorInfo.IME_ACTION_SEARCH:
                mEnterKey.icon = res.getDrawable(
                        R.drawable.sym_keyboard_search);
                mEnterKey.label = null;
                break;
            case EditorInfo.IME_ACTION_SEND:
                mEnterKey.iconPreview = null;
                mEnterKey.icon = null;
                mEnterKey.label = res.getText(R.string.label_send_key);
                break;
            default:
                mEnterKey.icon = res.getDrawable(
                        R.drawable.sym_keyboard_return);
                mEnterKey.label = null;
                break;
        }