From f981fe7ed23b269676a95f953728d74f82f68e4b Mon Sep 17 00:00:00 2001 From: Satoshi Kataoka Date: Tue, 8 Oct 2013 20:58:47 +0900 Subject: [PATCH] Fix the position of emoji palette Change-Id: I07a3912cb9fef8e28f3605de4e73a201a900e95c --- .../com/android/inputmethod/keyboard/EmojiPalettesView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java index 4f5961175..9779c683c 100644 --- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java +++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java @@ -84,6 +84,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange private TabHost mTabHost; private ViewPager mEmojiPager; + private int mCurrentPagerPosition = 0; private EmojiCategoryPageIndicatorView mEmojiCategoryPageIndicatorView; private KeyboardActionListener mKeyboardActionListener = KeyboardActionListener.EMPTY_LISTENER; @@ -507,6 +508,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange setCurrentCategoryId(newPos.first /* categoryId */, false /* force */); mEmojiCategory.setCurrentCategoryPageId(newPos.second /* categoryPageId */); updateEmojiCategoryPageIdView(); + mCurrentPagerPosition = position; } @Override @@ -569,15 +571,17 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange public void startEmojiPalettes() { if (DEBUG_PAGER) { - Log.d(TAG, "allocate emoji palettes memory"); + Log.d(TAG, "allocate emoji palettes memory " + mCurrentPagerPosition); } mEmojiPager.setAdapter(mEmojiPalettesAdapter); + mEmojiPager.setCurrentItem(mCurrentPagerPosition); } public void stopEmojiPalettes() { if (DEBUG_PAGER) { Log.d(TAG, "deallocate emoji palettes memory"); } + mEmojiPalettesAdapter.flushPendingRecentKeys(); mEmojiPager.setAdapter(null); }