Fixed the touch handling when QS was open

When QS was open, the panel could not always be correctly
scrolled.

Bug: 21525300
Change-Id: If18878d08d20254d9d822d80a295163703d897aa
This commit is contained in:
Selim Cinek
2015-06-02 19:58:09 +02:00
parent 18d669dc59
commit 04fb25871d
2 changed files with 4 additions and 5 deletions

View File

@@ -638,10 +638,9 @@ public class NotificationPanelView extends PanelView implements
@Override
protected boolean isInContentBounds(float x, float y) {
float yTransformed = y - mNotificationStackScroller.getY();
float stackScrollerX = mNotificationStackScroller.getX();
return mNotificationStackScroller.isInContentBounds(yTransformed) && stackScrollerX < x
&& x < stackScrollerX + mNotificationStackScroller.getWidth();
return !mNotificationStackScroller.isBelowLastNotification(x - stackScrollerX, y)
&& stackScrollerX < x && x < stackScrollerX + mNotificationStackScroller.getWidth();
}
private void initDownStates(MotionEvent event) {

View File

@@ -2614,7 +2614,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
}
private boolean isBelowLastNotification(float touchX, float touchY) {
public boolean isBelowLastNotification(float touchX, float touchY) {
int childCount = getChildCount();
for (int i = childCount - 1; i >= 0; i--) {
ExpandableView child = (ExpandableView) getChildAt(i);
@@ -2640,7 +2640,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
}
}
return touchY > mIntrinsicPadding;
return touchY > mTopPadding + mStackTranslation;
}
private void updateExpandButtons() {