diff options
author | Danny Baumann <dannybaumann@web.de> | 2013-07-14 13:12:50 +0200 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2013-07-16 12:37:33 +0200 |
commit | c233a5bdf397b423c54f038935fcaf05b6d143e6 (patch) | |
tree | 4cd81205a0d067b4c8e27c38b9d8fb70f0a0cb70 /packages/SystemUI/src/com/android/systemui/SwipeHelper.java | |
parent | 6c33ad36e429b3a3ad69e53275714ca43cdc03fe (diff) | |
download | frameworks_base-c233a5bdf397b423c54f038935fcaf05b6d143e6.zip frameworks_base-c233a5bdf397b423c54f038935fcaf05b6d143e6.tar.gz frameworks_base-c233a5bdf397b423c54f038935fcaf05b6d143e6.tar.bz2 |
Improve notification shade collapse code.
- Collapse after dismissing the last notification
- Avoid duplicate code paths for collapsing
- Improve variable naming according to AOSP review suggestions
Change-Id: Ic6f26a61f263c5beebbcc9725fe8914d3858576f
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/SwipeHelper.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 7be5949..ceb8654 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -257,10 +257,6 @@ public class SwipeHelper implements Gefingerpoken { * @param velocity The desired pixels/second speed at which the view should move */ public void dismissChild(final View view, float velocity) { - dismissChild(view, velocity, false); - } - - private void dismissChild(final View view, float velocity, final boolean fromUser) { final View animView = mCallback.getChildContentView(view); final boolean canAnimViewBeDismissed = mCallback.canChildBeDismissed(view); float newPos; @@ -288,7 +284,7 @@ public class SwipeHelper implements Gefingerpoken { anim.setDuration(duration); anim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { - mCallback.onChildDismissed(view, fromUser); + mCallback.onChildDismissed(view); animView.setLayerType(View.LAYER_TYPE_NONE, null); } }); @@ -378,7 +374,7 @@ public class SwipeHelper implements Gefingerpoken { if (dismissChild) { // flingadingy - dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f, true); + dismissChild(mCurrView, childSwipedFastEnough ? velocity : 0f); } else { // snappity mCallback.onDragCancelled(mCurrView); @@ -399,7 +395,7 @@ public class SwipeHelper implements Gefingerpoken { void onBeginDrag(View v); - void onChildDismissed(View v, boolean fromUser); + void onChildDismissed(View v); void onDragCancelled(View v); } |