Loading packages/SystemUI/src/com/android/systemui/SwipeHelper.java +11 −1 Original line number Diff line number Diff line Loading @@ -412,7 +412,7 @@ public class SwipeHelper implements Gefingerpoken { if (mCurrView != null) { float delta = getPos(ev) - mInitialTouchPos; float absDelta = Math.abs(delta); if (absDelta >= mFalsingThreshold) { if (absDelta >= getFalsingThreshold()) { mTouchAboveFalsingThreshold = true; } // don't let items that can't be dismissed be dragged more than Loading Loading @@ -466,6 +466,11 @@ public class SwipeHelper implements Gefingerpoken { return true; } private int getFalsingThreshold() { float factor = mCallback.getFalsingThresholdFactor(); return (int) (mFalsingThreshold * factor); } public interface Callback { View getChildAtPosition(MotionEvent ev); Loading @@ -489,6 +494,11 @@ public class SwipeHelper implements Gefingerpoken { * @return if true, prevents the default alpha fading. */ boolean updateSwipeProgress(View animView, boolean dismissable, float swipeProgress); /** * @return The factor the falsing threshold should be multiplied with */ float getFalsingThresholdFactor(); } /** Loading packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +5 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,11 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView return false; } @Override public float getFalsingThresholdFactor() { return 1.0f; } public void dismissChild(View v) { mSwipeHelper.dismissChild(v, 0); } Loading packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class RecentsVerticalScrollView extends ScrollView return false; } @Override public float getFalsingThresholdFactor() { return 1.0f; } public void dismissChild(View v) { mSwipeHelper.dismissChild(v, 0); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +13 −4 Original line number Diff line number Diff line Loading @@ -303,8 +303,12 @@ public class KeyguardAffordanceHelper { } private boolean isBelowFalsingThreshold() { return Math.abs(mTranslation) < Math.abs(mTranslationOnDown) + mMinTranslationAmount; return Math.abs(mTranslation) < Math.abs(mTranslationOnDown) + getMinTranslationAmount(); } private int getMinTranslationAmount() { float factor = mCallback.getAffordanceFalsingFactor(); return (int) (mMinTranslationAmount * factor); } private void fling(float vel, final boolean snapBack) { Loading Loading @@ -339,14 +343,14 @@ public class KeyguardAffordanceHelper { translation = rightSwipePossible() ? translation : Math.max(0, translation); translation = leftSwipePossible() ? translation : Math.min(0, translation); float absTranslation = Math.abs(translation); if (absTranslation > Math.abs(mTranslationOnDown) + mMinTranslationAmount || if (absTranslation > Math.abs(mTranslationOnDown) + getMinTranslationAmount() || mMotionPerformedByUser) { mMotionPerformedByUser = true; } if (translation != mTranslation || isReset) { KeyguardAffordanceView targetView = translation > 0 ? mLeftIcon : mRightIcon; KeyguardAffordanceView otherView = translation > 0 ? mRightIcon : mLeftIcon; float alpha = absTranslation / mMinTranslationAmount; float alpha = absTranslation / getMinTranslationAmount(); // We interpolate the alpha of the other icons to 0 float fadeOutAlpha = SWIPE_RESTING_ALPHA_AMOUNT * (1.0f - alpha); Loading Loading @@ -482,5 +486,10 @@ public class KeyguardAffordanceHelper { View getLeftPreview(); View getRightPreview(); /** * @return The factor the minimum swipe amount should be multiplied with. */ float getAffordanceFalsingFactor(); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +11 −1 Original line number Diff line number Diff line Loading @@ -706,7 +706,7 @@ public class NotificationPanelView extends PanelView implements case MotionEvent.ACTION_MOVE: final float h = y - mInitialTouchY; setQsExpansion(h + mInitialHeightOnTouch); if (h >= mQsFalsingThreshold) { if (h >= getFalsingThreshold()) { mQsTouchAboveFalsingThreshold = true; } trackMovement(event); Loading @@ -732,6 +732,11 @@ public class NotificationPanelView extends PanelView implements } } private int getFalsingThreshold() { float factor = mStatusBar.isScreenOnComingFromTouch() ? 1.5f : 1.0f; return (int) (mQsFalsingThreshold * factor); } @Override public void onOverscrolled(float lastTouchX, float lastTouchY, int amount) { if (mIntercepting && shouldQuickSettingsIntercept(lastTouchX, lastTouchY, Loading Loading @@ -1632,6 +1637,11 @@ public class NotificationPanelView extends PanelView implements : mKeyguardBottomArea.getCameraPreview(); } @Override public float getAffordanceFalsingFactor() { return mStatusBar.isScreenOnComingFromTouch() ? 1.5f : 1.0f; } @Override protected float getPeekHeight() { if (mNotificationStackScroller.getNotGoneChildCount() > 0) { Loading Loading
packages/SystemUI/src/com/android/systemui/SwipeHelper.java +11 −1 Original line number Diff line number Diff line Loading @@ -412,7 +412,7 @@ public class SwipeHelper implements Gefingerpoken { if (mCurrView != null) { float delta = getPos(ev) - mInitialTouchPos; float absDelta = Math.abs(delta); if (absDelta >= mFalsingThreshold) { if (absDelta >= getFalsingThreshold()) { mTouchAboveFalsingThreshold = true; } // don't let items that can't be dismissed be dragged more than Loading Loading @@ -466,6 +466,11 @@ public class SwipeHelper implements Gefingerpoken { return true; } private int getFalsingThreshold() { float factor = mCallback.getFalsingThresholdFactor(); return (int) (mFalsingThreshold * factor); } public interface Callback { View getChildAtPosition(MotionEvent ev); Loading @@ -489,6 +494,11 @@ public class SwipeHelper implements Gefingerpoken { * @return if true, prevents the default alpha fading. */ boolean updateSwipeProgress(View animView, boolean dismissable, float swipeProgress); /** * @return The factor the falsing threshold should be multiplied with */ float getFalsingThresholdFactor(); } /** Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java +5 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,11 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView return false; } @Override public float getFalsingThresholdFactor() { return 1.0f; } public void dismissChild(View v) { mSwipeHelper.dismissChild(v, 0); } Loading
packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class RecentsVerticalScrollView extends ScrollView return false; } @Override public float getFalsingThresholdFactor() { return 1.0f; } public void dismissChild(View v) { mSwipeHelper.dismissChild(v, 0); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardAffordanceHelper.java +13 −4 Original line number Diff line number Diff line Loading @@ -303,8 +303,12 @@ public class KeyguardAffordanceHelper { } private boolean isBelowFalsingThreshold() { return Math.abs(mTranslation) < Math.abs(mTranslationOnDown) + mMinTranslationAmount; return Math.abs(mTranslation) < Math.abs(mTranslationOnDown) + getMinTranslationAmount(); } private int getMinTranslationAmount() { float factor = mCallback.getAffordanceFalsingFactor(); return (int) (mMinTranslationAmount * factor); } private void fling(float vel, final boolean snapBack) { Loading Loading @@ -339,14 +343,14 @@ public class KeyguardAffordanceHelper { translation = rightSwipePossible() ? translation : Math.max(0, translation); translation = leftSwipePossible() ? translation : Math.min(0, translation); float absTranslation = Math.abs(translation); if (absTranslation > Math.abs(mTranslationOnDown) + mMinTranslationAmount || if (absTranslation > Math.abs(mTranslationOnDown) + getMinTranslationAmount() || mMotionPerformedByUser) { mMotionPerformedByUser = true; } if (translation != mTranslation || isReset) { KeyguardAffordanceView targetView = translation > 0 ? mLeftIcon : mRightIcon; KeyguardAffordanceView otherView = translation > 0 ? mRightIcon : mLeftIcon; float alpha = absTranslation / mMinTranslationAmount; float alpha = absTranslation / getMinTranslationAmount(); // We interpolate the alpha of the other icons to 0 float fadeOutAlpha = SWIPE_RESTING_ALPHA_AMOUNT * (1.0f - alpha); Loading Loading @@ -482,5 +486,10 @@ public class KeyguardAffordanceHelper { View getLeftPreview(); View getRightPreview(); /** * @return The factor the minimum swipe amount should be multiplied with. */ float getAffordanceFalsingFactor(); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +11 −1 Original line number Diff line number Diff line Loading @@ -706,7 +706,7 @@ public class NotificationPanelView extends PanelView implements case MotionEvent.ACTION_MOVE: final float h = y - mInitialTouchY; setQsExpansion(h + mInitialHeightOnTouch); if (h >= mQsFalsingThreshold) { if (h >= getFalsingThreshold()) { mQsTouchAboveFalsingThreshold = true; } trackMovement(event); Loading @@ -732,6 +732,11 @@ public class NotificationPanelView extends PanelView implements } } private int getFalsingThreshold() { float factor = mStatusBar.isScreenOnComingFromTouch() ? 1.5f : 1.0f; return (int) (mQsFalsingThreshold * factor); } @Override public void onOverscrolled(float lastTouchX, float lastTouchY, int amount) { if (mIntercepting && shouldQuickSettingsIntercept(lastTouchX, lastTouchY, Loading Loading @@ -1632,6 +1637,11 @@ public class NotificationPanelView extends PanelView implements : mKeyguardBottomArea.getCameraPreview(); } @Override public float getAffordanceFalsingFactor() { return mStatusBar.isScreenOnComingFromTouch() ? 1.5f : 1.0f; } @Override protected float getPeekHeight() { if (mNotificationStackScroller.getNotGoneChildCount() > 0) { Loading