Merge "Moves snapViewIfNeeded() call to listener on NSSL."

This commit is contained in:
TreeHugger Robot
2019-01-07 17:27:37 +00:00
committed by Android (Google) Code Review
4 changed files with 14 additions and 20 deletions

View File

@@ -463,12 +463,6 @@ public class NotificationEntryManager implements
updateNotifications();
if (!notification.isClearable()) {
// The user may have performed a dismiss action on the notification, since it's
// not clearable we should snap it back.
mListContainer.snapViewIfNeeded(entry);
}
if (DEBUG) {
// Is this for you?
boolean isForCurrentUser = Dependency.get(KeyguardEnvironment.class)

View File

@@ -16,8 +16,7 @@
package com.android.systemui.statusbar.notification.stack;
import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator
.ExpandAnimationParameters;
import static com.android.systemui.statusbar.notification.ActivityLaunchAnimator.ExpandAnimationParameters;
import android.view.View;
import android.view.ViewGroup;
@@ -112,13 +111,6 @@ public interface NotificationListContainer extends ExpandableView.OnHeightChange
*/
void setMaxDisplayedNotifications(int maxNotifications);
/**
* Handle snapping a non-dismissable row back if the user tried to dismiss it.
*
* @param entry the entry whose row needs to snap back
*/
void snapViewIfNeeded(NotificationData.Entry entry);
/**
* Get the view parent for a notification entry. For example, NotificationStackScrollLayout.
*

View File

@@ -97,6 +97,7 @@ import com.android.systemui.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.statusbar.notification.FakeShadowView;
import com.android.systemui.statusbar.notification.NotificationData;
import com.android.systemui.statusbar.notification.NotificationEntryListener;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.ShadeViewRefactor;
@@ -517,6 +518,17 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
mLowPriorityBeforeSpeedBump = "1".equals(newValue);
}
}, LOW_PRIORITY);
mEntryManager.addNotificationEntryListener(new NotificationEntryListener() {
@Override
public void onEntryUpdated(NotificationData.Entry entry) {
if (!entry.notification.isClearable()) {
// The user may have performed a dismiss action on the notification, since it's
// not clearable we should snap it back.
snapViewIfNeeded(entry);
}
}
});
}
@Override
@@ -1538,9 +1550,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
true /* isDismissAll */);
}
@Override
@ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
public void snapViewIfNeeded(NotificationData.Entry entry) {
private void snapViewIfNeeded(NotificationData.Entry entry) {
ExpandableNotificationRow child = entry.getRow();
boolean animate = mIsExpanded || isPinnedHeadsUp(child);
// If the child is showing the notification menu snap to that

View File

@@ -263,9 +263,6 @@ public class NotificationViewHierarchyManagerTest extends SysuiTestCase {
@Override
public void setMaxDisplayedNotifications(int maxNotifications) {}
@Override
public void snapViewIfNeeded(Entry entry) {}
@Override
public ViewGroup getViewParentForNotification(NotificationData.Entry entry) {
return null;