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

Commit ee5827d9 authored by Federico Baron's avatar Federico Baron Committed by Android (Google) Code Review
Browse files

Merge "Get rid of spring loaded mode for home gardening design" into tm-qpr-dev

parents 44e788a9 1028a726
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.launcher3;
import static android.animation.ValueAnimator.areAnimatorsEnabled;

import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
import static com.android.launcher3.config.FeatureFlags.SHOW_HOME_GARDENING;
import static com.android.launcher3.dragndrop.DraggableView.DRAGGABLE_ICON;
import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR;

@@ -552,7 +553,9 @@ public class CellLayout extends ViewGroup {
    public void setSpringLoadedProgress(float progress) {
        if (Float.compare(progress, mSpringLoadedProgress) != 0) {
            mSpringLoadedProgress = progress;
            if (!SHOW_HOME_GARDENING.get()) {
                updateBgAlpha();
            }
            setGridAlpha(progress);
        }
    }
@@ -577,9 +580,11 @@ public class CellLayout extends ViewGroup {
    public void setScrollProgress(float progress) {
        if (Float.compare(Math.abs(progress), mScrollProgress) != 0) {
            mScrollProgress = Math.abs(progress);
            if (!SHOW_HOME_GARDENING.get()) {
                updateBgAlpha();
            }
        }
    }

    private void setGridAlpha(float gridAlpha) {
        if (Float.compare(gridAlpha, mGridAlpha) != 0) {
@@ -616,7 +621,7 @@ public class CellLayout extends ViewGroup {
            }
        }

        if (mVisualizeDropLocation) {
        if (mVisualizeDropLocation && !SHOW_HOME_GARDENING.get()) {
            for (int i = 0; i < mDragOutlines.length; i++) {
                final float alpha = mDragOutlineAlphas[i];
                if (alpha <= 0) continue;
+0 −1
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.WallpaperOffsetInterpolator;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.widget.LauncherAppWidgetHost;
import com.android.launcher3.widget.LauncherAppWidgetHost.ProviderChangedListener;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
+13 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.launcher3.states;

import static com.android.launcher3.config.FeatureFlags.SHOW_HOME_GARDENING;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;

import android.content.Context;
@@ -44,6 +45,11 @@ public class SpringLoadedState extends LauncherState {

    @Override
    public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {

        if (SHOW_HOME_GARDENING.get()) {
            return super.getWorkspaceScaleAndTranslation(launcher);
        }

        DeviceProfile grid = launcher.getDeviceProfile();
        Workspace<?> ws = launcher.getWorkspace();
        if (ws.getChildCount() == 0) {
@@ -62,6 +68,9 @@ public class SpringLoadedState extends LauncherState {

    @Override
    protected float getDepthUnchecked(Context context) {
        if (SHOW_HOME_GARDENING.get()) {
            return 0;
        }
        return 0.5f;
    }

@@ -72,6 +81,10 @@ public class SpringLoadedState extends LauncherState {

    @Override
    public float getWorkspaceBackgroundAlpha(Launcher launcher) {
        if (SHOW_HOME_GARDENING.get()) {
            return 0;
        }

        return 0.2f;
    }
}