From 615cf6c43120e1e6fc08d2886b7099c17d0f0ae6 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 13 Oct 2021 14:12:43 -0700 Subject: [PATCH 01/10] Fix launching window bounds for immersive apps Test: Open an immersive app (e.g. fullscreen YT video), ensure it fills the screen; open a non-immersive app (e.g. Calculator), ensure it only fills up to the top of the taskbar. Fixes: 200036592 Change-Id: Id815bbc8140cbaf1e61ac587ae1f1325e7ec5b72 --- .../src/com/android/launcher3/QuickstepTransitionManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index ddb20a1a37..8a05533941 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -439,9 +439,9 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener 4 - rotationChange); } } - // TODO(b/196637509): don't do this for immersive apps. if (mDeviceProfile.isTaskbarPresentInApps) { - bounds.bottom -= mDeviceProfile.taskbarSize; + // Animate to above the taskbar. + bounds.bottom -= target.contentInsets.bottom; } return bounds; } From fa37c6742e63f1b19b8efa51309c17c07c7446cb Mon Sep 17 00:00:00 2001 From: Alina Zaidi Date: Mon, 25 Oct 2021 16:10:45 +0100 Subject: [PATCH 02/10] Make sure distinct widgets items are used when mapping widget component names to widget items. This is to prevent a crash on duplicate key when creating map. Bug: 204065759 Test: Enabled flag and got no crash Change-Id: Ice9f93af76c02eeba53c934687358ed806c60b60 --- .../android/launcher3/model/WidgetsPredictionUpdateTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java index 3d891e8748..4be83dc0b0 100644 --- a/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java +++ b/quickstep/src/com/android/launcher3/model/WidgetsPredictionUpdateTask.java @@ -83,7 +83,7 @@ public final class WidgetsPredictionUpdateTask extends BaseModelUpdateTask { } } else { Map widgetItems = - allWidgets.values().stream().flatMap(List::stream) + allWidgets.values().stream().flatMap(List::stream).distinct() .collect(Collectors.toMap(widget -> (ComponentKey) widget, widget -> widget)); for (AppTarget app : mTargets) { From 53c7ed5084399c8ae6e1f2199b45dd4b80e259d9 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 25 Oct 2021 21:03:37 +0100 Subject: [PATCH 03/10] Avoid calling getIconResult if recycle is called after request is queued Fix: 203582251 Test: atest -c NexusLauncherTests:com.android.launcher3.memory.MemoryTests Change-Id: Ice1e981e1813df516008be578aa89ee17fb79fab --- .../android/launcher3/views/FloatingIconView.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 872adec42e..8b7ad46dfb 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -70,6 +70,8 @@ public class FloatingIconView extends FrameLayout implements // Manages loading the icon on a worker thread private static @Nullable IconLoadResult sIconLoadResult; + private static long sFetchIconId = 0; + private static long sRecycledFetchIconId = sFetchIconId; public static final float SHAPE_PROGRESS_DURATION = 0.10f; private static final RectF sTmpRectF = new RectF(); @@ -519,8 +521,13 @@ public class FloatingIconView extends FrameLayout implements IconLoadResult result = new IconLoadResult(info, btvIcon == null ? false : btvIcon.isThemed()); - MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> - getIconResult(l, v, info, position, btvIcon, result)); + final long fetchIconId = sFetchIconId++; + MODEL_EXECUTOR.getHandler().postAtFrontOfQueue(() -> { + if (fetchIconId < sRecycledFetchIconId) { + return; + } + getIconResult(l, v, info, position, btvIcon, result); + }); sIconLoadResult = result; return result; @@ -622,6 +629,7 @@ public class FloatingIconView extends FrameLayout implements mOnTargetChangeRunnable = null; mBadge = null; sTmpObjArray[0] = null; + sRecycledFetchIconId = sFetchIconId; mIconLoadResult = null; mClipIconView.recycle(); mBtvDrawable.setBackground(null); From 232e9a463174bf55eb601b5b92c52b0dca63d382 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 21 Oct 2021 10:45:20 -0700 Subject: [PATCH 04/10] Hide taskbar background when notification shade is expanded - In 3 button mode, don't hide the background but do ensure nav buttons are translated down when swiping to notificaitons from the home screen Test: swipe down notifications, background hides in 0 button mode but not in 3 button mode Fixes: 199163951 Change-Id: Ic70adc7d67b2ab7c92a2d5d846b9b259d1bd7bfc --- .../taskbar/NavbarButtonsViewController.java | 26 +++++++++++++++---- .../taskbar/TaskbarActivityContext.java | 23 +++++++++++++--- .../taskbar/TaskbarDragLayerController.java | 10 ++++++- .../taskbar/TaskbarViewController.java | 10 ------- 4 files changed, 49 insertions(+), 20 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index b768d60306..69804bdd5f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -30,7 +30,9 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_B import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; import android.animation.ObjectAnimator; import android.annotation.DrawableRes; @@ -81,6 +83,7 @@ public class NavbarButtonsViewController { private static final int FLAG_DISABLE_HOME = 1 << 7; private static final int FLAG_DISABLE_RECENTS = 1 << 8; private static final int FLAG_DISABLE_BACK = 1 << 9; + private static final int FLAG_NOTIFICATION_SHADE_EXPANDED = 1 << 10; private static final int MASK_IME_SWITCHER_VISIBLE = FLAG_SWITCHER_SUPPORTED | FLAG_IME_VISIBLE; @@ -98,6 +101,8 @@ public class NavbarButtonsViewController { private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat( this::updateNavButtonTranslationY); + private final AnimatedFloat mNavButtonTranslationYMultiplier = new AnimatedFloat( + this::updateNavButtonTranslationY); // Initialized in init. private TaskbarControllers mControllers; @@ -120,6 +125,7 @@ public class NavbarButtonsViewController { mControllers = controllers; mNavButtonsView.getLayoutParams().height = mContext.getDeviceProfile().taskbarSize; parseSystemUiFlags(sharedState.sysuiStateFlags); + mNavButtonTranslationYMultiplier.value = 1; mA11yLongClickListener = view -> { mControllers.navButtonController.onButtonClick(BUTTON_A11Y_LONG_CLICK); @@ -149,6 +155,11 @@ public class NavbarButtonsViewController { .getKeyguardBgTaskbar(), flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0)); + // Make sure to remove nav bar buttons translation when notification shade is expanded. + mPropertyHolders.add(new StatePropertyHolder(mNavButtonTranslationYMultiplier, + flags -> (flags & FLAG_NOTIFICATION_SHADE_EXPANDED) != 0, AnimatedFloat.VALUE, + 0, 1)); + // Force nav buttons (specifically back button) to be visible during setup wizard. boolean isInSetup = !mContext.isUserSetupComplete(); if (isThreeButtonNav || isInSetup) { @@ -176,12 +187,12 @@ public class NavbarButtonsViewController { } } - // Animate taskbar background when IME shows + // Animate taskbar background when any of these flags are enabled + int flagsToShowBg = FLAG_IME_VISIBLE | FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE + | FLAG_NOTIFICATION_SHADE_EXPANDED; mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), - flags -> (flags & FLAG_IME_VISIBLE) != 0 || - (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0, - AnimatedFloat.VALUE, 1, 0)); + flags -> (flags & flagsToShowBg) != 0, AnimatedFloat.VALUE, 1, 0)); // Rotation button RotationButton rotationButton = new RotationButtonImpl( @@ -258,6 +269,9 @@ public class NavbarButtonsViewController { boolean isHomeDisabled = (sysUiStateFlags & SYSUI_STATE_HOME_DISABLED) != 0; boolean isRecentsDisabled = (sysUiStateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0; boolean isBackDisabled = (sysUiStateFlags & SYSUI_STATE_BACK_DISABLED) != 0; + int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED + | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; + boolean isNotificationShadeExpanded = (sysUiStateFlags & shadeExpandedFlags) != 0; // TODO(b/202218289) we're getting IME as not visible on lockscreen from system updateStateForFlag(FLAG_IME_VISIBLE, isImeVisible); @@ -266,6 +280,7 @@ public class NavbarButtonsViewController { updateStateForFlag(FLAG_DISABLE_HOME, isHomeDisabled); updateStateForFlag(FLAG_DISABLE_RECENTS, isRecentsDisabled); updateStateForFlag(FLAG_DISABLE_BACK, isBackDisabled); + updateStateForFlag(FLAG_NOTIFICATION_SHADE_EXPANDED, isNotificationShadeExpanded); if (mA11yButton != null) { // Only used in 3 button @@ -360,7 +375,8 @@ public class NavbarButtonsViewController { } private void updateNavButtonTranslationY() { - mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value); + mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value + * mNavButtonTranslationYMultiplier.value); } private ImageView addButton(@DrawableRes int drawableId, @TaskbarButton int buttonType, diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 370496aec3..8ae661fd5d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -25,6 +25,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_Q import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT; import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR; +import android.animation.AnimatorSet; import android.app.ActivityOptions; import android.content.ActivityNotFoundException; import android.content.Context; @@ -328,10 +329,9 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ mControllers.navbarButtonsViewController.updateStateForSysuiFlags(systemUiStateFlags); mControllers.taskbarViewController.setImeIsVisible( mControllers.navbarButtonsViewController.isImeVisible()); - boolean panelExpanded = (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0; - boolean inSettings = (systemUiStateFlags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) != 0; - mControllers.taskbarViewController.setNotificationShadeIsExpanded( - panelExpanded || inSettings); + int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED + | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; + onNotificationShadeExpandChanged((systemUiStateFlags & shadeExpandedFlags) != 0); mControllers.taskbarViewController.setRecentsButtonDisabled( mControllers.navbarButtonsViewController.isRecentsDisabled()); mControllers.stashedHandleViewController.setIsHomeButtonDisabled( @@ -341,6 +341,21 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ mControllers.taskbarScrimViewController.updateStateForSysuiFlags(systemUiStateFlags); } + /** + * Hides the taskbar icons and background when the notication shade is expanded. + */ + private void onNotificationShadeExpandChanged(boolean isExpanded) { + float alpha = isExpanded ? 0 : 1; + AnimatorSet anim = new AnimatorSet(); + anim.play(mControllers.taskbarViewController.getTaskbarIconAlpha().getProperty( + TaskbarViewController.ALPHA_INDEX_NOTIFICATION_EXPANDED).animateToValue(alpha)); + if (!isThreeButtonNav()) { + anim.play(mControllers.taskbarDragLayerController.getNotificationShadeBgTaskbar() + .animateToValue(alpha)); + } + anim.start(); + } + public void onRotationProposal(int rotation, boolean isValid) { mControllers.rotationButtonController.onRotationProposal(rotation, isValid); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java index 10a5b89ea8..f38e88d851 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayerController.java @@ -42,6 +42,8 @@ public class TaskbarDragLayerController { private final AnimatedFloat mBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha); private final AnimatedFloat mBgNavbar = new AnimatedFloat(this::updateBackgroundAlpha); private final AnimatedFloat mKeyguardBgTaskbar = new AnimatedFloat(this::updateBackgroundAlpha); + private final AnimatedFloat mNotificationShadeBgTaskbar = new AnimatedFloat( + this::updateBackgroundAlpha); // Used to hide our background color when someone else (e.g. ScrimView) is handling it. private final AnimatedFloat mBgOverride = new AnimatedFloat(this::updateBackgroundAlpha); @@ -63,6 +65,7 @@ public class TaskbarDragLayerController { mControllers = controllers; mTaskbarDragLayer.init(new TaskbarDragLayerCallbacks()); mKeyguardBgTaskbar.value = 1; + mNotificationShadeBgTaskbar.value = 1; mBgOverride.value = 1; } @@ -92,6 +95,10 @@ public class TaskbarDragLayerController { return mKeyguardBgTaskbar; } + public AnimatedFloat getNotificationShadeBgTaskbar() { + return mNotificationShadeBgTaskbar; + } + public AnimatedFloat getOverrideBackgroundAlpha() { return mBgOverride; } @@ -102,7 +109,8 @@ public class TaskbarDragLayerController { private void updateBackgroundAlpha() { final float bgNavbar = mBgNavbar.value; - final float bgTaskbar = mBgTaskbar.value * mKeyguardBgTaskbar.value; + final float bgTaskbar = mBgTaskbar.value * mKeyguardBgTaskbar.value + * mNotificationShadeBgTaskbar.value; mTaskbarDragLayer.setTaskbarBackgroundAlpha( mBgOverride.value * Math.max(bgNavbar, bgTaskbar) ); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index d14622b2b3..6a936ab73d 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -115,16 +115,6 @@ public class TaskbarViewController { mTaskbarView.setTouchesEnabled(!isImeVisible); } - /** - * Should be called when the notification shade is expanded, so we can hide taskbar icons as - * well. Note that we are animating icons to appear / disappear. - */ - public void setNotificationShadeIsExpanded(boolean isNotificationShadeExpanded) { - mTaskbarIconAlpha.getProperty(ALPHA_INDEX_NOTIFICATION_EXPANDED) - .animateToValue(isNotificationShadeExpanded ? 0 : 1) - .start(); - } - /** * Should be called when the recents button is disabled, so we can hide taskbar icons as well. */ From 63d1a181e5e5879fa733c79f9e1c9a3dc26d9318 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Mon, 18 Oct 2021 09:52:04 -0500 Subject: [PATCH 05/10] Fix the remove button icon not centered when the home screen is in landscape. To fix it I put the bounds of the Icon/drawable when the text is not visible. Fix: 202811811 Test: Manually Tested. Change-Id: Ieff54a73e819c4b3a61e28fd76faf93a84b67666 --- src/com/android/launcher3/ButtonDropTarget.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java index 477dcf86e9..38d5077411 100644 --- a/src/com/android/launcher3/ButtonDropTarget.java +++ b/src/com/android/launcher3/ButtonDropTarget.java @@ -108,8 +108,8 @@ public abstract class ButtonDropTarget extends TextView // We do not set the drawable in the xml as that inflates two drawables corresponding to // drawableLeft and drawableStart. mDrawable = getContext().getDrawable(resId).mutate(); - mDrawable.setBounds(0, 0, mDrawableSize, mDrawableSize); mDrawable.setTintList(getTextColors()); + centerIcon(); setCompoundDrawablesRelative(mDrawable, null, null, null); } @@ -277,7 +277,7 @@ public abstract class ButtonDropTarget extends TextView } final int top = to.top + (getMeasuredHeight() - height) / 2; - final int bottom = top + height; + final int bottom = top + height; to.set(left, top, right, bottom); @@ -289,6 +289,12 @@ public abstract class ButtonDropTarget extends TextView return to; } + private void centerIcon() { + int x = mTextVisible ? 0 + : (getWidth() - getPaddingLeft() - getPaddingRight()) / 2 - mDrawableSize / 2; + mDrawable.setBounds(x, 0, x + mDrawableSize, mDrawableSize); + } + @Override public void onClick(View v) { mLauncher.getAccessibilityDelegate().handleAccessibleDrop(this, null, null); @@ -299,12 +305,19 @@ public abstract class ButtonDropTarget extends TextView if (mTextVisible != isVisible || !TextUtils.equals(newText, getText())) { mTextVisible = isVisible; setText(newText); + centerIcon(); setCompoundDrawablesRelative(mDrawable, null, null, null); int drawablePadding = mTextVisible ? mDrawablePadding : 0; setCompoundDrawablePadding(drawablePadding); } } + @Override + protected void onSizeChanged(int w, int h, int oldw, int oldh) { + super.onSizeChanged(w, h, oldw, oldh); + centerIcon(); + } + public void setToolTipLocation(int location) { mToolTipLocation = location; hideTooltip(); From 1bda3e7424e410d773d3c5a5ad804bae55b6695d Mon Sep 17 00:00:00 2001 From: Schneider Victor-tulias Date: Mon, 25 Oct 2021 15:06:49 -0700 Subject: [PATCH 06/10] Fix overview clear all tasks button text color. Test: checked button on dark/light mode on a wallpaper similar to bug Fixes: 203198804 Change-Id: I03e663422d2cdba63f3c5953741b5c0bd722fccf --- quickstep/res/layout/fallback_recents_activity.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickstep/res/layout/fallback_recents_activity.xml b/quickstep/res/layout/fallback_recents_activity.xml index a43296f602..bfeb82d9f9 100644 --- a/quickstep/res/layout/fallback_recents_activity.xml +++ b/quickstep/res/layout/fallback_recents_activity.xml @@ -45,8 +45,7 @@ android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false" - android:outlineProvider="none" - android:theme="@style/HomeScreenElementTheme" /> + android:outlineProvider="none" /> Date: Tue, 5 Oct 2021 01:11:08 +0200 Subject: [PATCH 07/10] Set custom task transition spec when taskbar is visible This is to ensure that the task to task animations look good when the taskbar is visible (the transition background is the same as the taskbar color, the taskbar overlay rounded corners are hidden, and the task animates above the taskbar so it's rounded corners are visible during the animation and not hidden behind the taskbar). Test: Open tasks from other tasks to trigger task to task animations and see if they look good Bug: 200675009 Bug: 196387647 Change-Id: I8e46718829c0e6541a5c1b1a3a156285aeecd30a --- .../taskbar/LauncherTaskbarUIController.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index f206252b10..648a16e305 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -21,14 +21,20 @@ import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_APP; import static com.android.launcher3.taskbar.TaskbarStashController.FLAG_IN_STASHED_LAUNCHER_STATE; import static com.android.launcher3.taskbar.TaskbarStashController.TASKBAR_STASH_DURATION; import static com.android.launcher3.taskbar.TaskbarViewController.ALPHA_INDEX_HOME; +import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; +import android.annotation.ColorInt; import android.graphics.Rect; +import android.os.RemoteException; +import android.util.Log; import android.view.MotionEvent; +import android.view.TaskTransitionSpec; import android.view.View; +import android.view.WindowManagerGlobal; import androidx.annotation.NonNull; @@ -36,6 +42,7 @@ import com.android.launcher3.BaseQuickstepLauncher; import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; import com.android.launcher3.QuickstepTransitionManager; +import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimatorListeners; import com.android.launcher3.anim.PendingAnimation; @@ -56,6 +63,7 @@ import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.recents.model.ThumbnailData; import java.util.Arrays; +import java.util.Set; import java.util.function.Supplier; import java.util.stream.Stream; @@ -64,6 +72,8 @@ import java.util.stream.Stream; */ public class LauncherTaskbarUIController extends TaskbarUIController { + private static final String TAG = "TaskbarUIController"; + private final BaseQuickstepLauncher mLauncher; private final AnimatedFloat mIconAlignmentForResumedState = @@ -193,6 +203,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { mLauncher.getHotseat().setIconsAlpha(1f); mLauncher.setTaskbarUIController(null); mLauncher.removeOnDeviceProfileChangeListener(mProfileChangeListener); + updateTaskTransitionSpec(true); } @Override @@ -367,6 +378,32 @@ public class LauncherTaskbarUIController extends TaskbarUIController { private void onStashedInAppChanged(DeviceProfile deviceProfile) { boolean taskbarStashedInApps = mControllers.taskbarStashController.isStashedInApp(); deviceProfile.isTaskbarPresentInApps = !taskbarStashedInApps; + updateTaskTransitionSpec(taskbarStashedInApps); + } + + private void updateTaskTransitionSpec(boolean taskbarIsHidden) { + try { + if (taskbarIsHidden) { + // Clear custom task transition settings when the taskbar is stashed + WindowManagerGlobal.getWindowManagerService().clearTaskTransitionSpec(); + } else { + // Adjust task transition spec to account for taskbar being visible + @ColorInt int taskAnimationBackgroundColor = + mLauncher.getColor(R.color.taskbar_background); + + TaskTransitionSpec customTaskAnimationSpec = new TaskTransitionSpec( + taskAnimationBackgroundColor, + Set.of(ITYPE_EXTRA_NAVIGATION_BAR) + ); + WindowManagerGlobal.getWindowManagerService() + .setTaskTransitionSpec(customTaskAnimationSpec); + } + } catch (RemoteException e) { + // This shouldn't happen but if it does task animations won't look good until the + // taskbar stashing state is changed. + Log.e(TAG, "Failed to update task transition spec to account for new taskbar state", + e); + } } /** From 12609edb7290c0e04a97637f57461b97223292fe Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Mon, 30 Aug 2021 17:58:17 +0000 Subject: [PATCH 08/10] Revert "Temporarily disable Launcher3 tests affected by fling changes" This reverts commit bc4dc49c6c48bc716df63def3b25c476a414a757. Reason for revert: RecyclerView bug is fixed Change-Id: Ia2a677f3a3987751349bad951ff136b2d55f439f Test: presubmit Bug: 197802324 (cherry picked from commit 8b4a6ee65b49d39b0547d98bedc1fddf84f9fc36) --- .../tests/src/com/android/quickstep/TaplTestsQuickstep.java | 1 - tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java | 1 - 2 files changed, 2 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 5e29657cdd..710afe00c2 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -223,7 +223,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { } @Test - @Ignore("b/197802324") @PortraitLandscape public void testAllAppsFromHome() throws Exception { // Test opening all apps diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index ea185492c5..881f50cafb 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -250,7 +250,6 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { } @Test - @Ignore("b/197802324") @PortraitLandscape public void testWidgets() throws Exception { // Test opening widgets. From 35c5755b712a7ddeb2fca8db272ccbd27cac1f83 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Tue, 26 Oct 2021 17:48:35 +0000 Subject: [PATCH 09/10] Fix the fallback logic for shortcut icons when icons are missing The icons of shortcuts in general are not persisted in backup payload and thus are not available on the new device, apps are reposponsible for republishing those shortcuts on the new device, with the only exception being pinned shortcuts, whose icons are stored in launcher.db as a fallback when icons are not avaialble in the shortcut themselves. A previous CL unexpected excluded deep shortcuts from loading their fallback icons in launcher.db, causes pinned shortcut to fallback further to default droid icons, this CL restores the original behavior. Bug: 202346722 Test: manual Change-Id: Ie09becd3a0dc1ca1e7c2573fe1b68b61a58c2091 --- src/com/android/launcher3/model/LoaderCursor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java index 8a5a9bf327..47df53810c 100644 --- a/src/com/android/launcher3/model/LoaderCursor.java +++ b/src/com/android/launcher3/model/LoaderCursor.java @@ -190,6 +190,7 @@ public class LoaderCursor extends CursorWrapper { String resourceName = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT ? getString(iconResourceIndex) : null; byte[] iconBlob = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT + || itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT || restoreFlag != 0 ? getBlob(iconIndex) : null; From eed4bbfb4952cd1f39d17a2fc55b0310cbb6e874 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 1 Oct 2021 11:31:45 -0700 Subject: [PATCH 10/10] Using a different transition for All-set activity Bug: 201797003 Test: Manual Change-Id: I33b342ca224ab283e2ac475d4defe2eac6a87bb8 --- quickstep/res/layout/activity_allset.xml | 148 +++++++------ quickstep/res/values-night/colors.xml | 2 + quickstep/res/values-night/styles.xml | 2 +- quickstep/res/values/colors.xml | 3 + quickstep/res/values/dimens.xml | 1 + quickstep/res/values/styles.xml | 2 +- .../com/android/quickstep/InputConsumer.java | 4 +- .../quickstep/TouchInteractionService.java | 16 ++ .../ProgressDelegateInputConsumer.java | 194 ++++++++++++++++++ .../quickstep/interaction/AllSetActivity.java | 139 +++++++++++++ 10 files changed, 439 insertions(+), 72 deletions(-) create mode 100644 quickstep/src/com/android/quickstep/inputconsumers/ProgressDelegateInputConsumer.java diff --git a/quickstep/res/layout/activity_allset.xml b/quickstep/res/layout/activity_allset.xml index 4fbb8a028d..b4ee4828a6 100644 --- a/quickstep/res/layout/activity_allset.xml +++ b/quickstep/res/layout/activity_allset.xml @@ -14,81 +14,93 @@ See the License for the specific language governing permissions and limitations under the License. --> - + android:id="@+id/root_view" + android:background="@color/all_set_page_background" > - - - + android:layout_height="match_parent" + android:layout_marginStart="@dimen/allset_page_margin_horizontal" + android:layout_marginEnd="@dimen/allset_page_margin_horizontal" + android:layoutDirection="locale" + android:textDirection="locale" + android:id="@+id/content_view" + android:forceHasOverlappingRendering="false" + android:fitsSystemWindows="true" > - + - + - + - + - - + + + + + + + + \ No newline at end of file diff --git a/quickstep/res/values-night/colors.xml b/quickstep/res/values-night/colors.xml index c3b253654e..af6e0647a1 100644 --- a/quickstep/res/values-night/colors.xml +++ b/quickstep/res/values-night/colors.xml @@ -22,4 +22,6 @@ #202124 #3c4043 + #FF000000 + \ No newline at end of file diff --git a/quickstep/res/values-night/styles.xml b/quickstep/res/values-night/styles.xml index 1bd3f5d138..e6b345010d 100644 --- a/quickstep/res/values-night/styles.xml +++ b/quickstep/res/values-night/styles.xml @@ -21,7 +21,7 @@ @android:color/transparent false false - #FF000000 + @android:color/transparent \ No newline at end of file diff --git a/quickstep/res/values/colors.xml b/quickstep/res/values/colors.xml index 5edcc9d951..1bddb57b2b 100644 --- a/quickstep/res/values/colors.xml +++ b/quickstep/res/values/colors.xml @@ -72,4 +72,7 @@ #e8eaed #80868b #bdc1c6 + + #FFFFFFFF + \ No newline at end of file diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index e08eda8d3c..fa21b0a8fc 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -161,6 +161,7 @@ 32dp 24dp 348dp + 10dp 8dp diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml index b5444b5b57..40e18ec11f 100644 --- a/quickstep/res/values/styles.xml +++ b/quickstep/res/values/styles.xml @@ -115,7 +115,7 @@ @android:color/transparent false true - #FFFFFFFF + @android:color/transparent