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

Commit 68f83b92 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Expand 10% app when dragging content to it

* Whether the drag fails or succeeds the current
90% app will remain open

Test: Drag back and forth between 10% app sides
Flag: EXEMPT bugfix
Fixes: 391428947
Change-Id: Id9c44a92c2eddc937e44a8c82c983bda646e8388
parent f8f213e1
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.Context;
import android.content.res.Configuration;
import android.graphics.PixelFormat;
import android.os.Binder;
import android.view.DragEvent;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.SurfaceControl;
@@ -67,7 +68,15 @@ public class OffscreenTouchZone {
                    return true;
                }
            };

    private final View.OnDragListener mDragListener = new View.OnDragListener() {
        @Override
        public boolean onDrag(View view, DragEvent dragEvent) {
            if (dragEvent.getAction() == DragEvent.ACTION_DRAG_ENTERED) {
                mOnClickRunnable.run();
            }
            return false;
        }
    };
    /**
     * @param isTopLeft Whether the desired touch zone will be on the top/left or the bottom/right
     *                  screen edge.
@@ -100,6 +109,7 @@ public class OffscreenTouchZone {
        lp.setTitle(TAG);
        lp.privateFlags |= PRIVATE_FLAG_NO_MOVE_ANIMATION | PRIVATE_FLAG_TRUSTED_OVERLAY;
        touchableView.setLayoutParams(lp);
        touchableView.setOnDragListener(mDragListener);

        // Create a new leash under our stage leash.
        final SurfaceControl.Builder builder = new SurfaceControl.Builder()