From 969f6a8c4da659cc8b8691c1427adeb1667d9b31 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Thu, 19 May 2022 09:46:47 -0700 Subject: [PATCH 1/7] fixed scalable grid allApps to match home screen icons in largest display size fixed allApps Icon's text size to scale Test: Pictures in bug thread Bug: 232908037 Change-Id: I4b171e76c61d1fe913c23034b823f16668839f1b --- src/com/android/launcher3/DeviceProfile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 515221752a..c2e28dceaa 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -802,9 +802,9 @@ public class DeviceProfile { allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale); if (isScalableGrid) { allAppsIconSizePx = - pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); + pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics, scale); allAppsIconTextSizePx = - pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); + pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics, scale); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; } else { float invIconSizeDp = inv.allAppsIconSize[mTypeIndex]; From 813834a411506124e85a53b6edb9e018ab3aa6ae Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Wed, 18 May 2022 15:29:59 +0000 Subject: [PATCH 2/7] Convert make to bp Test: build and run atest Change-Id: I780e5a68d049b5a776f490bca3c0dfe0c861e0ea --- Android.bp | 135 ++++++++++++++++++++++++++++++++++++++++++++++++ Android.mk | 147 ----------------------------------------------------- 2 files changed, 135 insertions(+), 147 deletions(-) delete mode 100644 Android.mk diff --git a/Android.bp b/Android.bp index 0a55675d43..4adbf531bc 100644 --- a/Android.bp +++ b/Android.bp @@ -313,3 +313,138 @@ android_library { baseline_filename: "lint-baseline-launcher3.xml", }, } + +// Build rule for Launcher3 Go app for Android Go devices. +android_app { + name: "Launcher3Go", + + static_libs: ["Launcher3CommonDepsLib"], + + srcs: [ + "src/**/*.java", + "src_ui_overrides/**/*.java", + "go/src/**/*.java", + ], + + resource_dirs: ["go/res"], + + optimize: { + proguard_flags_files: ["proguard.flags"], + }, + + sdk_version: "current", + min_sdk_version: "current", + target_sdk_version: "current", + privileged: true, + system_ext_specific: true, + overrides: [ + "Home", + "Launcher2", + "Launcher3", + "Launcher3QuickStep", + ], + required: ["privapp_whitelist_com.android.launcher3"], + + additional_manifests: [ + "AndroidManifest.xml", + "AndroidManifest-common.xml", + ], + + manifest: "go/AndroidManifest.xml", + jacoco: { + include_filter: ["com.android.launcher3.*"], + } + +} + +// Build rule for Quickstep app. +android_app { + name: "Launcher3QuickStep", + + static_libs: ["Launcher3QuickStepLib"], + optimize: { + enabled: false, + }, + + platform_apis: true, + min_sdk_version: "current", + target_sdk_version: "current", + + privileged: true, + system_ext_specific: true, + overrides: [ + "Home", + "Launcher2", + "Launcher3", + ], + required: ["privapp_whitelist_com.android.launcher3"], + + resource_dirs: ["quickstep/res"], + + additional_manifests: [ + "quickstep/AndroidManifest-launcher.xml", + "AndroidManifest-common.xml", + ], + + manifest: "quickstep/AndroidManifest.xml", + jacoco: { + include_filter: ["com.android.launcher3.*"], + } + +} + +// Build rule for Launcher3 Go app with quickstep for Android Go devices. +android_app { + name: "Launcher3QuickStepGo", + + static_libs: [ + "SystemUI-statsd", + "SystemUISharedLib", + "LauncherGoResLib", + ], + + platform_apis: true, + min_sdk_version: "current", + target_sdk_version: "current", + + srcs: [ + "src/**/*.java", + "quickstep/src/**/*.java", + "go/src/**/*.java", + "go/quickstep/src/**/*.java", + ], + + resource_dirs: [ + "go/quickstep/res", + "go/res", + "quickstep/res", + ], + + optimize: { + proguard_flags_files: ["proguard.flags"], + enabled: true, + }, + + privileged: true, + system_ext_specific: true, + overrides: [ + "Home", + "Launcher2", + "Launcher3", + "Launcher3QuickStep", + ], + required: ["privapp_whitelist_com.android.launcher3"], + + additional_manifests: [ + "go/AndroidManifest.xml", + "go/AndroidManifest-launcher.xml", + "AndroidManifest-common.xml", + ], + + manifest: "quickstep/AndroidManifest.xml", + jacoco: { + include_filter: ["com.android.launcher3.*"], + } + +} + diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 1bc8b283c7..0000000000 --- a/Android.mk +++ /dev/null @@ -1,147 +0,0 @@ -# -# Copyright (C) 2013 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. -# - -LOCAL_PATH := $(call my-dir) - -# -# Build rule for Launcher3 Go app for Android Go devices. -# -include $(CLEAR_VARS) -LOCAL_USE_AAPT2 := true -LOCAL_MODULE_TAGS := optional -LOCAL_STATIC_ANDROID_LIBRARIES := Launcher3CommonDepsLib - -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) \ - $(call all-java-files-under, src_ui_overrides) \ - $(call all-java-files-under, go/src) - -LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/go/res - -LOCAL_PROGUARD_FLAG_FILES := proguard.flags - -LOCAL_SDK_VERSION := current -LOCAL_MIN_SDK_VERSION := 26 -LOCAL_PACKAGE_NAME := Launcher3Go -LOCAL_PRIVILEGED_MODULE := true -LOCAL_SYSTEM_EXT_MODULE := true -LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3 Launcher3QuickStep -LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.launcher3 - -LOCAL_FULL_LIBS_MANIFEST_FILES := \ - $(LOCAL_PATH)/AndroidManifest.xml \ - $(LOCAL_PATH)/AndroidManifest-common.xml - -LOCAL_MANIFEST_FILE := go/AndroidManifest.xml -LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_LICENSE_PACKAGE_NAME := Android Launcher3 -LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE -include $(BUILD_PACKAGE) - -# -# Build rule for Quickstep app. -# -include $(CLEAR_VARS) -LOCAL_USE_AAPT2 := true -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_ANDROID_LIBRARIES := Launcher3QuickStepLib -LOCAL_PROGUARD_ENABLED := disabled - -ifneq (,$(wildcard frameworks/base)) - LOCAL_PRIVATE_PLATFORM_APIS := true -else - LOCAL_SDK_VERSION := system_current - LOCAL_MIN_SDK_VERSION := 26 -endif -LOCAL_PACKAGE_NAME := Launcher3QuickStep -LOCAL_PRIVILEGED_MODULE := true -LOCAL_SYSTEM_EXT_MODULE := true -LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3 -LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.launcher3 - -LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/quickstep/res - -LOCAL_FULL_LIBS_MANIFEST_FILES := \ - $(LOCAL_PATH)/quickstep/AndroidManifest-launcher.xml \ - $(LOCAL_PATH)/AndroidManifest-common.xml - -LOCAL_MANIFEST_FILE := quickstep/AndroidManifest.xml -LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* - -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_LICENSE_PACKAGE_NAME := Android Launcher3 -LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE -include $(BUILD_PACKAGE) - - -# -# Build rule for Launcher3 Go app with quickstep for Android Go devices. -# -include $(CLEAR_VARS) -LOCAL_USE_AAPT2 := true -LOCAL_MODULE_TAGS := optional - -LOCAL_STATIC_JAVA_LIBRARIES := \ - SystemUI-statsd \ - SystemUISharedLib -ifneq (,$(wildcard frameworks/base)) - LOCAL_PRIVATE_PLATFORM_APIS := true -else - LOCAL_SDK_VERSION := system_current - LOCAL_MIN_SDK_VERSION := 26 -endif -LOCAL_STATIC_ANDROID_LIBRARIES := LauncherGoResLib - -LOCAL_SRC_FILES := \ - $(call all-java-files-under, src) \ - $(call all-java-files-under, quickstep/src) \ - $(call all-java-files-under, go/src) \ - $(call all-java-files-under, go/quickstep/src) - -LOCAL_RESOURCE_DIR := \ - $(LOCAL_PATH)/go/quickstep/res \ - $(LOCAL_PATH)/go/res \ - $(LOCAL_PATH)/quickstep/res - -LOCAL_PROGUARD_FLAG_FILES := proguard.flags -LOCAL_PROGUARD_ENABLED := full - -LOCAL_PACKAGE_NAME := Launcher3QuickStepGo -LOCAL_PRIVILEGED_MODULE := true -LOCAL_SYSTEM_EXT_MODULE := true -LOCAL_OVERRIDES_PACKAGES := Home Launcher2 Launcher3 Launcher3QuickStep -LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.launcher3 - -LOCAL_FULL_LIBS_MANIFEST_FILES := \ - $(LOCAL_PATH)/go/AndroidManifest.xml \ - $(LOCAL_PATH)/go/AndroidManifest-launcher.xml \ - $(LOCAL_PATH)/AndroidManifest-common.xml - -LOCAL_MANIFEST_FILE := quickstep/AndroidManifest.xml -LOCAL_JACK_COVERAGE_INCLUDE_FILTER := com.android.launcher3.* -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_LICENSE_PACKAGE_NAME := Android Launcher3 -LOCAL_NOTICE_FILE := build/soong/licenses/LICENSE -include $(BUILD_PACKAGE) - - -# ================================================== -include $(call all-makefiles-under,$(LOCAL_PATH)) From cdc111a158c089a6a8e4dd9c9e961c77b91d684d Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 24 May 2022 17:09:25 -0700 Subject: [PATCH 3/7] Creating the transaction on the UI thread This avoids the error when the transaction is created after the surface is released. In case the surface is released after transaction object is created, the apply() call simply ignores that error, whereas previously the transactionCreation will throw an error Bug: 231889963 Test: Verified by manually releasing the surface that there is no crash Change-Id: I9a4b9ca0be2ed687b2fc692570415256e3e479f7 --- .../quickstep/util/SurfaceTransactionApplier.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java b/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java index 4757d4bc7d..1200208e30 100644 --- a/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java +++ b/quickstep/src/com/android/quickstep/util/SurfaceTransactionApplier.java @@ -75,6 +75,13 @@ public class SurfaceTransactionApplier extends ReleaseCheck { if (view == null) { return; } + Transaction t = new Transaction(); + for (int i = params.length - 1; i >= 0; i--) { + SurfaceParams surfaceParams = params[i]; + if (surfaceParams.surface.isValid()) { + surfaceParams.applyTo(t); + } + } mLastSequenceNumber++; final int toApplySeqNo = mLastSequenceNumber; @@ -85,13 +92,6 @@ public class SurfaceTransactionApplier extends ReleaseCheck { .sendToTarget(); return; } - Transaction t = new Transaction(); - for (int i = params.length - 1; i >= 0; i--) { - SurfaceParams surfaceParams = params[i]; - if (surfaceParams.surface.isValid()) { - surfaceParams.applyTo(t); - } - } mTargetViewRootImpl.mergeWithNextTransaction(t, frame); Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0) .sendToTarget(); From e2e1509d55e6b51145edca13e49767a1457fe3b2 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 20 May 2022 13:32:10 +0100 Subject: [PATCH 4/7] Fix taskbar icon flicker and jump when transforming to hotseat - Apply additional translation on TaskbarView to account for difference between taskbar icon to bottom spacing compared to hotseat icon to bottom spacing - Call updateIconAlignment outside of synchronizeNextDraw's then block, which get run after the synchronization Bug: 204850744 Test: manual Change-Id: Id65842f506eb342105082649446eb694cd5c33a4 (cherry picked from commit 51da2198691ba2b60a488a05efafcb03da3f7c8e) Merged-In: Id65842f506eb342105082649446eb694cd5c33a4 --- .../TaskbarLauncherStateController.java | 12 ++---- .../taskbar/TaskbarViewController.java | 14 ++----- src/com/android/launcher3/CellLayout.java | 10 +---- src/com/android/launcher3/DeviceProfile.java | 40 ++++++++++++------- 4 files changed, 34 insertions(+), 42 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index 052c695ff4..dc0ef27ba1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -30,7 +30,6 @@ import androidx.annotation.Nullable; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseQuickstepLauncher; -import com.android.launcher3.DeviceProfile; import com.android.launcher3.LauncherState; import com.android.launcher3.Utilities; import com.android.launcher3.statemanager.StateManager; @@ -407,18 +406,13 @@ import java.util.function.Supplier; boolean firstFrameVisChanged = (taskbarWillBeVisible && Float.compare(currentValue, 1) != 0) || (!taskbarWillBeVisible && Float.compare(currentValue, 0) != 0); + updateIconAlignment(alignment); + // Sync the first frame where we swap taskbar and hotseat. if (firstFrameVisChanged && mCanSyncViews && !Utilities.IS_RUNNING_IN_TEST_HARNESS) { - DeviceProfile dp = mLauncher.getDeviceProfile(); - - // Do all the heavy work before the sync. - mControllers.taskbarViewController.createIconAlignmentControllerIfNotExists(dp); - ViewRootSync.synchronizeNextDraw(mLauncher.getHotseat(), mControllers.taskbarActivityContext.getDragLayer(), - () -> updateIconAlignment(alignment)); - } else { - updateIconAlignment(alignment); + () -> {}); } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index 3dd7932a9a..3562f5bc3c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -204,16 +204,6 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar )); } - /** - * Creates the icon alignment controller if it does not already exist. - * @param launcherDp Launcher device profile. - */ - public void createIconAlignmentControllerIfNotExists(DeviceProfile launcherDp) { - if (mIconAlignControllerLazy == null) { - mIconAlignControllerLazy = createIconAlignmentController(launcherDp); - } - } - /** * Sets the taskbar icon alignment relative to Launcher hotseat icons * @param alignmentRatio [0, 1] @@ -221,7 +211,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar * 1 => fully aligned */ public void setLauncherIconAlignment(float alignmentRatio, DeviceProfile launcherDp) { - createIconAlignmentControllerIfNotExists(launcherDp); + if (mIconAlignControllerLazy == null) { + mIconAlignControllerLazy = createIconAlignmentController(launcherDp); + } mIconAlignControllerLazy.setPlayFraction(alignmentRatio); if (alignmentRatio <= 0 || alignmentRatio >= 1) { // Cleanup lazy controller so that it is created again in next animation diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 76e945dc11..300e7bfb11 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -149,8 +149,6 @@ public class CellLayout extends ViewGroup { private boolean mVisualizeDropLocation = true; private RectF mVisualizeGridRect = new RectF(); private Paint mVisualizeGridPaint = new Paint(); - private int mGridVisualizationPaddingX; - private int mGridVisualizationPaddingY; private int mGridVisualizationRoundingRadius; private float mGridAlpha = 0f; private int mGridColor = 0; @@ -262,10 +260,6 @@ public class CellLayout extends ViewGroup { mBackground.setAlpha(0); mGridColor = Themes.getAttrColor(getContext(), R.attr.workspaceAccentColor); - mGridVisualizationPaddingX = res.getDimensionPixelSize( - R.dimen.grid_visualization_horizontal_cell_spacing); - mGridVisualizationPaddingY = res.getDimensionPixelSize( - R.dimen.grid_visualization_vertical_cell_spacing); mGridVisualizationRoundingRadius = res.getDimensionPixelSize(R.dimen.grid_visualization_rounding_radius); mReorderPreviewAnimationMagnitude = (REORDER_PREVIEW_MAGNITUDE * deviceProfile.iconSizePx); @@ -595,8 +589,8 @@ public class CellLayout extends ViewGroup { protected void visualizeGrid(Canvas canvas) { DeviceProfile dp = mActivity.getDeviceProfile(); - int paddingX = Math.min((mCellWidth - dp.iconSizePx) / 2, mGridVisualizationPaddingX); - int paddingY = Math.min((mCellHeight - dp.iconSizePx) / 2, mGridVisualizationPaddingY); + int paddingX = Math.min((mCellWidth - dp.iconSizePx) / 2, dp.gridVisualizationPaddingX); + int paddingY = Math.min((mCellHeight - dp.iconSizePx) / 2, dp.gridVisualizationPaddingY); mVisualizeGridRect.set(paddingX, paddingY, mCellWidth - paddingX, mCellHeight - paddingY); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 3ddc90e7bd..1cffa2a7f5 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -100,6 +100,8 @@ public class DeviceProfile { // Workspace public final int desiredWorkspaceHorizontalMarginOriginalPx; public int desiredWorkspaceHorizontalMarginPx; + public int gridVisualizationPaddingX; + public int gridVisualizationPaddingY; public Point cellLayoutBorderSpaceOriginalPx; public Point cellLayoutBorderSpacePx; public Rect cellLayoutPaddingPx = new Rect(); @@ -301,6 +303,10 @@ public class DeviceProfile { desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res); desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx; + gridVisualizationPaddingX = res.getDimensionPixelSize( + R.dimen.grid_visualization_horizontal_cell_spacing); + gridVisualizationPaddingY = res.getDimensionPixelSize( + R.dimen.grid_visualization_vertical_cell_spacing); bottomSheetTopPadding = mInsets.top // statusbar height + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding) @@ -1063,24 +1069,23 @@ public class DeviceProfile { mInsets.right + hotseatBarSidePaddingStartPx, paddingBottom); } } else if (isTaskbarPresent) { - boolean isRtl = Utilities.isRtl(context.getResources()); - int hotseatHeight = workspacePadding.bottom; - int taskbarOffset = getTaskbarOffsetY(); + // Center the QSB vertically with hotseat + int hotseatBottomPadding = getHotseatBottomPadding(); + int hotseatTopPadding = + workspacePadding.bottom - hotseatBottomPadding - hotseatCellHeightPx; + // Push icons to the side int additionalQsbSpace = isQsbInline ? qsbWidth + hotseatBorderSpace : 0; - - // Center the QSB vertically with hotseat - int hotseatTopPadding = hotseatHeight - taskbarOffset - hotseatCellHeightPx; - - int endOffset = ApiWrapper.getHotseatEndOffset(context); int requiredWidth = iconSizePx * numShownHotseatIcons + hotseatBorderSpace * (numShownHotseatIcons - 1) + additionalQsbSpace; - + int endOffset = ApiWrapper.getHotseatEndOffset(context); int hotseatWidth = Math.min(requiredWidth, availableWidthPx - endOffset); int sideSpacing = (availableWidthPx - hotseatWidth) / 2; - mHotseatPadding.set(sideSpacing, hotseatTopPadding, sideSpacing, taskbarOffset); + mHotseatPadding.set(sideSpacing, hotseatTopPadding, sideSpacing, hotseatBottomPadding); + + boolean isRtl = Utilities.isRtl(context.getResources()); if (isRtl) { mHotseatPadding.right += additionalQsbSpace; } else { @@ -1140,10 +1145,7 @@ public class DeviceProfile { } } - /** - * Returns the number of pixels the taskbar is translated from the bottom of the screen. - */ - public int getTaskbarOffsetY() { + private int getHotseatBottomPadding() { if (isQsbInline) { return getQsbOffsetY() - (Math.abs(hotseatQsbHeight - hotseatCellHeightPx) / 2); } else { @@ -1151,6 +1153,16 @@ public class DeviceProfile { } } + /** + * Returns the number of pixels the taskbar is translated from the bottom of the screen. + */ + public int getTaskbarOffsetY() { + int taskbarIconBottomSpace = (taskbarSize - iconSizePx) / 2; + int launcherIconBottomSpace = + Math.min((hotseatCellHeightPx - iconSizePx) / 2, gridVisualizationPaddingY); + return getHotseatBottomPadding() + launcherIconBottomSpace - taskbarIconBottomSpace; + } + /** * Returns the number of pixels required below OverviewActions excluding insets. */ From ff3721fe963af8ebc01bfe92e2c1c768f608ad31 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Wed, 25 May 2022 14:55:39 -0700 Subject: [PATCH 5/7] Allows work apps to be dragged down while work edu is showing. Also fixes jumpiness of the personal/work tabs while scrolling with this card showing. Cause: AllAppsRecyclerView#getCurrentScrollY() calculates the current scroll based on the top of the first item in the view. This is used to determine if pulling down should move the container (if you are scrolled to the top), and it is also used to align the personal/work tabs as you scroll down (they stop moving when the top item reaches their bottom). Fix: The top of the Work Edu card was lower than the top of the recycler view because it was offset by a top margin. Switching this to padding in the card's container fixes the associated calculations while keeping the visual positioning from before. Fix: 233836148 Test: Manually tried dragging down and scrolling. Tried it with and without my refactor. Change-Id: Idaf4b3801174c1dfeceda5c0f112e405908e856d --- res/layout/work_apps_edu.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/layout/work_apps_edu.xml b/res/layout/work_apps_edu.xml index f3b3053e13..c8e3f81b59 100644 --- a/res/layout/work_apps_edu.xml +++ b/res/layout/work_apps_edu.xml @@ -16,8 +16,8 @@ Date: Tue, 24 May 2022 16:30:31 -0700 Subject: [PATCH 6/7] Fix Overview screenshot bug in fake landscape Fixes an issue where the user would not be able to take a screenshot through the Overview menu when: 1) the task thumbnail was in LiveTile mode and 2) the phone was in fake landscape. The issue arose because all Overview menu items, upon selection, were forcing LiveTile to end immediately, even before running the onClick method of each menu item. In the case of screenshots, this resulted in the onClick method being unable to take a screenshot because LiveTile was already ended. This fix prevents Overview menu items from always forcing LiveTile to end, instead allowing each onClick method to determine its own order of operations and end LiveTile when appropriate. The functionality of all other current menu items (Select, Split, etc) should not be affected by this change. Fixes: 231047451 Test: Manual Change-Id: Ibfc79a114718fc4674dc434a907044184c7f5dd0 --- .../com/android/quickstep/views/TaskMenuView.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskMenuView.java b/quickstep/src/com/android/quickstep/views/TaskMenuView.java index 3803f1b426..bdf21b82cf 100644 --- a/quickstep/src/com/android/quickstep/views/TaskMenuView.java +++ b/quickstep/src/com/android/quickstep/views/TaskMenuView.java @@ -16,7 +16,6 @@ package com.android.quickstep.views; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT; import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_UNDEFINED; import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA; @@ -245,17 +244,9 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange LayoutParams lp = (LayoutParams) menuOptionView.getLayoutParams(); mTaskView.getPagedOrientationHandler().setLayoutParamsForTaskMenuOptionItem(lp, menuOptionView, mActivity.getDeviceProfile()); - menuOptionView.setOnClickListener(view -> { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - RecentsView recentsView = mTaskView.getRecentsView(); - recentsView.switchToScreenshot(null, - () -> recentsView.finishRecentsAnimation(true /* toRecents */, - false /* shouldPip */, - () -> menuOption.onClick(view))); - } else { - menuOption.onClick(view); - } - }); + // Set an onClick listener on each menu option. The onClick method is responsible for + // ending LiveTile mode on the thumbnail if needed. + menuOptionView.setOnClickListener(menuOption::onClick); mOptionLayout.addView(menuOptionView); } From 674ac7593046c4757b526d6f88edd297abe597e7 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Fri, 20 May 2022 15:17:47 -0700 Subject: [PATCH 7/7] Add ScreenRecord tag to understand in proc test failure Bug: 233075289 Test: N/A Change-Id: I22333f20f68692a352312bad034ce54def9c29ef --- tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java index c93be8bbcb..e00b5693bc 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java @@ -375,6 +375,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { @Test @PortraitLandscape + @ScreenRecord public void testDragToFolder() { // TODO: add the use case to drag an icon to an existing folder. Currently it either fails // on tablets or phones due to difference in resolution.