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

Commit c128131a authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Merging ub-launcher3-qt-r1-dev, build 5782058

Test: Manual

Bug:132455160 P1 [Gesture Nav] Home to Overview Transition Improvement
Bug:133472746 P1 "Now playing History" widget can't be added to desired area.
Bug:135558924 P4 Pixel Launcher app crash after applying custom Style
Bug:136282913 P1 Swipe up from Assistant Fulfillment Card Jank
Bug:136591785 P2 Tune swipe up to home animation
Bug:138117089 P1 Random misses in GL comp on Pixel 3a/XL
Bug:138609751 P2 Trying to start an app before it was downloaded caused pixel launcher crash
Bug:138620399 P1 Quick switch flicker / artifacts
Bug:138646754 P4 Switching from 3-button to gesture nav - all apps disappeared
Bug:138793362 P4 With animation disabled, Launcher crashing on docking apps in split screen from overview screen.
Change-Id: I4f3b286ae79566fd53072df621be98646d0457d7
parents 8822dc00 0a9e91b6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.animation.Interpolator;

import androidx.annotation.ColorInt;
import androidx.core.content.ContextCompat;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
@@ -41,9 +44,6 @@ import com.android.launcher3.allapps.FloatingHeaderView;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.util.Themes;

import androidx.annotation.ColorInt;
import androidx.core.content.ContextCompat;

/**
 * A view which shows a horizontal divider
 */
@@ -288,10 +288,10 @@ public class AppsDividerView extends View implements LauncherStateManager.StateL
    }

    @Override
    public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent,
            PropertySetter setter, Interpolator fadeInterpolator) {
    public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent,
            PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) {
        // Don't use setViewAlpha as we want to control the visibility ourselves.
        setter.setFloat(this, ALPHA, hasContent ? 1 : 0, fadeInterpolator);
        setter.setFloat(this, ALPHA, hasAllAppsContent ? 1 : 0, allAppsFade);
    }

    @Override
+28 −21
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ import android.view.View;
import android.view.animation.Interpolator;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.launcher3.AppInfo;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeviceProfile;
@@ -62,9 +65,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

@TargetApi(Build.VERSION_CODES.P)
public class PredictionRowView extends LinearLayout implements
        LogContainerProvider, OnDeviceProfileChangeListener, FloatingHeaderRow {
@@ -80,7 +80,7 @@ public class PredictionRowView extends LinearLayout implements

                @Override
                public Integer get(PredictionRowView view) {
                    return view.mIconCurrentTextAlpha;
                    return view.mIconLastSetTextAlpha;
                }
            };

@@ -103,6 +103,8 @@ public class PredictionRowView extends LinearLayout implements

    private final int mIconTextColor;
    private final int mIconFullTextAlpha;
    private int mIconLastSetTextAlpha;
    // Might use mIconFullTextAlpha instead of mIconLastSetTextAlpha if we are translucent.
    private int mIconCurrentTextAlpha;

    private FloatingHeaderView mParent;
