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

Commit 23afcae8 authored by Winson's avatar Winson
Browse files

Fixing touch handling on resized tasks.

- Simplify touch handling just by keeping everything in screen space, 
  and just map to the curve proportionally to the arc length.  This
  makes the movement much closer to that of other lists, and prevents 
  the issue of touches at the top of the stack scrolling along the 
  curve faster than at other places (and when Recents is resized, this
  becomes more of an issue).
- Add basic functionality (disabled) for freeform task workspaces.


Change-Id: Ib3a8ce2caa1437cfc09eaa5b36aff310e29e35f5
parent e92440ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -230,6 +230,9 @@
    <!-- The size of the lock-to-app button icon. -->
    <dimen name="recents_lock_to_app_icon_size">28dp</dimen>

    <!-- The amount to allow the stack to overscroll. -->
    <dimen name="recents_stack_overscroll">24dp</dimen>

    <!-- Space reserved for the cards behind the top card in the top stack -->
    <dimen name="top_stack_peek_amount">12dp</dimen>

+0 −2
Original line number Diff line number Diff line
@@ -64,8 +64,6 @@ public class Constants {
        }

        public static class TaskStackView {
            public static final int TaskStackMinOverscrollRange = 32;
            public static final int TaskStackMaxOverscrollRange = 128;
            public static final int FilterStartDelay = 25;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub
        TaskStackViewLayoutAlgorithm algo = mDummyStackView.getStackAlgorithm();
        Rect taskStackBounds = new Rect(mTaskStackBounds);
        algo.setSystemInsets(systemInsets);
        algo.computeRects(windowRect.width(), windowRect.height(), taskStackBounds);
        algo.computeRects(taskStackBounds);
        Rect taskViewBounds = algo.getUntransformedTaskViewBounds();
        if (!taskViewBounds.equals(mLastTaskViewBounds)) {
            mLastTaskViewBounds.set(taskViewBounds);
+9 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ public class ParametricCurve {

    float[] xp;
    float[] px;
    float mLength;

    CurveFunction mFn;
    ParametricCurveFunction mScaleFn;
@@ -79,6 +80,7 @@ public class ParametricCurve {
            dx[xStep] = (float) Math.hypot(fx[xStep] - fx[xStep - 1], step);
            pLength += dx[xStep];
        }
        mLength = pLength;
        // Approximate p(x), a function of cumulative progress with x, normalized to 0..1
        float p = 0;
        px[0] = 0f;
@@ -260,4 +262,11 @@ public class ParametricCurve {
        }
        return 1f - xToP(maxX, bounds);
    }

    /**
     * Returns the length of this curve.
     */
    public float getArcLength() {
        return mLength;
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -170,6 +170,12 @@ public class Task {
        }
    }

    public boolean isFreeformTask() {
        // Temporarily disable:
        return false;
        // return SystemServicesProxy.isFreeformStack(key.stackId);
    }

    /** Notifies the callback listeners that this task has been loaded */
    public void notifyTaskDataLoaded(Bitmap thumbnail, Drawable applicationIcon) {
        this.applicationIcon = applicationIcon;
Loading