am ebec5259: Get rid of LatinKeyboardParam class

* commit 'ebec5259b7bc64751a7c9f5f9e6bedff7e20b0dc':
  Get rid of LatinKeyboardParam class
main
Tadashi G. Takaoka 2011-12-17 07:51:43 -08:00 committed by Android Git Automerger
commit 2bd5cb73b5
1 changed files with 5 additions and 32 deletions

View File

@ -77,16 +77,16 @@ public class LatinKeyboard extends Keyboard {
private static final String SMALL_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "small"; private static final String SMALL_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "small";
private static final String MEDIUM_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "medium"; private static final String MEDIUM_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "medium";
private LatinKeyboard(Context context, LatinKeyboardParams params) { private LatinKeyboard(Context context, KeyboardParams params) {
super(params); super(params);
mRes = context.getResources(); mRes = context.getResources();
mTheme = context.getTheme(); mTheme = context.getTheme();
// The index of space key is available only after Keyboard constructor has finished. // The index of space key is available only after Keyboard constructor has finished.
mSpaceKey = params.mSpaceKey; mSpaceKey = getKey(CODE_SPACE);
mSpaceIcon = (mSpaceKey != null) ? mSpaceKey.getIcon() : null; mSpaceIcon = (mSpaceKey != null) ? mSpaceKey.getIcon() : null;
mShortcutKey = params.mShortcutKey; mShortcutKey = getKey(CODE_SHORTCUT);
mEnabledShortcutIcon = (mShortcutKey != null) ? mShortcutKey.getIcon() : null; mEnabledShortcutIcon = (mShortcutKey != null) ? mShortcutKey.getIcon() : null;
final int longPressSpaceKeyTimeout = final int longPressSpaceKeyTimeout =
mRes.getInteger(R.integer.config_long_press_space_key_timeout); mRes.getInteger(R.integer.config_long_press_space_key_timeout);
@ -105,36 +105,9 @@ public class LatinKeyboard extends Keyboard {
a.recycle(); a.recycle();
} }
private static class LatinKeyboardParams extends KeyboardParams { public static class Builder extends KeyboardBuilder<KeyboardParams> {
Key mSpaceKey = null;
Key mShortcutKey = null;
LatinKeyboardParams() {}
@Override
public void onAddKey(Key key) {
super.onAddKey(key);
switch (key.mCode) {
case Keyboard.CODE_SPACE:
mSpaceKey = key;
break;
case Keyboard.CODE_SHORTCUT:
mShortcutKey = key;
break;
}
}
}
public static class Builder extends KeyboardBuilder<LatinKeyboardParams> {
public Builder(Context context) { public Builder(Context context) {
super(context, new LatinKeyboardParams()); super(context, new KeyboardParams());
}
@Override
public Builder load(int xmlId, KeyboardId id) {
super.load(xmlId, id);
return this;
} }
@Override @Override