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

Commit cdd98977 authored by Lars Greiss's avatar Lars Greiss Committed by Jens Doll
Browse files

Frameworks: Fix do not show snappoints if triggermask disables edge

as the title says do not show on lockscreen or notification
drawer the snappoints on the disabled edges. Pass
trigger slots and mask trough and take into account

PatchSet 2:
- some refactoring

Change-Id: I0413ffe86169c5d1cb906598d6006bbf1463770b
parent a66f8cae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -216,6 +216,8 @@ public abstract class BaseStatusBar extends SystemUI implements
                                // search light!
                                showSearchPanel();
                            } else {
                                // set the snap points depending on current trigger and mask
                                mPieContainer.setSnapPoints(mPieTriggerMask & ~mPieTriggerSlots);
                                // send the activation to the controller
                                mPieController.activateFromTrigger(v, event, tracker.position);
                                // forward a spoofed ACTION_DOWN event
+10 −8
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {
        public final Position position;
    }

    private int mTriggerSlots;
    private int mSnapPointMask = 0;
    private SnapPoint[] mSnapPoints = new SnapPoint[Position.values().length];
    private SnapPoint mActiveSnap = null;

@@ -265,15 +265,20 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {

        getDimensions();
        getColors();

        mTriggerSlots = Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.PIE_POSITIONS, Position.BOTTOM.FLAG);
    }

    public void setOnSnapListener(OnSnapListener onSnapListener) {
        mOnSnapListener = onSnapListener;
    }

    /**
     * Tells the Layout where to show snap points.
     * @param mask is a mask that corresponds to {@link Position}{@code .FLAG}.
     */
    public void setSnapPoints(int mask) {
        mSnapPointMask = mask;
    }

    private void getDimensions() {
        mPieScale = Settings.System.getFloat(mContext.getContentResolver(),
                Settings.System.PIE_SIZE, 1f);
@@ -303,13 +308,10 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {
    }

    private void setupSnapPoints(int width, int height) {
        mTriggerSlots = Settings.System.getInt(mContext.getContentResolver(),
                Settings.System.PIE_POSITIONS, Position.BOTTOM.FLAG);

        mActiveSnap = null;
        // reuse already created snap points
        for (Position g : Position.values()) {
            if ((mTriggerSlots & g.FLAG) == 0) {
            if ((mSnapPointMask & g.FLAG) != 0) {
                int x = width / 2;
                int y = height / 2;
                if (g == Position.LEFT || g == Position.RIGHT) {