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

Commit a8c2ffc1 authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Fix various animation issues when total width of grid tasks < screen width" into tm-qpr-dev

parents cd173106 359ac14d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -121,8 +121,7 @@ public final class RecentsViewStateController extends
    private void handleSplitSelectionState(@NonNull LauncherState toState,
            @NonNull PendingAnimation builder, boolean animate) {
        if (toState != OVERVIEW_SPLIT_SELECT) {
            // Not going to split, nothing to do but ensure taskviews are at correct offset
            mRecentsView.resetSplitPrimaryScrollOffset();
            // Not going to split
            return;
        }

@@ -153,8 +152,6 @@ public final class RecentsViewStateController extends
            as.start();
            as.end();
        }

        mRecentsView.applySplitPrimaryScrollOffset();
    }

    private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config,
+2 −8
Original line number Diff line number Diff line
@@ -130,15 +130,9 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
                mRecentsView.getPagedOrientationHandler().getSplitSelectTaskOffset(
                        TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION,
                        mActivity.getDeviceProfile());
        setter.setFloat(mRecentsView, taskViewsFloat.first, isSplitSelectionState(state)
                ? mRecentsView.getSplitSelectTranslation() : 0, LINEAR);
        setter.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR);
        if (isSplitSelectionState(state)) {
            mRecentsView.applySplitPrimaryScrollOffset();
            setter.setFloat(mRecentsView, taskViewsFloat.first,
                    mRecentsView.getSplitSelectTranslation(), LINEAR);
        } else {
            mRecentsView.resetSplitPrimaryScrollOffset();
            setter.setFloat(mRecentsView, taskViewsFloat.first, 0, LINEAR);
        }
    }

    /**
+0 −6
Original line number Diff line number Diff line
@@ -67,7 +67,6 @@ public class ClearAllButton extends Button {
    private float mGridTranslationPrimary;
    private float mGridScrollOffset;
    private float mScrollOffsetPrimary;
    private float mSplitSelectScrollOffsetPrimary;

    private int mSidePadding;

@@ -176,10 +175,6 @@ public class ClearAllButton extends Button {
        mScrollOffsetPrimary = scrollOffsetPrimary;
    }

    public void setSplitSelectScrollOffsetPrimary(float splitSelectScrollOffsetPrimary) {
        mSplitSelectScrollOffsetPrimary = splitSelectScrollOffsetPrimary;
    }

    public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
        float scrollAdjustment = 0;
        if (fullscreenEnabled) {
@@ -189,7 +184,6 @@ public class ClearAllButton extends Button {
            scrollAdjustment += mGridTranslationPrimary + mGridScrollOffset;
        }
        scrollAdjustment += mScrollOffsetPrimary;
        scrollAdjustment += mSplitSelectScrollOffsetPrimary;
        return scrollAdjustment;
    }

+153 −188

File changed.

Preview size limit exceeded, changes collapsed.

+3 −9
Original line number Diff line number Diff line
@@ -375,7 +375,6 @@ public class TaskView extends FrameLayout implements Reusable {
    // Used when in SplitScreenSelectState
    private float mSplitSelectTranslationY;
    private float mSplitSelectTranslationX;
    private float mSplitSelectScrollOffsetPrimary;

    @Nullable
    private ObjectAnimator mIconAndDimAnimator;
@@ -1297,10 +1296,6 @@ public class TaskView extends FrameLayout implements Reusable {
        applyTranslationY();
    }

    public void setSplitScrollOffsetPrimary(float splitSelectScrollOffsetPrimary) {
        mSplitSelectScrollOffsetPrimary = splitSelectScrollOffsetPrimary;
    }

    private void setDismissTranslationX(float x) {
        mDismissTranslationX = x;
        applyTranslationX();
@@ -1364,19 +1359,18 @@ public class TaskView extends FrameLayout implements Reusable {
        applyTranslationX();
    }

    public float getScrollAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
    public float getScrollAdjustment(boolean gridEnabled) {
        float scrollAdjustment = 0;
        if (gridEnabled) {
            scrollAdjustment += mGridTranslationX;
        } else {
            scrollAdjustment += getPrimaryNonGridTranslationProperty().get(this);
        }
        scrollAdjustment += mSplitSelectScrollOffsetPrimary;
        return scrollAdjustment;
    }

    public float getOffsetAdjustment(boolean fullscreenEnabled, boolean gridEnabled) {
        return getScrollAdjustment(fullscreenEnabled, gridEnabled);
    public float getOffsetAdjustment(boolean gridEnabled) {
        return getScrollAdjustment(gridEnabled);
    }

    public float getSizeAdjustment(boolean fullscreenEnabled) {