Loading packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +15 −9 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityManager; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; Loading Loading @@ -173,12 +172,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private int mOverrideTint; private float mOverrideAmount; private boolean mShadowHidden; private boolean mWasActivatedOnDown; /** * Similar to mDimmed but is also true if it's not dimmable but should be */ private boolean mNeedsDimming; private int mDimmedAlpha; private boolean mBlockNextTouch; public ActivatableNotificationView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -204,7 +203,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } else { makeInactive(true /* animate */); } }, this::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap); }, super::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap); } @Override Loading Loading @@ -241,10 +240,16 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (mNeedsDimming && !mActivated && ev.getActionMasked() == MotionEvent.ACTION_DOWN if (mNeedsDimming && ev.getActionMasked() == MotionEvent.ACTION_DOWN && disallowSingleClick(ev) && !isTouchExplorationEnabled()) { if (!mActivated) { return true; } else if (!mDoubleTapHelper.isWithinDoubleTapSlop(ev)) { mBlockNextTouch = true; makeInactive(true /* animate */); return true; } } return super.onInterceptTouchEvent(ev); } Loading @@ -263,10 +268,11 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean onTouchEvent(MotionEvent event) { boolean result; if (event.getAction() == MotionEvent.ACTION_DOWN) { mWasActivatedOnDown = mActivated; if (mBlockNextTouch) { mBlockNextTouch = false; return false; } if ((mNeedsDimming && !mActivated) && !isTouchExplorationEnabled() && isInteractive()) { if (mNeedsDimming && !isTouchExplorationEnabled() && isInteractive()) { boolean wasActivated = mActivated; result = handleTouchEventDimmed(event); if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) { Loading Loading @@ -312,7 +318,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean performClick() { if (mWasActivatedOnDown || !mNeedsDimming || isTouchExplorationEnabled()) { if (!mNeedsDimming || isTouchExplorationEnabled()) { return super.performClick(); } return false; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class DoubleTapHelper { && Math.abs(event.getY() - mDownY) < mTouchSlop; } private boolean isWithinDoubleTapSlop(MotionEvent event) { public boolean isWithinDoubleTapSlop(MotionEvent event) { if (!mActivated) { // If we're not activated there's no double tap slop to satisfy. return true; Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +15 −9 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewAnimationUtils; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityManager; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; Loading Loading @@ -173,12 +172,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private int mOverrideTint; private float mOverrideAmount; private boolean mShadowHidden; private boolean mWasActivatedOnDown; /** * Similar to mDimmed but is also true if it's not dimmable but should be */ private boolean mNeedsDimming; private int mDimmedAlpha; private boolean mBlockNextTouch; public ActivatableNotificationView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -204,7 +203,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView } else { makeInactive(true /* animate */); } }, this::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap); }, super::performClick, this::handleSlideBack, mFalsingManager::onNotificationDoubleTap); } @Override Loading Loading @@ -241,10 +240,16 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (mNeedsDimming && !mActivated && ev.getActionMasked() == MotionEvent.ACTION_DOWN if (mNeedsDimming && ev.getActionMasked() == MotionEvent.ACTION_DOWN && disallowSingleClick(ev) && !isTouchExplorationEnabled()) { if (!mActivated) { return true; } else if (!mDoubleTapHelper.isWithinDoubleTapSlop(ev)) { mBlockNextTouch = true; makeInactive(true /* animate */); return true; } } return super.onInterceptTouchEvent(ev); } Loading @@ -263,10 +268,11 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean onTouchEvent(MotionEvent event) { boolean result; if (event.getAction() == MotionEvent.ACTION_DOWN) { mWasActivatedOnDown = mActivated; if (mBlockNextTouch) { mBlockNextTouch = false; return false; } if ((mNeedsDimming && !mActivated) && !isTouchExplorationEnabled() && isInteractive()) { if (mNeedsDimming && !isTouchExplorationEnabled() && isInteractive()) { boolean wasActivated = mActivated; result = handleTouchEventDimmed(event); if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) { Loading Loading @@ -312,7 +318,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override public boolean performClick() { if (mWasActivatedOnDown || !mNeedsDimming || isTouchExplorationEnabled()) { if (!mNeedsDimming || isTouchExplorationEnabled()) { return super.performClick(); } return false; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/DoubleTapHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class DoubleTapHelper { && Math.abs(event.getY() - mDownY) < mTouchSlop; } private boolean isWithinDoubleTapSlop(MotionEvent event) { public boolean isWithinDoubleTapSlop(MotionEvent event) { if (!mActivated) { // If we're not activated there's no double tap slop to satisfy. return true; Loading