am 50fbe4cc: Merge "Cancel keydown events immediately once the view starts scrolling"

* commit '50fbe4cc09e9ee98f94f3a90b1353ec22ac149c7':
  Cancel keydown events immediately once the view starts scrolling
main
Yohei Yukawa 2014-02-12 02:23:24 -08:00 committed by Android Git Automerger
commit a8a06ad6d4
1 changed files with 9 additions and 0 deletions

View File

@ -534,6 +534,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
@Override
public void onPageScrolled(final int position, final float positionOffset,
final int positionOffsetPixels) {
mEmojiPalettesAdapter.onPageScrolled();
final Pair<Integer, Integer> newPos =
mEmojiCategory.getCategoryIdAndPageIdFromPagePosition(position);
final int newCategoryId = newPos.first;
@ -718,6 +719,14 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
}
}
public void onPageScrolled() {
// Make sure the delayed key-down event (highlight effect and haptic feedback) will be
// canceled.
final EmojiPageKeyboardView currentKeyboardView =
mActiveKeyboardViews.get(mActivePosition);
currentKeyboardView.releaseCurrentKey();
}
@Override
public int getCount() {
return mEmojiCategory.getTotalPageCountOfAllCategories();