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

Commit 89a0e097 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6424828 from df280add to rvc-release

Change-Id: I4280a5624072ae37945b51e716c276a365ee32f7
parents 37152b8a df280add
Loading
Loading
Loading
Loading
+17 −9
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">

    <com.android.quickstep.views.LauncherRecentsView
    xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/overview_panel"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:accessibilityPaneTitle="@string/accessibility_recent_apps"
@@ -22,3 +24,9 @@
        android:clipToPadding="false"
        android:theme="@style/HomeScreenElementTheme"
        android:visibility="invisible" />

    <include
        android:id="@+id/overview_actions_view"
        layout="@layout/overview_actions_container" />

</merge>
+5 −7
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_TRA
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
import static com.android.quickstep.TaskViewUtils.findTaskViewToLaunch;
import static com.android.quickstep.TaskViewUtils.getRecentsWindowAnimator;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -37,7 +38,6 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.FloatProperty;
import android.view.View;

import androidx.annotation.NonNull;
@@ -49,7 +49,6 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.SpringAnimationBuilder;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.quickstep.util.AppWindowAnimationHelper;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
@@ -199,11 +198,10 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti
                return ObjectAnimator.ofFloat(mLauncher.getOverviewPanel(),
                        RecentsView.CONTENT_ALPHA, values);
            case INDEX_RECENTS_TRANSLATE_X_ANIM:
                PagedOrientationHandler orientationHandler =
                    ((RecentsView)mLauncher.getOverviewPanel()).getPagedViewOrientedState()
                        .getOrientationHandler();
                FloatProperty<View> translate = orientationHandler.getPrimaryViewTranslate();
                return new SpringAnimationBuilder<>(mLauncher.getOverviewPanel(), translate)
                // TODO: Do not assume motion across X axis for adjacent page
                return new SpringAnimationBuilder<>(
                        mLauncher.getOverviewPanel(), ADJACENT_PAGE_OFFSET)
                        .setMinimumVisibleChange(1f / mLauncher.getOverviewPanel().getWidth())
                        .setDampingRatio(0.8f)
                        .setStiffness(250)
                        .setValues(values)
+38 −11
Original line number Diff line number Diff line
@@ -19,11 +19,13 @@ import static com.android.launcher3.accessibility.LauncherAccessibilityDelegate.
import static com.android.launcher3.graphics.IconShape.getShape;

