diff options
| author | 2016-04-25 19:06:16 +0000 | |
|---|---|---|
| committer | 2016-04-25 19:06:17 +0000 | |
| commit | 904a39ca92f7e616d400a8733b3970b8828da072 (patch) | |
| tree | 032aa0eea79395b543cf9d7a170791968eca4baf | |
| parent | 5a3e4411582b1cae9b9002026b467c9c08e69a55 (diff) | |
| parent | 86889c2d21f4e6c26c7e07a477a9e5c398d5d059 (diff) | |
Merge "Fix gear being covered on notification update" into nyc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 12 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 9a6fa9c6bae6..5c50b5ce47d9 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -493,7 +493,15 @@ public class SwipeHelper implements Gefingerpoken { updateSwipeProgressFromOffset(view, canAnimViewBeDismissed); } - public void snapChildIfNeeded(final View view, boolean animate) { + /** + * Called when a view is updated to be non-dismissable, if the view was being dismissed before + * the update this will handle snapping it back into place. + * + * @param view the view to snap if necessary. + * @param animate whether to animate the snap or not. + * @param targetLeft the target to snap to. + */ + public void snapChildIfNeeded(final View view, boolean animate, float targetLeft) { if ((mDragging && mCurrView == view) || mSnappingChild) { return; } @@ -507,7 +515,7 @@ public class SwipeHelper implements Gefingerpoken { } if (needToSnap) { if (animate) { - snapChild(view, 0 /* targetLeft */, 0.0f /* velocity */); + snapChild(view, targetLeft, 0.0f /* velocity */); } else { snapChildInstantly(view); } 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 d3578b9e2426..3e0f930f60f2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -990,9 +990,11 @@ public class NotificationStackScrollLayout extends ViewGroup true /* isDismissAll */); } - public void snapViewIfNeeded(View child) { + public void snapViewIfNeeded(ExpandableNotificationRow child) { boolean animate = mIsExpanded || isPinnedHeadsUp(child); - mSwipeHelper.snapChildIfNeeded(child, animate); + // If the child is showing the gear to go to settings, snap to that + float targetLeft = child.getSettingsRow().isVisible() ? child.getTranslation() : 0; + mSwipeHelper.snapChildIfNeeded(child, animate, targetLeft); } @Override |