@@ -315,14 +317,27 @@ public class PredictionRowView extends LinearLayout implements
        }
    }

    public void setTextAlpha(int alpha) {
        mIconCurrentTextAlpha = alpha;
    public void setTextAlpha(int textAlpha) {
        mIconLastSetTextAlpha = textAlpha;
        if (getAlpha() < 1 && textAlpha > 0) {
            // If the entire header is translucent, make sure the text is at full opacity so it's
            // not double-translucent. However, we support keeping the text invisible (alpha == 0).
            textAlpha = mIconFullTextAlpha;
        }
        mIconCurrentTextAlpha = textAlpha;
        int iconColor = setColorAlphaBound(mIconTextColor, mIconCurrentTextAlpha);
        for (int i = 0; i < getChildCount(); i++) {
            ((BubbleTextView) getChildAt(i)).setTextColor(iconColor);
        }
    }

    @Override
    public void setAlpha(float alpha) {
        super.setAlpha(alpha);
        // Reapply text alpha so that we update it to be full alpha if the row is now translucent.
        setTextAlpha(mIconLastSetTextAlpha);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
@@ -351,23 +366,15 @@ public class PredictionRowView extends LinearLayout implements
    }

    @Override
    public void setContentVisibility(boolean hasHeaderExtra, boolean hasContent,
            PropertySetter setter, Interpolator fadeInterpolator) {
        boolean isDrawn = getAlpha() > 0;
        int textAlpha = hasHeaderExtra
                ? (hasContent ? mIconFullTextAlpha : 0) // Text follows the content visibility
                : mIconCurrentTextAlpha; // Leave as before
        if (!isDrawn) {
            // If the header is not drawn, no need to animate the text alpha
            setTextAlpha(textAlpha);
        } else {
            setter.setInt(this, TEXT_ALPHA, textAlpha, fadeInterpolator);
        }

    public void setContentVisibility(boolean hasHeaderExtra, boolean hasAllAppsContent,
            PropertySetter setter, Interpolator headerFade, Interpolator allAppsFade) {
        // Text follows all apps visibility
        int textAlpha = hasHeaderExtra && hasAllAppsContent ? mIconFullTextAlpha : 0;
        setter.setInt(this, TEXT_ALPHA, textAlpha, allAppsFade);
        setter.setFloat(mOverviewScrollFactor, AnimatedFloat.VALUE,
                (hasHeaderExtra && !hasContent) ? 1 : 0, LINEAR);
                (hasHeaderExtra && !hasAllAppsContent) ? 1 : 0, LINEAR);
        setter.setFloat(mContentAlphaFactor, AnimatedFloat.VALUE, hasHeaderExtra ? 1 : 0,
                fadeInterpolator);
                headerFade);
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -15,7 +15,9 @@
 */
package com.android.launcher3.uioverrides.states;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCRIM_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.INSTANT;
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_7;

@@ -43,6 +45,7 @@ public class OverviewPeekState extends OverviewState {
        if (this == OVERVIEW_PEEK && fromState == NORMAL) {
            builder.setInterpolator(ANIM_OVERVIEW_FADE, INSTANT);
            builder.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, OVERSHOOT_1_7);
            builder.setInterpolator(ANIM_OVERVIEW_SCRIM_FADE, FAST_OUT_SLOW_IN);
        }
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ import com.android.launcher3.R;
import com.android.launcher3.Workspace;
import com.android.launcher3.allapps.DiscoveryBounce;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.uioverrides.UiFactory;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.quickstep.SysUINavigationMode;
@@ -128,14 +127,15 @@ public class OverviewState extends LauncherState {
        if (launcher.getDeviceProfile().isVerticalBarLayout()) {
            return VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON;
        } else {
            boolean hasAllAppsHeaderExtra = launcher.getAppsView() != null
                    && launcher.getAppsView().getFloatingHeaderView().hasVisibleContent();
            return HOTSEAT_SEARCH_BOX | VERTICAL_SWIPE_INDICATOR | RECENTS_CLEAR_ALL_BUTTON |
                    (launcher.getAppsView().getFloatingHeaderView().hasVisibleContent()
                            ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS);
                    (hasAllAppsHeaderExtra ? ALL_APPS_HEADER_EXTRA : HOTSEAT_ICONS);
        }
    }

    @Override
    public float getWorkspaceScrimAlpha(Launcher launcher) {
    public float getOverviewScrimAlpha(Launcher launcher) {
        return 0.5f;
    }

+15 −0
Original line number Diff line number Diff line
@@ -23,13 +23,17 @@ import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_PEEK;
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_PEEK_COMPONENT;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_HEADER_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_SCALE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_HOTSEAT_TRANSLATE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_VERTICAL_PROGRESS;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL_3;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;

@@ -43,6 +47,7 @@ import android.view.ViewConfiguration;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.util.MotionPauseDetector;
@@ -102,6 +107,9 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController {
                mPeekAnim.start();
                recentsView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
                        HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);

                mLauncher.getDragLayer().getScrim().animateToSysuiMultiplier(isPaused ? 0 : 1,
                        peekDuration, 0);
            });
        }
    }
@@ -120,6 +128,13 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController {
            LauncherState toState) {
        if (fromState == NORMAL && toState == ALL_APPS) {
            AnimatorSetBuilder builder = new AnimatorSetBuilder();
            // Fade in prediction icons quickly, then rest of all apps after reaching overview.
            float progressToReachOverview = NORMAL.getVerticalProgress(mLauncher)
                    - OVERVIEW.getVerticalProgress(mLauncher);
            builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress(ACCEL,
                    0, ALL_APPS_CONTENT_FADE_THRESHOLD));
            builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(LINEAR,
                    progressToReachOverview, 1));

            // Get workspace out of the way quickly, to prepare for potential pause.
            builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3);
Loading