Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +16 −2 Original line number Diff line number Diff line Loading @@ -604,8 +604,14 @@ public class SwipeHelper implements Gefingerpoken { if (absDelta >= size) { delta = delta > 0 ? maxScrollDistance : -maxScrollDistance; } else { delta = maxScrollDistance * (float) Math.sin( (delta / size) * (Math.PI / 2)); int startPosition = mCallback.getConstrainSwipeStartPosition(); if (absDelta > startPosition) { int signedStartPosition = (int) (startPosition * Math.signum(delta)); delta = signedStartPosition + maxScrollDistance * (float) Math.sin( ((delta - signedStartPosition) / size) * (Math.PI / 2)); } } } Loading Loading @@ -741,6 +747,14 @@ public class SwipeHelper implements Gefingerpoken { */ float getFalsingThresholdFactor(); /** * @return The position, in pixels, at which a constrained swipe should start being * constrained. */ default int getConstrainSwipeStartPosition() { return 0; } /** * @return If true, the given view is draggable. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +9 −0 Original line number Diff line number Diff line Loading @@ -5817,6 +5817,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; } @Override public int getConstrainSwipeStartPosition() { NotificationMenuRowPlugin menuRow = mSwipeHelper.getCurrentMenuRow(); if (menuRow != null) { return Math.abs(menuRow.getMenuSnapTarget()); } return 0; } @Override public boolean canChildBeDismissed(View v) { return NotificationStackScrollLayout.this.canChildBeDismissed(v); Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +16 −2 Original line number Diff line number Diff line Loading @@ -604,8 +604,14 @@ public class SwipeHelper implements Gefingerpoken { if (absDelta >= size) { delta = delta > 0 ? maxScrollDistance : -maxScrollDistance; } else { delta = maxScrollDistance * (float) Math.sin( (delta / size) * (Math.PI / 2)); int startPosition = mCallback.getConstrainSwipeStartPosition(); if (absDelta > startPosition) { int signedStartPosition = (int) (startPosition * Math.signum(delta)); delta = signedStartPosition + maxScrollDistance * (float) Math.sin( ((delta - signedStartPosition) / size) * (Math.PI / 2)); } } } Loading Loading @@ -741,6 +747,14 @@ public class SwipeHelper implements Gefingerpoken { */ float getFalsingThresholdFactor(); /** * @return The position, in pixels, at which a constrained swipe should start being * constrained. */ default int getConstrainSwipeStartPosition() { return 0; } /** * @return If true, the given view is draggable. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +9 −0 Original line number Diff line number Diff line Loading @@ -5817,6 +5817,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd return mStatusBar.isWakeUpComingFromTouch() ? 1.5f : 1.0f; } @Override public int getConstrainSwipeStartPosition() { NotificationMenuRowPlugin menuRow = mSwipeHelper.getCurrentMenuRow(); if (menuRow != null) { return Math.abs(menuRow.getMenuSnapTarget()); } return 0; } @Override public boolean canChildBeDismissed(View v) { return NotificationStackScrollLayout.this.canChildBeDismissed(v); Loading