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

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

Snap for 6544675 from 614c185e to rvc-release

Change-Id: Ia641d331113b1ec54f4700dd70dfc228e8671871
parents 3622273a 614c185e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.DoubleShadowBubbleTextView;

/**
@@ -68,7 +69,6 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
    private int mPlateColor;
    boolean mDrawForDrag = false;


    public PredictedAppIcon(Context context) {
        this(context, null, 0);
    }
@@ -79,10 +79,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements

    public PredictedAppIcon(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mDeviceProfile = Launcher.getLauncher(context).getDeviceProfile();
        mDeviceProfile = ActivityContext.lookupContext(context).getDeviceProfile();
        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);
@@ -241,6 +239,8 @@ public class PredictedAppIcon extends DoubleShadowBubbleTextView implements
        PredictedAppIcon icon = (PredictedAppIcon) LayoutInflater.from(parent.getContext())
                .inflate(R.layout.predicted_app_icon, parent, false);
        icon.applyFromWorkspaceItem(info);
        icon.setOnClickListener(ItemClickHandler.INSTANCE);
        icon.setOnFocusChangeListener(Launcher.getLauncher(parent.getContext()).getFocusHandler());
        return icon;
    }

+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.launcher3.uioverrides;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.android.launcher3.R;
import com.android.launcher3.model.data.WorkspaceItemInfo;

/** A util class that inflates a predicted app icon */
public class PredictedAppIconInflater {
    public static View inflate(LayoutInflater inflater, ViewGroup parent, WorkspaceItemInfo info) {
        PredictedAppIcon icon = (PredictedAppIcon) inflater.inflate(
                R.layout.predicted_app_icon, parent, false);
        icon.applyFromWorkspaceItem(info);
        return icon;
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_BUTTONS;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD;
import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
@@ -242,6 +243,8 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        ADJACENT_PAGE_OFFSET.set(mRecentsView, 1f);
        mRecentsView.setContentAlpha(1);
        mRecentsView.setFullscreenProgress(fromState.getOverviewFullscreenProgress());
        mLauncher.getActionsView().getVisibilityAlpha().setValue(
                (fromState.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1f : 0f);

        float[] scaleAndOffset = toState.getOverviewScaleAndOffset(mLauncher);
        // As we drag right, animate the following properties:
+14 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewGroup;

import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -42,6 +43,7 @@ import com.android.launcher3.Workspace;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.SpringAnimationBuilder;
import com.android.launcher3.graphics.OverviewScrim;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.DynamicResource;
import com.android.quickstep.views.RecentsView;
@@ -128,6 +130,8 @@ public class StaggeredWorkspaceAnim {
            addScrimAnimationForState(launcher, NORMAL, ALPHA_DURATION_MS);
        }

        addDepthAnimationForState(launcher, NORMAL, ALPHA_DURATION_MS);

        mAnimators.play(launcher.getDragLayer().getScrim().createSysuiMultiplierAnim(0f, 1f)
                .setDuration(ALPHA_DURATION_MS));
        mAnimators.addListener(new AnimatorListenerAdapter() {
@@ -221,4 +225,14 @@ public class StaggeredWorkspaceAnim {
                ACCEL_DEACCEL);
        mAnimators.play(builder.buildAnim());
    }

    private void addDepthAnimationForState(Launcher launcher, LauncherState state, long duration) {
        if (!(launcher instanceof BaseQuickstepLauncher)) {
            return;
        }
        PendingAnimation builder = new PendingAnimation(duration);
        DepthController depthController = ((BaseQuickstepLauncher) launcher).getDepthController();
        depthController.setStateWithAnimation(state, new StateAnimationConfig(), builder);
        mAnimators.play(builder.buildAnim());
    }
}
+8 −5
Original line number Diff line number Diff line
@@ -53,8 +53,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
            HIDDEN_NON_ZERO_ROTATION,
            HIDDEN_NO_TASKS,
            HIDDEN_GESTURE_RUNNING,
            HIDDEN_NO_RECENTS,
            HIDDEN_FULLESCREEN_PROGRESS})
            HIDDEN_NO_RECENTS})
    @Retention(RetentionPolicy.SOURCE)
    public @interface ActionsHiddenFlags { }

@@ -64,11 +63,11 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
    public static final int HIDDEN_NO_TASKS = 1 << 3;
    public static final int HIDDEN_GESTURE_RUNNING = 1 << 4;
    public static final int HIDDEN_NO_RECENTS = 1 << 5;
    public static final int HIDDEN_FULLESCREEN_PROGRESS = 1 << 6;

    private static final int INDEX_CONTENT_ALPHA = 0;
    private static final int INDEX_VISIBILITY_ALPHA = 1;
    private static final int INDEX_HIDDEN_FLAGS_ALPHA = 2;
    private static final int INDEX_FULLSCREEN_ALPHA = 2;
    private static final int INDEX_HIDDEN_FLAGS_ALPHA = 3;

    private final MultiValueAlpha mMultiValueAlpha;

@@ -87,7 +86,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo

    public OverviewActionsView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr, 0);
        mMultiValueAlpha = new MultiValueAlpha(this, 3);
        mMultiValueAlpha = new MultiValueAlpha(this, 4);
    }

    @Override
@@ -151,6 +150,10 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
        return mMultiValueAlpha.getProperty(INDEX_VISIBILITY_ALPHA);
    }

    public AlphaProperty getFullscreenAlpha() {
        return mMultiValueAlpha.getProperty(INDEX_FULLSCREEN_ALPHA);
    }

    /** Updates vertical margins for different navigation mode. */
    public void updateVerticalMarginForNavModeChange(Mode mode) {
        int bottomMargin = 0;
Loading