import android.content.Context;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.os.Process;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
@@ -39,6 +41,7 @@ import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.graphics.IconPalette;
import com.android.launcher3.hybridhotseat.HotseatPredictionController;
import com.android.launcher3.icons.IconNormalizer;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.touch.ItemClickHandler;
@@ -51,13 +54,18 @@ import com.android.launcher3.views.DoubleShadowBubbleTextView;
public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
        LauncherAccessibilityDelegate.AccessibilityActionHandler {

    private static final int RING_SHADOW_COLOR = 0x99000000;
    private static final float RING_EFFECT_RATIO = 0.11f;

    boolean mIsDrawingDot = false;
    private final DeviceProfile mDeviceProfile;
    private final Paint mIconRingPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    private final Path mRingPath = new Path();
    private boolean mIsPinned = false;
    private int mNormalizedIconRadius;
    private final int mNormalizedIconRadius;
    private final BlurMaskFilter mShadowFilter;
    private int mPlateColor;


    public PredictedAppIcon(Context context) {
        this(context, null, 0);
@@ -73,13 +81,18 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
        mNormalizedIconRadius = IconNormalizer.getNormalizedCircleSize(getIconSize()) / 2;
        setOnClickListener(ItemClickHandler.INSTANCE);
        setOnFocusChangeListener(Launcher.getLauncher(context).getFocusHandler());
        int shadowSize = context.getResources().getDimensionPixelSize(
                R.dimen.blur_size_thin_outline);
        mShadowFilter = new BlurMaskFilter(shadowSize, BlurMaskFilter.Blur.OUTER);
    }

    @Override
    public void onDraw(Canvas canvas) {
        int count = canvas.save();
        if (!mIsPinned) {
            drawEffect(canvas);
            boolean isBadged = getTag() instanceof WorkspaceItemInfo
                    && !Process.myUserHandle().equals(((ItemInfo) getTag()).user);
            drawEffect(canvas, isBadged);
            canvas.translate(getWidth() * RING_EFFECT_RATIO, getHeight() * RING_EFFECT_RATIO);
            canvas.scale(1 - 2 * RING_EFFECT_RATIO, 1 - 2 * RING_EFFECT_RATIO);
        }
@@ -102,7 +115,7 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
    public void applyFromWorkspaceItem(WorkspaceItemInfo info) {
        super.applyFromWorkspaceItem(info);
        int color = IconPalette.getMutedColor(info.bitmap.color, 0.54f);
        mIconRingPaint.setColor(ColorUtils.setAlphaComponent(color, 200));
        mPlateColor = ColorUtils.setAlphaComponent(color, 200);
        if (mIsPinned) {
            setContentDescription(info.contentDescription);
        } else {
@@ -174,9 +187,25 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
        return getPaddingTop() + mDeviceProfile.folderIconOffsetYPx;
    }

    private void drawEffect(Canvas canvas) {
        getShape().drawShape(canvas, getOutlineOffsetX(), getOutlineOffsetY(),
                mNormalizedIconRadius, mIconRingPaint);
    private void drawEffect(Canvas canvas, boolean isBadged) {
        mRingPath.reset();
        getShape().addToPath(mRingPath, getOutlineOffsetX(), getOutlineOffsetY(),
                mNormalizedIconRadius);
        if (isBadged) {
            float outlineSize = mNormalizedIconRadius * RING_EFFECT_RATIO * 2;
            float iconSize = getIconSize() * (1 - 2 * RING_EFFECT_RATIO);
            float badgeSize = LauncherIcons.getBadgeSizeForIconSize((int) iconSize) + outlineSize;
            float badgeInset = mNormalizedIconRadius * 2 - badgeSize;
            getShape().addToPath(mRingPath, getOutlineOffsetX() + badgeInset,
                    getOutlineOffsetY() + badgeInset, badgeSize / 2);

        }
        mIconRingPaint.setColor(RING_SHADOW_COLOR);
        mIconRingPaint.setMaskFilter(mShadowFilter);
        canvas.drawPath(mRingPath, mIconRingPaint);
        mIconRingPaint.setColor(mPlateColor);
        mIconRingPaint.setMaskFilter(null);
        canvas.drawPath(mRingPath, mIconRingPaint);
    }

    /**
@@ -205,10 +234,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
            mOffsetX = icon.getOutlineOffsetX();
            mOffsetY = icon.getOutlineOffsetY();
            mIconRadius = icon.mNormalizedIconRadius;
            mOutlinePaint.setStyle(Paint.Style.STROKE);
            mOutlinePaint.setStrokeWidth(5);
            mOutlinePaint.setPathEffect(new DashPathEffect(new float[]{15, 15}, 0));
            mOutlinePaint.setColor(Color.argb(100, 245, 245, 245));
            mOutlinePaint.setStyle(Paint.Style.FILL);
            mOutlinePaint.setColor(Color.argb(24, 245, 245, 245));
        }

        /**
+6 −15
Original line number Diff line number Diff line
@@ -15,19 +15,14 @@
 */
package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherState.OVERVIEW_BUTTONS;
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;

import android.annotation.TargetApi;
import android.os.Build;
import android.util.FloatProperty;
import android.view.View;
import android.view.animation.Interpolator;

import androidx.annotation.NonNull;

@@ -37,6 +32,7 @@ import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.quickstep.views.ClearAllButton;
import com.android.quickstep.views.LauncherRecentsView;
import com.android.quickstep.views.RecentsView;
@@ -60,7 +56,7 @@ public final class RecentsViewStateController extends
            mRecentsView.updateEmptyMessage();
            mRecentsView.resetTaskVisuals();
        }
        setAlphas(PropertySetter.NO_ANIM_PROPERTY_SETTER, state, LINEAR);
        setAlphas(PropertySetter.NO_ANIM_PROPERTY_SETTER, state);
        mRecentsView.setFullscreenProgress(state.getOverviewFullscreenProgress());
    }

@@ -78,22 +74,17 @@ public final class RecentsViewStateController extends
                    AnimationSuccessListener.forRunnable(mRecentsView::resetTaskVisuals));
        }

        setAlphas(builder, toState,
                config.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
        setAlphas(builder, toState);
        builder.setFloat(mRecentsView, FULLSCREEN_PROGRESS,
                toState.getOverviewFullscreenProgress(), LINEAR);
    }

    private void setAlphas(PropertySetter propertySetter, LauncherState state,
            Interpolator actionInterpolator) {
    private void setAlphas(PropertySetter propertySetter, LauncherState state) {
        float buttonAlpha = (state.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1 : 0;
        propertySetter.setFloat(mRecentsView.getClearAllButton(), ClearAllButton.VISIBILITY_ALPHA,
                buttonAlpha, LINEAR);

        View actionsView = mLauncher.getActionsView();
        if (actionsView != null) {
            propertySetter.setFloat(actionsView, VIEW_ALPHA, buttonAlpha, actionInterpolator);
        }
        propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(),
                MultiValueAlpha.VALUE, buttonAlpha, LINEAR);
    }

    @Override
+10 −7
Original line number Diff line number Diff line
@@ -61,13 +61,16 @@ public class BackgroundAppState extends OverviewState {
    }

    @Override
    public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) {
    public float[] getOverviewScaleAndOffset(Launcher launcher) {
        return new float[] {getOverviewScale(launcher), NO_OFFSET};
    }

    private float getOverviewScale(Launcher launcher) {
        // Initialize the recents view scale to what it would be when starting swipe up
        RecentsView recentsView = launcher.getOverviewPanel();
        int taskCount = recentsView.getTaskViewCount();
        if (taskCount == 0) {
            return super.getOverviewScaleAndTranslation(launcher);
        }
        if (taskCount == 0) return 1;

        TaskView dummyTask;
        if (recentsView.getCurrentPage() >= recentsView.getTaskViewStartIndex()) {
            if (recentsView.getCurrentPage() <= taskCount - 1) {
@@ -78,8 +81,8 @@ public class BackgroundAppState extends OverviewState {
        } else {
            dummyTask = recentsView.getTaskViewAt(0);
        }
        return recentsView.getTempAppWindowAnimationHelper().updateForFullscreenOverview(dummyTask)
                .getScaleAndTranslation();
        return recentsView.getTempAppWindowAnimationHelper()
                .updateForFullscreenOverview(dummyTask).getSrcToTargetScale();
    }

    @Override
@@ -106,7 +109,7 @@ public class BackgroundAppState extends OverviewState {
    }

    @Override
    public float getDepth(Context context) {
    protected float getDepthUnchecked(Context context) {
        return 1f;
    }
}
Loading