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

Commit bfc9dde0 authored by Tony's avatar Tony
Browse files

Replace translationYFactor with just translationY

Now that we don't have quick scrub, the only state that has a non-zero translation is all apps,
which just uses that to have a slight parallax. This is much simpler to define in terms of pixels
like other states do.

Change-Id: I108c8505d85591399256b3475f7566ff51e2c5ad
parent a761a0d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ public class OverviewState extends LauncherState {
    }

    @Override
    public float[] getOverviewScaleAndTranslationYFactor(Launcher launcher) {
    public float[] getOverviewScaleAndTranslationY(Launcher launcher) {
        return new float[] {1f, 0f};
    }

+2 −8
Original line number Diff line number Diff line
@@ -16,16 +16,15 @@
package com.android.launcher3.uioverrides;

import static com.android.quickstep.views.IconRecentsView.CONTENT_ALPHA;
import static com.android.quickstep.views.IconRecentsView.TRANSLATION_Y_FACTOR;

import android.util.FloatProperty;

import androidx.annotation.NonNull;

import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherRecentsToActivityHelper;
import com.android.quickstep.views.IconRecentsView;

import androidx.annotation.NonNull;

/**
 * State handler for Go's {@link IconRecentsView}.
 */
@@ -38,11 +37,6 @@ public final class RecentsViewStateController extends
                new LauncherRecentsToActivityHelper(launcher));
    }

    @Override
    FloatProperty<IconRecentsView> getTranslationYFactorProperty() {
        return TRANSLATION_Y_FACTOR;
    }

    @Override
    FloatProperty<IconRecentsView> getContentAlphaProperty() {
        return CONTENT_ALPHA;
+0 −24
Original line number Diff line number Diff line
@@ -46,20 +46,6 @@ import com.android.quickstep.TaskSwipeCallback;
 */
public final class IconRecentsView extends FrameLayout {

    public static final FloatProperty<IconRecentsView> TRANSLATION_Y_FACTOR =
            new FloatProperty<IconRecentsView>("translationYFactor") {

                @Override
                public void setValue(IconRecentsView view, float v) {
                    view.setTranslationYFactor(v);
                }

                @Override
                public Float get(IconRecentsView view) {
                    return view.mTranslationYFactor;
                }
            };

    public static final FloatProperty<IconRecentsView> CONTENT_ALPHA =
            new FloatProperty<IconRecentsView>("contentAlpha") {
                @Override
@@ -91,7 +77,6 @@ public final class IconRecentsView extends FrameLayout {
    private final TaskInputController mTaskInputController;

    private RecentsToActivityHelper mActivityHelper;
    private float mTranslationYFactor;
    private RecyclerView mTaskRecyclerView;
    private View mEmptyView;

@@ -170,15 +155,6 @@ public final class IconRecentsView extends FrameLayout {
        return view.getThumbnailView();
    }

    public void setTranslationYFactor(float translationFactor) {
        mTranslationYFactor = translationFactor;
        setTranslationY(computeTranslationYForFactor(mTranslationYFactor));
    }

    private float computeTranslationYForFactor(float translationYFactor) {
        return translationYFactor * (getPaddingBottom() - getPaddingTop());
    }

    /**
     * Update the content view so that the appropriate view is shown based off the current list
     * of tasks.
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ public class BackgroundAppState extends OverviewState {
    }

    @Override
    public float[] getOverviewScaleAndTranslationYFactor(Launcher launcher) {
    public float[] getOverviewScaleAndTranslationY(Launcher launcher) {
        // Initialize the recents view scale to what it would be when starting swipe up
        RecentsView recentsView = launcher.getOverviewPanel();
        recentsView.getTaskSize(sTempRect);
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class OverviewState extends LauncherState {
    }

    @Override
    public float[] getOverviewScaleAndTranslationYFactor(Launcher launcher) {
    public float[] getOverviewScaleAndTranslationY(Launcher launcher) {
        return new float[] {1f, 0f};
    }

Loading