Merge "Don't always auto-collapse an empty notification shade."
This commit is contained in:
committed by
Android (Google) Code Review
commit
7a605df313
@ -968,7 +968,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP);
|
mHandler.sendEmptyMessage(MSG_HIDE_HEADS_UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0) {
|
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0
|
||||||
|
&& !mStatusBarWindow.isPointerDown()) {
|
||||||
animateCollapsePanels();
|
animateCollapsePanels();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ public class StatusBarWindowView extends FrameLayout
|
|||||||
private NotificationRowLayout latestItems;
|
private NotificationRowLayout latestItems;
|
||||||
private NotificationPanelView mNotificationPanel;
|
private NotificationPanelView mNotificationPanel;
|
||||||
private ScrollView mScrollView;
|
private ScrollView mScrollView;
|
||||||
|
private boolean mPointerDown;
|
||||||
|
|
||||||
PhoneStatusBar mService;
|
PhoneStatusBar mService;
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ public class StatusBarWindowView extends FrameLayout
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||||
|
registerPointer(ev);
|
||||||
boolean intercept = false;
|
boolean intercept = false;
|
||||||
if (mNotificationPanel.isFullyExpanded() && mScrollView.getVisibility() == View.VISIBLE) {
|
if (mNotificationPanel.isFullyExpanded() && mScrollView.getVisibility() == View.VISIBLE) {
|
||||||
intercept = mExpandHelper.onInterceptTouchEvent(ev);
|
intercept = mExpandHelper.onInterceptTouchEvent(ev);
|
||||||
@ -131,5 +133,21 @@ public class StatusBarWindowView extends FrameLayout
|
|||||||
mExpandHelper.cancel();
|
mExpandHelper.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void registerPointer(MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
mPointerDown = true;
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
mPointerDown = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPointerDown() {
|
||||||
|
return mPointerDown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user