am a5cdd6f4: Merge "Fix unnecessary touch event handling"

* commit 'a5cdd6f4c521acf84d8491757e2cc9181ad836e5':
  Fix unnecessary touch event handling
main
Tadashi G. Takaoka 2014-10-02 07:54:31 +00:00 committed by Android Git Automerger
commit 0747228f15
1 changed files with 6 additions and 0 deletions

View File

@ -400,6 +400,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
if (mStripVisibilityGroup.isShowingImportantNoticeStrip()) { if (mStripVisibilityGroup.isShowingImportantNoticeStrip()) {
return false; return false;
} }
// Detecting sliding up finger to show {@link MoreSuggestionsView}.
if (!mMoreSuggestionsView.isShowingInParent()) { if (!mMoreSuggestionsView.isShowingInParent()) {
mLastX = (int)me.getX(); mLastX = (int)me.getX();
mLastY = (int)me.getY(); mLastY = (int)me.getY();
@ -439,6 +440,11 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
@Override @Override
public boolean onTouchEvent(final MotionEvent me) { public boolean onTouchEvent(final MotionEvent me) {
if (!mMoreSuggestionsView.isShowingInParent()) {
// Ignore any touch event while more suggestions panel hasn't been shown.
// Detecting sliding up is done at {@link #onInterceptTouchEvent}.
return true;
}
// In the sliding input mode. {@link MotionEvent} should be forwarded to // In the sliding input mode. {@link MotionEvent} should be forwarded to
// {@link MoreSuggestionsView}. // {@link MoreSuggestionsView}.
final int index = me.getActionIndex(); final int index = me.getActionIndex();