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

Commit 38f4ab17 authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge changes from topic "remove-ws-card" into ub-launcher3-master

* changes:
  Remove workspace card
  Cleanup code relating to recents carousel
  Flatten recents (remove curve effect)
parents 446aa8c1 404e6255
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -24,8 +24,4 @@
    android:alpha="0.0"
    android:visibility="invisible" >

    <com.android.launcher3.uioverrides.WorkspaceCard
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</com.android.quickstep.RecentsView>
 No newline at end of file
+0 −2
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@
    <dimen name="quickstep_fling_threshold_velocity">500dp</dimen>
    <dimen name="quickstep_fling_min_velocity">250dp</dimen>

    <dimen name="workspace_overview_offset_x">-24dp</dimen>

    <!-- Launcher app transition -->
    <dimen name="content_trans_y">25dp</dimen>
    <dimen name="workspace_trans_y">80dp</dimen>
+3 −3
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
        boolean launchingCenterTask = launchedTaskIndex == centerTaskIndex;
        boolean isRtl = recentsView.isRtl();
        if (launchingCenterTask) {
            if (launchedTaskIndex - 1 >= recentsView.getFirstTaskIndex()) {
            if (launchedTaskIndex - 1 >= 0) {
                TaskView adjacentPage1 = (TaskView) recentsView.getPageAt(launchedTaskIndex - 1);
                ObjectAnimator adjacentTask1ScaleAndTranslate =
                        LauncherAnimUtils.ofPropertyValuesHolder(adjacentPage1,
@@ -317,7 +317,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
                                        .build());
                launcherAnimator.play(adjacentTask2ScaleAndTranslate);
            }
        } else if (centerTaskIndex >= recentsView.getFirstTaskIndex()) {
        } else {
            // We are launching an adjacent task, so parallax the center and other adjacent task.
            TaskView centerTask = (TaskView) recentsView.getPageAt(centerTaskIndex);
            float translationX = Math.abs(v.getTranslationX());
@@ -329,7 +329,7 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
                                    .build());
            launcherAnimator.play(centerTaskParallaxToRight);
            int otherAdjacentTaskIndex = centerTaskIndex + (centerTaskIndex - launchedTaskIndex);
            if (otherAdjacentTaskIndex >= recentsView.getFirstTaskIndex()
            if (otherAdjacentTaskIndex >= 0
                    && otherAdjacentTaskIndex < recentsView.getPageCount()) {
                TaskView otherAdjacentTask = (TaskView) recentsView.getPageAt(
                        otherAdjacentTaskIndex);
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import com.android.launcher3.Launcher;
public class FastOverviewState extends OverviewState {

    private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_DISABLE_RESTORE
            | FLAG_PAGE_BACKGROUNDS | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI;
            | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI;

    private static final boolean DEBUG_DIFFERENT_UI = false;

+9 −30
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherAnimUtils.OVERVIEW_TRANSITION_MS;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.states.RotationHelper.REQUEST_ROTATE;

import android.graphics.Rect;
@@ -24,7 +24,6 @@ import android.view.View;

import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.RecentsView;
@@ -35,7 +34,7 @@ import com.android.quickstep.RecentsView;
public class OverviewState extends LauncherState {

    private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_WORKSPACE_ICONS_CAN_BE_DRAGGED
            | FLAG_DISABLE_RESTORE | FLAG_PAGE_BACKGROUNDS | FLAG_OVERVIEW_UI;
            | FLAG_DISABLE_RESTORE | FLAG_OVERVIEW_UI;

    public OverviewState(int id) {
        this(id, STATE_FLAGS);
@@ -48,18 +47,13 @@ public class OverviewState extends LauncherState {
    @Override
    public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
        Rect pageRect = new Rect();
        RecentsView.getScaledDownPageRect(launcher.getDeviceProfile(), launcher, pageRect);
        RecentsView rv = launcher.getOverviewPanel();
        RecentsView.getPageRect(launcher.getDeviceProfile(), launcher, pageRect);

        if (launcher.getWorkspace().getNormalChildWidth() <= 0 || pageRect.isEmpty()) {
            return super.getWorkspaceScaleAndTranslation(launcher);
        }

        float overlap = 0;
        if (rv.getCurrentPage() >= rv.getFirstTaskIndex()) {
            overlap = launcher.getResources().getDimension(R.dimen.workspace_overview_offset_x);
        }
        return getScaleAndTranslationForPageRect(launcher, overlap, pageRect);
        return getScaleAndTranslationForPageRect(launcher, pageRect);
    }

    @Override
@@ -85,40 +79,25 @@ public class OverviewState extends LauncherState {
    }

    public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
        final int centerPage = launcher.getWorkspace().getNextPage();
        return new PageAlphaProvider(ACCEL_2) {
        return new PageAlphaProvider(DEACCEL_2) {
            @Override
            public float getPageAlpha(int pageIndex) {
                return  pageIndex != centerPage ? 0 : 1f;
                return 0;
            }
        };
    }

    public static float[] getScaleAndTranslationForPageRect(Launcher launcher, float offsetX,
            Rect pageRect) {
    public static float[] getScaleAndTranslationForPageRect(Launcher launcher, Rect pageRect) {
        Workspace ws = launcher.getWorkspace();
        float childWidth = ws.getNormalChildWidth();
        float childHeight = ws.getNormalChildHeight();

        float scale = pageRect.height() / childHeight;
        float scale = pageRect.width() / childWidth;
        Rect insets = launcher.getDragLayer().getInsets();

        float halfHeight = ws.getExpectedHeight() / 2;
        float childTop = halfHeight - scale * (halfHeight - ws.getPaddingTop() - insets.top);
        float translationY = pageRect.top - childTop;

        // Align the workspace horizontally centered with the task rect
        float halfWidth = ws.getExpectedWidth() / 2;
        float childCenter = halfWidth -
                scale * (halfWidth - ws.getPaddingLeft() - insets.left - childWidth / 2);
        float translationX = pageRect.centerX() - childCenter;

        if (launcher.<RecentsView>getOverviewPanel().isRtl()) {
            translationX -= offsetX / scale;
        } else {
            translationX += offsetX / scale;
        }

        return new float[] {scale, translationX, translationY};
        return new float[] {scale, 0, translationY};
    }
}
Loading