From 38d429f4395b3bac933ad8a77ab224659f9bb2e5 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 3 Jun 2016 11:46:56 -0700 Subject: Handled expandability and swiping while guts are exposed Also fixed a bug where the wrong guts were selected with groups. Change-Id: I3677ce549b2a90e2dc225470cff4e2548ddca81a Fixes: 29046865 --- .../systemui/statusbar/stack/NotificationStackScrollLayout.java | 4 +++- .../com/android/systemui/statusbar/stack/StackScrollAlgorithm.java | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 4c242ccf691c..f67e285a1b5b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -868,7 +868,8 @@ public class NotificationStackScrollLayout extends ViewGroup ExpandableNotificationRow row = (ExpandableNotificationRow) child; ExpandableNotificationRow parent = row.getNotificationParent(); if (parent != null && parent.areChildrenExpanded() - && (mGearExposedView == parent + && (parent.areGutsExposed() + || mGearExposedView == parent || (parent.getNotificationChildren().size() == 1 && parent.isClearable()))) { // In this case the group is expanded and showing the gear for the @@ -956,6 +957,7 @@ public class NotificationStackScrollLayout extends ViewGroup public boolean canChildBeExpanded(View v) { return v instanceof ExpandableNotificationRow && ((ExpandableNotificationRow) v).isExpandable() + && !((ExpandableNotificationRow) v).areGutsExposed() && (mIsExpanded || !((ExpandableNotificationRow) v).isPinned()); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java index 5d2698898e30..c8c7d3d4c7cb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java @@ -171,6 +171,12 @@ public class StackScrollAlgorithm { } public static boolean canChildBeDismissed(View v) { + if (v instanceof ExpandableNotificationRow) { + ExpandableNotificationRow row = (ExpandableNotificationRow) v; + if (row.areGutsExposed()) { + return false; + } + } final View veto = v.findViewById(R.id.veto); return (veto != null && veto.getVisibility() != View.GONE); } -- cgit v1.2.3-59-g8ed1b From 90b6a276bf9da4c91891fdb452fe5cda0ec716e2 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 3 Jun 2016 16:50:52 -0700 Subject: Fixed a flicker when closing QS without notifications Change-Id: I0ca13626a676d0adf427d95edd76dd1bd2228fdc Fixes: 28008271 --- .../systemui/statusbar/stack/NotificationStackScrollLayout.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index f67e285a1b5b..6fd129147390 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2084,7 +2084,9 @@ public class NotificationStackScrollLayout extends ViewGroup final ExpandableView firstChild = getFirstChildNotGone(); int firstChildMinHeight = firstChild != null ? firstChild.getIntrinsicHeight() - : mCollapsedSize; + : mEmptyShadeView != null + ? mEmptyShadeView.getMinHeight() + : mCollapsedSize; if (mOwnScrollY > 0) { firstChildMinHeight = Math.max(firstChildMinHeight - mOwnScrollY, mCollapsedSize); } -- cgit v1.2.3-59-g8ed1b