Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcba959a authored by Mady Mellor's avatar Mady Mellor
Browse files

Make it easier to reveal gear on non-clearable notifications

I had a multiplier for this to make it easier, but it wasn't enabled.

This CL enables it and also fixes a bug I noticed where this doesn't
account for the distance moved being on the appropriate side for displaying
gear.

Change-Id: I7a516a425a556d7f5aa0627de5c64bb9211ac81e
parent 43cd4b70
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3624,16 +3624,18 @@ public class NotificationStackScrollLayout extends ViewGroup
            if (mTranslatingParentView == null) {
                return false;
            }
            final float snapBackThreshold = getSpaceForGear(animView);
            // If the notification can't be dismissed then how far it can move is
            // restricted -- reduce the distance it needs to move in this case.
            final float multiplier = canChildBeDismissed(animView) ? 0.4f : 0.2f;
            final float snapBackThreshold = getSpaceForGear(animView) * multiplier;
            final float translation = getTranslation(animView);
            final boolean fromLeft = translation > 0;
            final float absTrans = Math.abs(translation);
            final float notiThreshold = getSize(mTranslatingParentView) * 0.4f;

            // If the notification can't be dismissed then how far it can move is
            // restricted -- reduce the distance it needs to move in this case.
            final float multiplier = canChildBeDismissed(animView) ? 0.4f : 0.2f;
            return absTrans >= snapBackThreshold * 0.4f && absTrans <= notiThreshold;
            return mCurrIconRow.isVisible() && (mCurrIconRow.isIconOnLeft()
                    ? (translation > snapBackThreshold && translation <= notiThreshold)
                    : (translation < -snapBackThreshold && translation >= -notiThreshold));
        }

        @Override