From f78da1bae3f721cbd2ffb44bd78e4301213e6f18 Mon Sep 17 00:00:00 2001 From: Shikha Malhotra Date: Mon, 11 Apr 2022 10:23:18 +0000 Subject: [PATCH] Review comments followup These are review comments followup from ag/17399997 Bug: b/218187058 Test: manually test thet Launcher3 features work correctly Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1 --- .../launcher3/QuickstepTransitionManager.java | 2 +- .../hybridhotseat/HotseatEduController.java | 4 +- .../uioverrides/QuickstepLauncher.java | 2 +- .../QuickstepAtomicAnimationFactory.java | 2 +- .../LauncherUnfoldAnimationController.java | 2 +- .../util/StaggeredWorkspaceAnim.java | 2 +- ...UnfoldMoveFromCenterWorkspaceAnimator.java | 2 +- .../quickstep/util/WorkspaceRevealAnim.java | 4 +- .../launcher3/AppWidgetResizeFrame.java | 4 +- src/com/android/launcher3/CellLayout.java | 4 +- src/com/android/launcher3/DropTargetBar.java | 2 +- src/com/android/launcher3/Hotseat.java | 4 +- src/com/android/launcher3/Launcher.java | 2 +- .../android/launcher3/LauncherAnimUtils.java | 4 +- .../WorkspaceStateTransitionAnimation.java | 8 +- .../LauncherAccessibilityDelegate.java | 130 ++++++++++-------- .../launcher3/dragndrop/DragLayer.java | 5 +- .../dragndrop/SpringLoadedDragController.java | 2 +- .../android/launcher3/folder/FolderIcon.java | 2 +- .../pageindicators/PageIndicator.java | 9 +- .../android/launcher3/popup/ArrowPopup.java | 2 +- .../launcher3/states/SpringLoadedState.java | 2 +- .../testing/TestInformationHandler.java | 4 +- .../touch/WorkspaceTouchListener.java | 4 +- .../util/WallpaperOffsetInterpolator.java | 4 +- 25 files changed, 118 insertions(+), 94 deletions(-) diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index 0e391ce6ec..36c9d13b88 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -526,7 +526,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener endListener = composeViewContentAnimator(launcherAnimator, alphas, scales); } else { List viewsToAnimate = new ArrayList<>(); - Workspace workspace = mLauncher.getWorkspace(); + Workspace workspace = mLauncher.getWorkspace(); workspace.forEachVisiblePage( view -> viewsToAnimate.add(((CellLayout) view).getShortcutsAndWidgets())); diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java index 680012ce28..d63bc18a33 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatEduController.java @@ -131,7 +131,7 @@ public class HotseatEduController { private int placeFoldersInWorkspace(ArrayDeque folders) { if (folders.isEmpty()) return 0; - Workspace workspace = mLauncher.getWorkspace(); + Workspace workspace = mLauncher.getWorkspace(); InvariantDeviceProfile idp = mLauncher.getDeviceProfile().inv; GridOccupancy[] occupancyList = new GridOccupancy[workspace.getChildCount()]; @@ -176,7 +176,7 @@ public class HotseatEduController { * @return pageId where items are migrated */ private int migrateHotseatWhole() { - Workspace workspace = mLauncher.getWorkspace(); + Workspace workspace = mLauncher.getWorkspace(); int pageId = -1; int toRow = 0; diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 829accc55b..f32b3156da 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -263,7 +263,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { switch (state.ordinal) { case HINT_STATE_ORDINAL: { - Workspace workspace = getWorkspace(); + Workspace workspace = getWorkspace(); getStateManager().goToState(NORMAL); if (workspace.getNextPage() != Workspace.DEFAULT_PAGE) { workspace.post(workspace::moveToDefaultScreen); diff --git a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java index 4d053494af..b1d83e7c31 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java +++ b/quickstep/src/com/android/launcher3/uioverrides/states/QuickstepAtomicAnimationFactory.java @@ -118,7 +118,7 @@ public class QuickstepAtomicAnimationFactory extends config.duration = Math.max(config.duration, scrollDuration); overview.snapToPage(DEFAULT_PAGE, Math.toIntExact(config.duration)); - Workspace workspace = mActivity.getWorkspace(); + Workspace workspace = mActivity.getWorkspace(); // Start from a higher workspace scale, but only if we're invisible so we don't jump. boolean isWorkspaceVisible = workspace.getVisibility() == VISIBLE; if (isWorkspaceVisible) { diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java index 6f171f91cb..97be4370b9 100644 --- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java +++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java @@ -45,7 +45,7 @@ public class LauncherUnfoldAnimationController { // Percentage of the width of the quick search bar that will be reduced // from the both sides of the bar when progress is 0 private static final float MAX_WIDTH_INSET_FRACTION = 0.15f; - private static final FloatProperty WORKSPACE_SCALE_PROPERTY = + private static final FloatProperty> WORKSPACE_SCALE_PROPERTY = WORKSPACE_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_UNFOLD_ANIMATION); private static final FloatProperty HOTSEAT_SCALE_PROPERTY = HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_UNFOLD_ANIMATION); diff --git a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java index 44396faa49..b1e2eacadd 100644 --- a/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java +++ b/quickstep/src/com/android/quickstep/util/StaggeredWorkspaceAnim.java @@ -92,7 +92,7 @@ public class StaggeredWorkspaceAnim { if (staggerWorkspace) { DeviceProfile grid = launcher.getDeviceProfile(); - Workspace workspace = launcher.getWorkspace(); + Workspace workspace = launcher.getWorkspace(); Hotseat hotseat = launcher.getHotseat(); // Hotseat and QSB takes up two additional rows. diff --git a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java index 3d72398832..354d1579b0 100644 --- a/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java +++ b/quickstep/src/com/android/quickstep/util/UnfoldMoveFromCenterWorkspaceAnimator.java @@ -37,7 +37,7 @@ public class UnfoldMoveFromCenterWorkspaceAnimator extends BaseUnfoldMoveFromCen @Override protected void onPrepareViewsForAnimation() { - Workspace workspace = mLauncher.getWorkspace(); + Workspace workspace = mLauncher.getWorkspace(); // App icons and widgets workspace diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java index 5326d2bb66..5eb543e40d 100644 --- a/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java +++ b/quickstep/src/com/android/quickstep/util/WorkspaceRevealAnim.java @@ -53,7 +53,7 @@ public class WorkspaceRevealAnim { // Should be used for animations running alongside this WorkspaceRevealAnim. public static final int DURATION_MS = 350; - private static final FloatProperty WORKSPACE_SCALE_PROPERTY = + private static final FloatProperty> WORKSPACE_SCALE_PROPERTY = WORKSPACE_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_REVEAL_ANIM); private static final FloatProperty HOTSEAT_SCALE_PROPERTY = @@ -68,7 +68,7 @@ public class WorkspaceRevealAnim { ResourceProvider rp = DynamicResource.provider(launcher); mScaleStart = rp.getFloat(R.dimen.swipe_up_scale_start); - Workspace workspace = launcher.getWorkspace(); + Workspace workspace = launcher.getWorkspace(); workspace.setPivotToScaleWithSelf(launcher.getHotseat()); // Add reveal animations. diff --git a/src/com/android/launcher3/AppWidgetResizeFrame.java b/src/com/android/launcher3/AppWidgetResizeFrame.java index 300f22bd96..4b4a017c9d 100644 --- a/src/com/android/launcher3/AppWidgetResizeFrame.java +++ b/src/com/android/launcher3/AppWidgetResizeFrame.java @@ -383,7 +383,7 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O // Handle invalid resize across CellLayouts in the two panel UI. if (mCellLayout.getParent() instanceof Workspace) { - Workspace workspace = (Workspace) mCellLayout.getParent(); + Workspace workspace = (Workspace) mCellLayout.getParent(); CellLayout pairedCellLayout = workspace.getScreenPair(mCellLayout); if (pairedCellLayout != null) { Rect focusedCellLayoutBound = sTmpRect; @@ -570,7 +570,7 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O final DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams(); final CellLayout pairedCellLayout; if (mCellLayout.getParent() instanceof Workspace) { - Workspace workspace = (Workspace) mCellLayout.getParent(); + Workspace workspace = (Workspace) mCellLayout.getParent(); pairedCellLayout = workspace.getScreenPair(mCellLayout); } else { pairedCellLayout = null; diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index f7133c49dd..87bbac6cd4 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -1203,7 +1203,7 @@ public class CellLayout extends ViewGroup { return getContext().getString(R.string.move_to_hotseat_position, Math.max(cellX, cellY) + 1); } else { - Workspace workspace = getWorkspace(); + Workspace workspace = getWorkspace(); int row = cellY + 1; int col = workspace.mIsRtl ? mCountX - cellX : cellX + 1; int panelCount = workspace.getPanelCount(); @@ -1217,7 +1217,7 @@ public class CellLayout extends ViewGroup { } } - private Workspace getWorkspace() { + private Workspace getWorkspace() { return Launcher.cast(mActivity).getWorkspace(); } diff --git a/src/com/android/launcher3/DropTargetBar.java b/src/com/android/launcher3/DropTargetBar.java index b94cdbf226..9ae695d26e 100644 --- a/src/com/android/launcher3/DropTargetBar.java +++ b/src/com/android/launcher3/DropTargetBar.java @@ -179,7 +179,7 @@ public class DropTargetBar extends FrameLayout } Launcher launcher = Launcher.getLauncher(getContext()); - Workspace workspace = launcher.getWorkspace(); + Workspace workspace = launcher.getWorkspace(); DeviceProfile dp = launcher.getDeviceProfile(); int buttonHorizontalPadding = dp.dropTargetHorizontalPaddingPx; int buttonVerticalPadding = dp.dropTargetVerticalPaddingPx; diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 9c749aa790..d1d6c18dec 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -41,7 +41,7 @@ public class Hotseat extends CellLayout implements Insettable { @ViewDebug.ExportedProperty(category = "launcher") private boolean mHasVerticalHotseat; - private Workspace mWorkspace; + private Workspace mWorkspace; private boolean mSendTouchToWorkspace; @Nullable private Consumer mOnVisibilityAggregatedCallback; @@ -122,7 +122,7 @@ public class Hotseat extends CellLayout implements Insettable { InsettableFrameLayout.dispatchInsets(this, insets); } - public void setWorkspace(Workspace w) { + public void setWorkspace(Workspace w) { mWorkspace = w; } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 3cc8a81084..923e6144f7 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2360,7 +2360,7 @@ public class Launcher extends StatefulActivity // Get the list of added items and intersect them with the set of items here final Collection bounceAnims = new ArrayList<>(); boolean canAnimatePageChange = canAnimatePageChange(); - Workspace workspace = mWorkspace; + Workspace workspace = mWorkspace; int newItemsScreenId = -1; int end = items.size(); View newView = null; diff --git a/src/com/android/launcher3/LauncherAnimUtils.java b/src/com/android/launcher3/LauncherAnimUtils.java index 4f3ae59992..808bf96f9f 100644 --- a/src/com/android/launcher3/LauncherAnimUtils.java +++ b/src/com/android/launcher3/LauncherAnimUtils.java @@ -72,8 +72,8 @@ public class LauncherAnimUtils { * of all the ones set, to have a smooth experience even in the case of overlapping scaling * animation. */ - public static final MultiScalePropertyFactory WORKSPACE_SCALE_PROPERTY_FACTORY = - new MultiScalePropertyFactory("workspace_scale_property"); + public static final MultiScalePropertyFactory> WORKSPACE_SCALE_PROPERTY_FACTORY = + new MultiScalePropertyFactory>("workspace_scale_property"); /** Property to set the scale of hotseat. */ public static final MultiScalePropertyFactory HOTSEAT_SCALE_PROPERTY_FACTORY = diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java index 1e09b2d92f..84b95ec188 100644 --- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java +++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java @@ -67,18 +67,18 @@ import com.android.systemui.plugins.ResourceProvider; */ public class WorkspaceStateTransitionAnimation { - private static final FloatProperty WORKSPACE_SCALE_PROPERTY = + private static final FloatProperty> WORKSPACE_SCALE_PROPERTY = WORKSPACE_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WORKSPACE_STATE); private static final FloatProperty HOTSEAT_SCALE_PROPERTY = HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WORKSPACE_STATE); private final Launcher mLauncher; - private final Workspace mWorkspace; + private final Workspace mWorkspace; private float mNewScale; - public WorkspaceStateTransitionAnimation(Launcher launcher, Workspace workspace) { + public WorkspaceStateTransitionAnimation(Launcher launcher, Workspace workspace) { mLauncher = launcher; mWorkspace = workspace; } @@ -224,7 +224,7 @@ public class WorkspaceStateTransitionAnimation { * Returns a spring based animator for the scale property of {@param workspace}. */ public static ValueAnimator getWorkspaceSpringScaleAnimator(Launcher launcher, - Workspace workspace, float scale) { + Workspace workspace, float scale) { return getSpringScaleAnimator(launcher, workspace, scale, WORKSPACE_SCALE_PROPERTY); } diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java index 18c05ebd43..462daf5f70 100644 --- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java +++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java @@ -19,7 +19,7 @@ import com.android.launcher3.BubbleTextView; import com.android.launcher3.ButtonDropTarget; import com.android.launcher3.CellLayout; import com.android.launcher3.Launcher; -import com.android.launcher3.LauncherSettings.Favorites; +import com.android.launcher3.LauncherSettings; import com.android.launcher3.PendingAddItemInfo; import com.android.launcher3.R; import com.android.launcher3.Workspace; @@ -153,61 +153,9 @@ public class LauncherAccessibilityDelegate extends BaseAccessibilityDelegate { - if (item instanceof AppInfo) { - WorkspaceItemInfo info = ((AppInfo) item).makeWorkspaceItem(); - mContext.getModelWriter().addItemToDatabase(info, - Favorites.CONTAINER_DESKTOP, - screenId, coordinates[0], coordinates[1]); - - mContext.bindItems( - Collections.singletonList(info), - /* forceAnimateIcons= */ true, - /* focusFirstItemForAccessibility= */ true); - announceConfirmation(R.string.item_added_to_workspace); - } else if (item instanceof PendingAddItemInfo) { - PendingAddItemInfo info = (PendingAddItemInfo) item; - Workspace workspace = mContext.getWorkspace(); - workspace.snapToPage(workspace.getPageIndexForScreenId(screenId)); - mContext.addPendingItem(info, Favorites.CONTAINER_DESKTOP, - screenId, coordinates, info.spanX, info.spanY); - } - else if (item instanceof WorkspaceItemInfo) { - WorkspaceItemInfo info = ((WorkspaceItemInfo) item).clone(); - mContext.getModelWriter().addItemToDatabase(info, - Favorites.CONTAINER_DESKTOP, - screenId, coordinates[0], coordinates[1]); - mContext.bindItems(Collections.singletonList(info), true, true); - } - })); - return true; + return addToWorkspace(item, true); } else if (action == MOVE_TO_WORKSPACE) { - Folder folder = Folder.getOpen(mContext); - folder.close(true); - WorkspaceItemInfo info = (WorkspaceItemInfo) item; - folder.getInfo().remove(info, false); - - final int[] coordinates = new int[2]; - final int screenId = findSpaceOnWorkspace(item, coordinates); - if (screenId == -1) { - return false; - } - mContext.getModelWriter().moveItemInDatabase(info, - Favorites.CONTAINER_DESKTOP, - screenId, coordinates[0], coordinates[1]); - - // Bind the item in next frame so that if a new workspace page was created, - // it will get laid out. - new Handler().post(() -> { - mContext.bindItems(Collections.singletonList(item), true); - announceConfirmation(R.string.item_moved); - }); - return true; + return moveToWorkspace(item); } else if (action == RESIZE) { final LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) item; List actions = getSupportedResizeActions(host, info); @@ -403,4 +351,76 @@ public class LauncherAccessibilityDelegate extends BaseAccessibilityDelegate { + if (item instanceof AppInfo) { + WorkspaceItemInfo info = ((AppInfo) item).makeWorkspaceItem(); + mContext.getModelWriter().addItemToDatabase(info, + LauncherSettings.Favorites.CONTAINER_DESKTOP, + screenId, coordinates[0], coordinates[1]); + + mContext.bindItems( + Collections.singletonList(info), + /* forceAnimateIcons= */ true, + /* focusFirstItemForAccessibility= */ accessibility); + announceConfirmation(R.string.item_added_to_workspace); + } else if (item instanceof PendingAddItemInfo) { + PendingAddItemInfo info = (PendingAddItemInfo) item; + Workspace workspace = mContext.getWorkspace(); + workspace.snapToPage(workspace.getPageIndexForScreenId(screenId)); + mContext.addPendingItem(info, LauncherSettings.Favorites.CONTAINER_DESKTOP, + screenId, coordinates, info.spanX, info.spanY); + } else if (item instanceof WorkspaceItemInfo) { + WorkspaceItemInfo info = ((WorkspaceItemInfo) item).clone(); + mContext.getModelWriter().addItemToDatabase(info, + LauncherSettings.Favorites.CONTAINER_DESKTOP, + screenId, coordinates[0], coordinates[1]); + mContext.bindItems(Collections.singletonList(info), true, accessibility); + } + })); + return true; + } + /** + * Functionality to move the item {@link ItemInfo} to the workspace + * @param item item to be moved + * + * @return true if the item could be successfully added + */ + public boolean moveToWorkspace(ItemInfo item) { + Folder folder = Folder.getOpen(mContext); + folder.close(true); + WorkspaceItemInfo info = (WorkspaceItemInfo) item; + folder.getInfo().remove(info, false); + + final int[] coordinates = new int[2]; + final int screenId = findSpaceOnWorkspace(item, coordinates); + if (screenId == -1) { + return false; + } + mContext.getModelWriter().moveItemInDatabase(info, + LauncherSettings.Favorites.CONTAINER_DESKTOP, + screenId, coordinates[0], coordinates[1]); + + // Bind the item in next frame so that if a new workspace page was created, + // it will get laid out. + new Handler().post(() -> { + mContext.bindItems(Collections.singletonList(item), true); + announceConfirmation(R.string.item_moved); + }); + return true; + } } diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 5ee42037b0..14e10918b6 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -104,7 +104,10 @@ public class DragLayer extends BaseDragLayer { mFocusIndicatorHelper = new ViewGroupFocusHelper(this); } - public void setup(DragController dragController, Workspace workspace) { + /** + * Set up the drag layer with the parameters. + */ + public void setup(DragController dragController, Workspace workspace) { mDragController = dragController; recreateControllers(); mWorkspaceDragScrim = new Scrim(this); diff --git a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java index 6325877936..fb8a1bc99e 100644 --- a/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java +++ b/src/com/android/launcher3/dragndrop/SpringLoadedDragController.java @@ -55,7 +55,7 @@ public class SpringLoadedDragController implements OnAlarmListener { public void onAlarm(Alarm alarm) { if (mScreen != null) { // Snap to the screen that we are hovering over now - Workspace w = mLauncher.getWorkspace(); + Workspace w = mLauncher.getWorkspace(); if (!w.isVisible(mScreen)) { w.snapToPage(w.indexOfChild(mScreen)); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 7c665c6d87..5fe2435e4a 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -342,7 +342,7 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel Rect to = finalRect; if (to == null) { to = new Rect(); - Workspace workspace = launcher.getWorkspace(); + Workspace workspace = launcher.getWorkspace(); // Set cellLayout and this to it's final state to compute final animation locations workspace.setFinalTransitionTransform(); float scaleX = getScaleX(); diff --git a/src/com/android/launcher3/pageindicators/PageIndicator.java b/src/com/android/launcher3/pageindicators/PageIndicator.java index 5967be7d78..ec691931a1 100644 --- a/src/com/android/launcher3/pageindicators/PageIndicator.java +++ b/src/com/android/launcher3/pageindicators/PageIndicator.java @@ -28,21 +28,22 @@ public interface PageIndicator { /** * Sets the flag if the Page Indicator should autohide. - * @param shouldAutoHide */ default void setShouldAutoHide(boolean shouldAutoHide) { - //No-op by default + // No-op by default } + /** * Pauses all currently running animations. */ default void pauseAnimations() { - //No-op by default + // No-op by default } + /** * Force-ends all currently running or paused animations. */ default void skipAnimationsToEnd() { - //No-op by default + // No-op by default } } diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index f06e5cecd5..df8a3e2e8a 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -351,7 +351,7 @@ public abstract class ArrowPopup if (mColorExtractors == null) { return; } - Workspace workspace = launcher.getWorkspace(); + Workspace workspace = launcher.getWorkspace(); if (workspace == null) { return; } diff --git a/src/com/android/launcher3/states/SpringLoadedState.java b/src/com/android/launcher3/states/SpringLoadedState.java index 9be3cc5539..52356ce324 100644 --- a/src/com/android/launcher3/states/SpringLoadedState.java +++ b/src/com/android/launcher3/states/SpringLoadedState.java @@ -46,7 +46,7 @@ public class SpringLoadedState extends LauncherState { @Override public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) { DeviceProfile grid = launcher.getDeviceProfile(); - Workspace ws = launcher.getWorkspace(); + Workspace ws = launcher.getWorkspace(); if (ws.getChildCount() == 0) { return super.getWorkspaceScaleAndTranslation(launcher); } diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 2eae99ae90..a6b481ada0 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -178,7 +178,7 @@ public class TestInformationHandler implements ResourceBasedOverride { case TestProtocol.REQUEST_WORKSPACE_CELL_LAYOUT_SIZE: return getLauncherUIProperty(Bundle::putIntArray, launcher -> { - final Workspace workspace = launcher.getWorkspace(); + final Workspace workspace = launcher.getWorkspace(); final int screenId = workspace.getScreenIdForPageIndex( workspace.getCurrentPage()); final CellLayout cellLayout = workspace.getScreenWithId(screenId); @@ -189,7 +189,7 @@ public class TestInformationHandler implements ResourceBasedOverride { final WorkspaceCellCenterRequest request = extra.getParcelable( TestProtocol.TEST_INFO_REQUEST_FIELD); return getLauncherUIProperty(Bundle::putParcelable, launcher -> { - final Workspace workspace = launcher.getWorkspace(); + final Workspace workspace = launcher.getWorkspace(); // TODO(b/216387249): allow caller selecting different pages. CellLayout cellLayout = (CellLayout) workspace.getPageAt( workspace.getCurrentPage()); diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java index fe0bf6d632..17bbdf1769 100644 --- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java +++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java @@ -64,7 +64,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe private final Rect mTempRect = new Rect(); private final Launcher mLauncher; - private final Workspace mWorkspace; + private final Workspace mWorkspace; private final PointF mTouchDownPoint = new PointF(); private final float mTouchSlop; @@ -72,7 +72,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe private final GestureDetector mGestureDetector; - public WorkspaceTouchListener(Launcher launcher, Workspace workspace) { + public WorkspaceTouchListener(Launcher launcher, Workspace workspace) { mLauncher = launcher; mWorkspace = workspace; // Use twice the touch slop as we are looking for long press which is more diff --git a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java index f1276dd3c9..43e98201f4 100644 --- a/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java +++ b/src/com/android/launcher3/util/WallpaperOffsetInterpolator.java @@ -32,7 +32,7 @@ public class WallpaperOffsetInterpolator extends BroadcastReceiver { // Don't use all the wallpaper for parallax until you have at least this many pages private static final int MIN_PARALLAX_PAGE_SPAN = 4; - private final Workspace mWorkspace; + private final Workspace mWorkspace; private final boolean mIsRtl; private final Handler mHandler; @@ -43,7 +43,7 @@ public class WallpaperOffsetInterpolator extends BroadcastReceiver { private boolean mLockedToDefaultPage; private int mNumScreens; - public WallpaperOffsetInterpolator(Workspace workspace) { + public WallpaperOffsetInterpolator(Workspace workspace) { mWorkspace = workspace; mIsRtl = Utilities.isRtl(workspace.getResources()); mHandler = new OffsetHandler(workspace.getContext());