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

Commit a3808a8e authored by Andy Wickham's avatar Andy Wickham Committed by Android (Google) Code Review
Browse files

Merge "Revert "Switch ScrimView to use view alpha"" into udc-qpr-dev

parents 10d035e7 88dd86bd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.launcher3.uioverrides.touchcontrollers;

import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_MOVE;

import static com.android.app.animation.Interpolators.ACCELERATE_0_75;
import static com.android.app.animation.Interpolators.DECELERATE_3;
@@ -261,7 +262,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        xAnim.setFloat(mRecentsView, ADJACENT_PAGE_HORIZONTAL_OFFSET, scaleAndOffset[1], LINEAR);
        // Use QuickSwitchState instead of OverviewState to determine scrim color,
        // since we need to take potential taskbar into account.
        xAnim.setScrimViewBackgroundColor(mLauncher.getScrimView(),
        xAnim.setViewBackgroundColor(mLauncher.getScrimView(),
                QUICK_SWITCH_FROM_HOME.getWorkspaceScrimColor(mLauncher), LINEAR);
        if (mRecentsView.getTaskViewCount() == 0) {
            xAnim.addFloat(mRecentsView, CONTENT_ALPHA, 0f, 1f, LINEAR);
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
        setter.setFloat(mRecentsView, TASK_THUMBNAIL_SPLASH_ALPHA,
                state.showTaskThumbnailSplash() ? 1f : 0f, INSTANT);

        setter.setScrimViewBackgroundColor(mActivity.getScrimView(), state.getScrimColor(mActivity),
        setter.setViewBackgroundColor(mActivity.getScrimView(), state.getScrimColor(mActivity),
                config.getInterpolator(ANIM_SCRIM_FADE, LINEAR));

        RecentsState currentState = mActivity.getStateManager().getState();
+0 −5
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.widget.ImageView;
import android.widget.TextView;

import com.android.launcher3.util.MultiScalePropertyFactory;
import com.android.launcher3.views.ScrimView;

public class LauncherAnimUtils {
    /**
@@ -195,10 +194,6 @@ public class LauncherAnimUtils {

                @Override
                public Integer get(View view) {
                    if (view instanceof ScrimView) {
                        return ((ScrimView) view).getBackgroundColor();
                    }

                    if (!(view.getBackground() instanceof ColorDrawable)) {
                        return Color.TRANSPARENT;
                    }
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class WorkspaceStateTransitionAnimation {
        propertySetter.setFloat(sysUiScrim.getSysUIProgress(), AnimatedFloat.VALUE,
                state.hasFlag(FLAG_HAS_SYS_UI_SCRIM) ? 1 : 0, LINEAR);

        propertySetter.setScrimViewBackgroundColor(mLauncher.getScrimView(),
        propertySetter.setViewBackgroundColor(mLauncher.getScrimView(),
                state.getWorkspaceScrimColor(mLauncher),
                config.getInterpolator(ANIM_SCRIM_FADE, ACCELERATE_2));
    }
+4 −5
Original line number Diff line number Diff line
@@ -24,14 +24,13 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.graphics.drawable.ColorDrawable;
import android.util.FloatProperty;
import android.util.IntProperty;
import android.view.View;

import androidx.annotation.NonNull;

import com.android.launcher3.views.ScrimView;

import java.util.function.Consumer;

/**
@@ -63,9 +62,9 @@ public class AnimatedPropertySetter extends PropertySetter {
    }

    @Override
    public Animator setScrimViewBackgroundColor(ScrimView view, int color,
            TimeInterpolator interpolator) {
        if (view == null || view.getBackgroundColor() == color) {
    public Animator setViewBackgroundColor(View view, int color, TimeInterpolator interpolator) {
        if (view == null || (view.getBackground() instanceof ColorDrawable
                && ((ColorDrawable) view.getBackground()).getColor() == color)) {
            return NO_OP;
        }
        ObjectAnimator anim = ObjectAnimator.ofArgb(view, VIEW_BACKGROUND_COLOR, color);
Loading