Refactor RecentsKeyboard
Bug: 10538430 Change-Id: I7a22d2d4a105b17b2a84a3fff2bc3981823d228dmain
parent
1c6263ac9e
commit
2c011c697b
|
@ -37,7 +37,7 @@ import android.widget.TabHost;
|
|||
import android.widget.TabHost.OnTabChangeListener;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.inputmethod.keyboard.internal.RecentsKeyboard;
|
||||
import com.android.inputmethod.keyboard.internal.DynamicGridKeyboard;
|
||||
import com.android.inputmethod.keyboard.internal.ScrollKeyboardView;
|
||||
import com.android.inputmethod.keyboard.internal.ScrollViewWithNotifier;
|
||||
import com.android.inputmethod.latin.Constants;
|
||||
|
@ -376,7 +376,7 @@ public final class EmojiKeyboardView extends LinearLayout implements OnTabChange
|
|||
private static class EmojiKeyboardAdapter extends PagerAdapter {
|
||||
private final ScrollKeyboardView.OnKeyClickListener mListener;
|
||||
private final KeyboardLayoutSet mLayoutSet;
|
||||
private final RecentsKeyboard mRecentsKeyboard;
|
||||
private final DynamicGridKeyboard mRecentsKeyboard;
|
||||
private final SparseArray<ScrollKeyboardView> mActiveKeyboardView =
|
||||
CollectionUtils.newSparseArray();
|
||||
private final EmojiCategory mEmojiCategory;
|
||||
|
@ -388,7 +388,7 @@ public final class EmojiKeyboardView extends LinearLayout implements OnTabChange
|
|||
mEmojiCategory = emojiCategory;
|
||||
mListener = listener;
|
||||
mLayoutSet = layoutSet;
|
||||
mRecentsKeyboard = new RecentsKeyboard(
|
||||
mRecentsKeyboard = new DynamicGridKeyboard(
|
||||
layoutSet.getKeyboard(KeyboardId.ELEMENT_EMOJI_RECENTS));
|
||||
}
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ import java.util.ArrayDeque;
|
|||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This is a Keyboard class to host recently used keys.
|
||||
* This is a Keyboard class where you can add keys dynamically shown in a grid layout
|
||||
*/
|
||||
// TODO: Save/restore recent keys from/to preferences.
|
||||
public class RecentsKeyboard extends Keyboard {
|
||||
public class DynamicGridKeyboard extends Keyboard {
|
||||
private static final int TEMPLATE_KEY_CODE_0 = 0x30;
|
||||
private static final int TEMPLATE_KEY_CODE_1 = 0x31;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class RecentsKeyboard extends Keyboard {
|
|||
|
||||
private Key[] mCachedRecentKeys;
|
||||
|
||||
public RecentsKeyboard(final Keyboard templateKeyboard) {
|
||||
public DynamicGridKeyboard(final Keyboard templateKeyboard) {
|
||||
super(templateKeyboard);
|
||||
final Key key0 = getTemplateKey(TEMPLATE_KEY_CODE_0);
|
||||
final Key key1 = getTemplateKey(TEMPLATE_KEY_CODE_1);
|
Loading…
Reference in New Issue