Merge "Removing GridMigrationTask-v1 since it has been disabled for a while" into sc-v2-dev
diff --git a/go/quickstep/res/layout/overview_actions_container.xml b/go/quickstep/res/layout/overview_actions_container.xml
index 0e718ca..cc65cbf 100644
--- a/go/quickstep/res/layout/overview_actions_container.xml
+++ b/go/quickstep/res/layout/overview_actions_container.xml
@@ -14,12 +14,11 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!-- NOTE! don't add dimensions for margins / gravity to root view in this file, they need to be
- loaded at runtime. -->
<com.android.quickstep.views.GoOverviewActionsView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal|bottom">
<LinearLayout
android:id="@+id/action_buttons"
diff --git a/quickstep/res/layout/overview_actions_container.xml b/quickstep/res/layout/overview_actions_container.xml
index 68680d3..0c2a28c 100644
--- a/quickstep/res/layout/overview_actions_container.xml
+++ b/quickstep/res/layout/overview_actions_container.xml
@@ -14,11 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<!-- NOTE! don't add dimensions for margins / gravity to root view in this file, they need to be
- loaded at runtime. -->
<com.android.quickstep.views.OverviewActionsView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal|bottom">
<LinearLayout
android:id="@+id/action_buttons"
diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml
index 5fc969d..4e97fbd 100644
--- a/quickstep/res/values/dimens.xml
+++ b/quickstep/res/values/dimens.xml
@@ -16,7 +16,6 @@
<resources>
<dimen name="task_thumbnail_icon_size">48dp</dimen>
- <dimen name="task_thumbnail_icon_size_grid">40dp</dimen>
<!-- For screens without rounded corners -->
<dimen name="task_corner_radius_small">2dp</dimen>
<!-- For Launchers that want to override the default dialog corner radius -->
@@ -31,18 +30,22 @@
<dimen name="overview_minimum_next_prev_size">50dp</dimen>
<dimen name="overview_task_margin">16dp</dimen>
+ <dimen name="overview_task_margin_grid">12dp</dimen>
<!-- Overrideable in overlay that provides the Overview Actions. -->
<dimen name="overview_actions_height">48dp</dimen>
- <dimen name="overview_actions_bottom_margin_gesture">28dp</dimen>
- <dimen name="overview_actions_bottom_margin_three_button">8dp</dimen>
+ <dimen name="overview_actions_margin_gesture">28dp</dimen>
+ <dimen name="overview_actions_top_margin_gesture_grid_portrait">19.37dp</dimen>
+ <dimen name="overview_actions_bottom_margin_gesture_grid_portrait">22dp</dimen>
+ <dimen name="overview_actions_top_margin_gesture_grid_landscape">19.1dp</dimen>
+ <dimen name="overview_actions_bottom_margin_gesture_grid_landscape">10dp</dimen>
+ <dimen name="overview_actions_margin_three_button">8dp</dimen>
<dimen name="overview_actions_horizontal_margin">16dp</dimen>
- <dimen name="overview_grid_top_margin">77dp</dimen>
- <dimen name="overview_grid_bottom_margin">70dp</dimen>
- <dimen name="overview_grid_side_margin">54dp</dimen>
- <dimen name="overview_grid_row_spacing">42dp</dimen>
- <dimen name="overview_grid_focus_vertical_margin">40dp</dimen>
+ <dimen name="overview_grid_side_margin">50dp</dimen>
+ <dimen name="overview_grid_row_spacing_portrait">37.13dp</dimen>
+ <dimen name="overview_grid_row_spacing_landscape">33.38dp</dimen>
+ <dimen name="overview_grid_focus_vertical_margin">0dp</dimen>
<!-- These speeds are in dp/s -->
<dimen name="max_task_dismiss_drag_velocity">2.25dp</dimen>
@@ -51,6 +54,7 @@
<dimen name="default_task_dismiss_drag_velocity_grid_focus_task">5dp</dimen>
<dimen name="recents_page_spacing">16dp</dimen>
+ <dimen name="recents_page_spacing_grid">36dp</dimen>
<dimen name="recents_clear_all_deadzone_vertical_margin">70dp</dimen>
<!-- The speed in dp/s at which the user needs to be scrolling in recents such that we start
diff --git a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
index 5250d18..e1d0574 100644
--- a/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
+++ b/quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java
@@ -210,6 +210,17 @@
}
}
+ /**
+ * {@code LauncherOverlayCallbacks} scroll amount.
+ * Indicates transition progress to -1 screen.
+ * @param progress From 0 to 1.
+ */
+ @Override
+ public void onScrollChanged(float progress) {
+ super.onScrollChanged(progress);
+ mDepthController.onOverlayScrollChanged(progress);
+ }
+
@Override
public void startIntentSenderForResult(IntentSender intent, int requestCode,
Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) {
diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
index 6cfbf62..aba16c2 100644
--- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
+++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java
@@ -117,6 +117,10 @@
private WallpaperManagerCompat mWallpaperManager;
private SurfaceControl mSurface;
/**
+ * How visible the -1 overlay is, from 0 to 1.
+ */
+ private float mOverlayScrollProgress;
+ /**
* Ratio from 0 to 1, where 0 is fully zoomed out, and 1 is zoomed in.
* @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float)
*/
@@ -255,12 +259,24 @@
}
}
+ public void onOverlayScrollChanged(float progress) {
+ // Round out the progress to dedupe frequent, non-perceptable updates
+ int progressI = (int) (progress * 256);
+ float progressF = progressI / 256f;
+ if (Float.compare(mOverlayScrollProgress, progressF) == 0) {
+ return;
+ }
+ mOverlayScrollProgress = progressF;
+ dispatchTransactionSurface(mDepth);
+ }
+
private boolean dispatchTransactionSurface(float depth) {
boolean supportsBlur = BlurUtils.supportsBlursOnWindows();
if (supportsBlur && (mSurface == null || !mSurface.isValid())) {
return false;
}
ensureDependencies();
+ depth = Math.max(depth, mOverlayScrollProgress);
IBinder windowToken = mLauncher.getRootView().getWindowToken();
if (windowToken != null) {
mWallpaperManager.setWallpaperZoomOut(windowToken, depth);
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
index 67ebc02..b89032e 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragController.java
@@ -117,6 +117,24 @@
dragLayerY += dragRect.top;
DragOptions dragOptions = new DragOptions();
+ dragOptions.preDragCondition = new DragOptions.PreDragCondition() {
+ private DragView mDragView;
+
+ @Override
+ public boolean shouldStartDrag(double distanceDragged) {
+ return mDragView != null && mDragView.isAnimationFinished();
+ }
+
+ @Override
+ public void onPreDragStart(DropTarget.DragObject dragObject) {
+ mDragView = dragObject.dragView;
+ }
+
+ @Override
+ public void onPreDragEnd(DropTarget.DragObject dragObject, boolean dragStarted) {
+ mDragView = null;
+ }
+ };
// TODO: open popup/pre-drag
// PopupContainerWithArrow popupContainer = PopupContainerWithArrow.showForIcon(view);
// if (popupContainer != null) {
@@ -155,6 +173,7 @@
mDragObject = new DropTarget.DragObject(mActivity.getApplicationContext());
mDragObject.originalView = originalView;
+ mDragObject.deferDragViewCleanupPostAnimation = false;
mIsInPreDrag = mOptions.preDragCondition != null
&& !mOptions.preDragCondition.shouldStartDrag(0);
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index c412ece..97f46a5 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -1153,6 +1153,12 @@
mGestureState.getEndTarget(), duration,
mTaskAnimationManager.getCurrentCallbacks());
if (mParallelRunningAnim != null) {
+ mParallelRunningAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mParallelRunningAnim = null;
+ }
+ });
mParallelRunningAnim.start();
}
}
diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
index db56231..624ade2 100644
--- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java
+++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java
@@ -210,14 +210,8 @@
Rect gridRect = new Rect();
calculateGridSize(context, dp, gridRect);
- int verticalMargin = Math.max(
- res.getDimensionPixelSize(R.dimen.overview_grid_focus_vertical_margin),
- res.getDimensionPixelSize(R.dimen.overview_actions_height));
- float taskHeight =
- gridRect.height() - verticalMargin * 2 - dp.overviewTaskThumbnailTopMarginPx;
-
PointF taskDimension = getTaskDimension(context, dp);
- float scale = taskHeight / taskDimension.y;
+ float scale = gridRect.height() / taskDimension.y;
int outWidth = Math.round(scale * taskDimension.x);
int outHeight = Math.round(scale * taskDimension.y);
@@ -225,19 +219,9 @@
Gravity.apply(gravity, outWidth, outHeight, gridRect, outRect);
} else {
int taskMargin = dp.overviewTaskMarginPx;
- int proactiveRowAndMargin;
- if (!TaskView.SHOW_PROACTIVE_ACTIONS || dp.isVerticalBarLayout()) {
- // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside
- // the actions row.
- proactiveRowAndMargin = 0;
- } else {
- proactiveRowAndMargin = res.getDimensionPixelSize(
- R.dimen.overview_proactive_row_height)
- + res.getDimensionPixelSize(R.dimen.overview_proactive_row_bottom_margin);
- }
calculateTaskSizeInternal(context, dp,
dp.overviewTaskThumbnailTopMarginPx,
- proactiveRowAndMargin + getOverviewActionsHeight(context, dp),
+ getProactiveRowAndMargin(context, dp) + getOverviewActionsHeight(context, dp),
res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
outRect);
}
@@ -299,13 +283,14 @@
*/
public final void calculateGridSize(Context context, DeviceProfile dp, Rect outRect) {
Resources res = context.getResources();
- int topMargin = res.getDimensionPixelSize(R.dimen.overview_grid_top_margin);
- int bottomMargin = res.getDimensionPixelSize(R.dimen.overview_grid_bottom_margin);
+ Rect insets = dp.getInsets();
+ int topMargin = dp.overviewTaskThumbnailTopMarginPx;
+ int bottomMargin =
+ getProactiveRowAndMargin(context, dp) + getOverviewActionsHeight(context, dp);
int sideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin);
- Rect insets = dp.getInsets();
outRect.set(0, 0, dp.widthPx, dp.heightPx);
- outRect.inset(Math.max(insets.left, sideMargin), Math.max(insets.top, topMargin),
+ outRect.inset(Math.max(insets.left, sideMargin), insets.top + topMargin,
Math.max(insets.right, sideMargin), Math.max(insets.bottom, bottomMargin));
}
@@ -318,8 +303,9 @@
Rect gridRect = new Rect();
calculateGridSize(context, dp, gridRect);
- int rowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
- float rowHeight = (gridRect.height() - rowSpacing) / 2f;
+ float rowHeight =
+ (gridRect.height() + dp.overviewTaskThumbnailTopMarginPx - dp.overviewRowSpacing)
+ / 2f;
PointF taskDimension = getTaskDimension(context, dp);
float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y;
@@ -328,7 +314,6 @@
int gravity = Gravity.TOP;
gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
- gridRect.inset(0, dp.overviewTaskThumbnailTopMarginPx, 0, 0);
Gravity.apply(gravity, outWidth, outHeight, gridRect, outRect);
}
@@ -344,6 +329,21 @@
outRect);
}
+ private int getProactiveRowAndMargin(Context context, DeviceProfile dp) {
+ Resources res = context.getResources();
+ int proactiveRowAndMargin;
+ if (!TaskView.SHOW_PROACTIVE_ACTIONS || dp.isVerticalBarLayout()) {
+ // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside
+ // the actions row.
+ proactiveRowAndMargin = 0;
+ } else {
+ proactiveRowAndMargin = res.getDimensionPixelSize(
+ R.dimen.overview_proactive_row_height)
+ + res.getDimensionPixelSize(R.dimen.overview_proactive_row_bottom_margin);
+ }
+ return proactiveRowAndMargin;
+ }
+
/** Gets the space that the overview actions will take, including bottom margin. */
private int getOverviewActionsHeight(Context context, DeviceProfile dp) {
Resources res = context.getResources();
diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java
index 95be45a..03e2395 100644
--- a/quickstep/src/com/android/quickstep/RecentsActivity.java
+++ b/quickstep/src/com/android/quickstep/RecentsActivity.java
@@ -22,8 +22,8 @@
import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY;
import static com.android.launcher3.Utilities.createHomeIntent;
-import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
+import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
import static com.android.quickstep.TaskUtils.taskIsATargetWithMode;
import static com.android.quickstep.TaskViewUtils.createRecentsWindowAnimator;
@@ -75,7 +75,6 @@
import com.android.quickstep.util.SplitSelectStateController;
import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
-import com.android.quickstep.views.SplitPlaceholderView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationAdapterCompat;
@@ -287,7 +286,7 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- mStateManager = new StateManager<>(this, RecentsState.DEFAULT);
+ mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER);
mOldConfig = new Configuration(getResources().getConfiguration());
initDeviceProfile();
diff --git a/quickstep/src/com/android/quickstep/fallback/RecentsState.java b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
index d06d87c..917b58a 100644
--- a/quickstep/src/com/android/quickstep/fallback/RecentsState.java
+++ b/quickstep/src/com/android/quickstep/fallback/RecentsState.java
@@ -42,8 +42,8 @@
private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7);
public static final RecentsState DEFAULT = new RecentsState(0,
- FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID | FLAG_SCRIM
- | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
+ FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID
+ | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
public static final RecentsState MODAL_TASK = new ModalState(1,
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL
| FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
index 563bb53..a2d2179 100644
--- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
+++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java
@@ -16,7 +16,6 @@
package com.android.quickstep.views;
-import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_SHARE;
import android.content.Context;
@@ -33,7 +32,6 @@
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
-import com.android.launcher3.Utilities;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.quickstep.SysUINavigationMode;
@@ -90,9 +88,6 @@
protected T mCallbacks;
- private float mModalness;
- private float mModalTransformY;
-
protected DeviceProfile mDp;
public OverviewActionsView(Context context) {
@@ -225,29 +220,6 @@
requestLayout();
}
- /**
- * The current task is fully modal (modalness = 1) when it is shown on its own in a modal
- * way. Modalness 0 means the task is shown in context with all the other tasks.
- */
- public void setTaskModalness(float modalness) {
- mModalness = modalness;
- applyTranslationY();
- }
-
- public void setModalTransformY(float modalTransformY) {
- mModalTransformY = modalTransformY;
- applyTranslationY();
- }
-
- private void applyTranslationY() {
- setTranslationY(getModalTrans(mModalTransformY));
- }
-
- private float getModalTrans(float endTranslation) {
- float progress = ACCEL_DEACCEL.getInterpolation(mModalness);
- return Utilities.mapRange(progress, 0, endTranslation);
- }
-
/** Get the top margin associated with the action buttons in Overview. */
public static int getOverviewActionsTopMarginPx(
SysUINavigationMode.Mode mode, DeviceProfile dp) {
@@ -260,7 +232,7 @@
return dp.overviewActionsMarginThreeButtonPx;
}
- return dp.overviewActionsMarginGesturePx;
+ return dp.overviewActionsTopMarginGesturePx;
}
/** Get the bottom margin associated with the action buttons in Overview. */
@@ -276,6 +248,6 @@
return dp.overviewActionsMarginThreeButtonPx + inset;
}
- return dp.overviewActionsMarginGesturePx + inset;
+ return dp.overviewActionsBottomMarginGesturePx + inset;
}
}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index b90389a..d00db2d 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -83,7 +83,6 @@
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.util.SparseBooleanArray;
-import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -95,7 +94,6 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.Interpolator;
-import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.OverScroller;
@@ -386,7 +384,6 @@
protected final ACTIVITY_TYPE mActivity;
private final float mFastFlingVelocity;
private final RecentsModel mModel;
- private final int mRowSpacing;
private final int mGridSideMargin;
private final ClearAllButton mClearAllButton;
private final Rect mClearAllButtonDeadZoneRect = new Rect();
@@ -598,7 +595,6 @@
public RecentsView(Context context, AttributeSet attrs, int defStyleAttr,
BaseActivityInterface sizeStrategy) {
super(context, attrs, defStyleAttr);
- setPageSpacing(getResources().getDimensionPixelSize(R.dimen.recents_page_spacing));
setEnableFreeScroll(true);
mSizeStrategy = sizeStrategy;
mActivity = BaseActivity.fromContext(context);
@@ -620,7 +616,6 @@
mIsRtl = mOrientationHandler.getRecentsRtlSetting(getResources());
setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
- mRowSpacing = getResources().getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
mGridSideMargin = getResources().getDimensionPixelSize(R.dimen.overview_grid_side_margin);
mSquaredTouchSlop = squaredTouchSlop(context);
@@ -1351,6 +1346,7 @@
DeviceProfile dp = mActivity.getDeviceProfile();
setOverviewGridEnabled(
mActivity.getStateManager().getState().displayOverviewTasksAsGrid(dp));
+ setPageSpacing(dp.overviewPageSpacing);
// Propagate DeviceProfile change event.
mLiveTileTaskViewSimulator.setDp(dp);
@@ -1422,32 +1418,10 @@
mTaskGridVerticalDiff = mLastComputedGridTaskSize.top - mLastComputedTaskSize.top;
mTopBottomRowHeightDiff =
mLastComputedGridTaskSize.height() + dp.overviewTaskThumbnailTopMarginPx
- + mRowSpacing;
+ + dp.overviewRowSpacing;
// Force TaskView to update size from thumbnail
updateTaskSize();
-
- // Update ActionsView position
- if (mActionsView != null) {
- FrameLayout.LayoutParams layoutParams =
- (FrameLayout.LayoutParams) mActionsView.getLayoutParams();
- if (dp.overviewShowAsGrid) {
- layoutParams.gravity = Gravity.BOTTOM;
- layoutParams.bottomMargin =
- dp.heightPx - mInsets.bottom - mLastComputedGridSize.bottom;
- layoutParams.leftMargin = mLastComputedTaskSize.left;
- layoutParams.rightMargin = dp.widthPx - mLastComputedTaskSize.right;
- // When in modal state, remove bottom margin to avoid covering content.
- mActionsView.setModalTransformY(layoutParams.bottomMargin);
- } else {
- layoutParams.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM;
- layoutParams.bottomMargin = 0;
- layoutParams.leftMargin = 0;
- layoutParams.rightMargin = 0;
- mActionsView.setModalTransformY(0);
- }
- mActionsView.setLayoutParams(layoutParams);
- }
}
/**
@@ -3947,7 +3921,6 @@
boolean inPlaceLandscape = !mOrientationState.canRecentsActivityRotate()
&& mOrientationState.getTouchRotation() != ROTATION_0;
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, modalness < 1 && inPlaceLandscape);
- mActionsView.setTaskModalness(modalness);
}
@Nullable
diff --git a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
index fef9304..3e84a76 100644
--- a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
+++ b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java
@@ -16,7 +16,6 @@
import androidx.test.runner.AndroidJUnit4;
import com.android.launcher3.Launcher;
-import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.quickstep.views.DigitalWellBeingToast;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
@@ -33,7 +32,6 @@
resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR);
@Test
- @ScreenRecord //b/193440212
public void testToast() throws Exception {
startAppFast(CALCULATOR_PACKAGE);
diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
index 20b4715..b36baf8 100644
--- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
+++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java
@@ -214,7 +214,7 @@
// b/143488140
//@NavigationModeSwitch
@Test
- @ScreenRecord // b/194484556
+ @ScreenRecord // b/187080582
public void testOverview() {
startAppFast(getAppPackageName());
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index ea69b94..164e755 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -93,7 +93,6 @@
@Test
@PortraitLandscape
- @ScreenRecord //b/193440212
public void testOverview() throws Exception {
startTestAppsWithCheck();
// mLauncher.pressHome() also tests an important case of pressing home while in background.
@@ -159,6 +158,7 @@
@Test
@NavigationModeSwitch
@PortraitLandscape
+ @ScreenRecord //b/193125090
public void testOverviewActions() throws Exception {
// Experimenting for b/165029151:
final Overview overview = mLauncher.pressHome().switchToOverview();
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 3339bf1..010d15b 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -325,8 +325,17 @@
<dimen name="task_thumbnail_icon_size">0dp</dimen>
<dimen name="task_thumbnail_icon_size_grid">0dp</dimen>
<dimen name="overview_task_margin">0dp</dimen>
- <dimen name="overview_actions_bottom_margin_gesture">0dp</dimen>
- <dimen name="overview_actions_bottom_margin_three_button">0dp</dimen>
+ <dimen name="overview_task_margin_grid">0dp</dimen>
+ <dimen name="overview_actions_margin_gesture">0dp</dimen>
+ <dimen name="overview_actions_top_margin_gesture_grid_portrait">0dp</dimen>
+ <dimen name="overview_actions_bottom_margin_gesture_grid_portrait">0dp</dimen>
+ <dimen name="overview_actions_top_margin_gesture_grid_landscape">0dp</dimen>
+ <dimen name="overview_actions_bottom_margin_gesture_grid_landscape">0dp</dimen>
+ <dimen name="overview_actions_margin_three_button">0dp</dimen>
+ <dimen name="overview_grid_row_spacing_portrait">0dp</dimen>
+ <dimen name="overview_grid_row_spacing_landscape">0dp</dimen>
+ <dimen name="recents_page_spacing">0dp</dimen>
+ <dimen name="recents_page_spacing_grid">0dp</dimen>
<dimen name="split_placeholder_size">110dp</dimen>
<!-- Workspace grid visualization parameters -->
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index 468d490..477dcf8 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -217,7 +217,6 @@
final DragView dragView = d.dragView;
final Rect to = getIconRect(d);
final float scale = (float) to.width() / dragView.getMeasuredWidth();
- dragView.disableColorExtraction();
dragView.detachContentView(/* reattachToPreviousParent= */ true);
mDropTargetBar.deferOnDragEnd();
@@ -225,9 +224,6 @@
completeDrop(d);
mDropTargetBar.onDragEnd();
mLauncher.getStateManager().goToState(NORMAL);
- // Only re-enable updates once the workspace is back to normal, which will be after the
- // current frame.
- post(dragView::resumeColorExtraction);
};
dragLayer.animateView(d.dragView, to, scale, 0.1f, 0.1f,
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index af6cce1..28e3b9d 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -18,7 +18,6 @@
import static android.animation.ValueAnimator.areAnimatorsEnabled;
-import static com.android.launcher3.Utilities.getBoundsForViewInDragLayer;
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
import android.animation.Animator;
@@ -1071,18 +1070,12 @@
// Apply local extracted color if the DragView is an AppWidgetHostViewDrawable.
View view = dragObject.dragView.getContentView();
if (view instanceof LauncherAppWidgetHostView) {
- Launcher launcher = Launcher.getLauncher(dragObject.dragView.getContext());
+ Launcher launcher = Launcher.getLauncher(getContext());
Workspace workspace = launcher.getWorkspace();
int screenId = workspace.getIdForScreen(this);
- int pageId = workspace.getPageIndexForScreenId(screenId);
cellToRect(targetCell[0], targetCell[1], spanX, spanY, mTempRect);
- // Now get the rect in drag layer coordinates.
- getBoundsForViewInDragLayer(launcher.getDragLayer(), this, mTempRect, true,
- mTmpFloatArray, mTempRectF);
- Utilities.setRect(mTempRectF, mTempRect);
-
- ((LauncherAppWidgetHostView) view).handleDrag(mTempRect, pageId);
+ ((LauncherAppWidgetHostView) view).handleDrag(mTempRect, this, screenId);
}
}
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index b591dcd..740bf5a 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -184,7 +184,10 @@
public int overviewTaskIconSizePx;
public int overviewTaskThumbnailTopMarginPx;
public final int overviewActionsMarginThreeButtonPx;
- public final int overviewActionsMarginGesturePx;
+ public final int overviewActionsTopMarginGesturePx;
+ public final int overviewActionsBottomMarginGesturePx;
+ public int overviewPageSpacing;
+ public int overviewRowSpacing;
// Widgets
public final PointF appWidgetScale = new PointF(1.0f, 1.0f);
@@ -350,15 +353,36 @@
: 0;
overviewShowAsGrid = isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
- overviewTaskMarginPx = res.getDimensionPixelSize(R.dimen.overview_task_margin);
- overviewTaskIconSizePx = overviewShowAsGrid
- ? res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size_grid)
- : res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size);
+ overviewTaskMarginPx = overviewShowAsGrid
+ ? res.getDimensionPixelSize(R.dimen.overview_task_margin_grid)
+ : res.getDimensionPixelSize(R.dimen.overview_task_margin);
+ overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size);
overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
- overviewActionsMarginGesturePx = res.getDimensionPixelSize(
- R.dimen.overview_actions_bottom_margin_gesture);
+ if (overviewShowAsGrid) {
+ if (isLandscape) {
+ overviewActionsTopMarginGesturePx = res.getDimensionPixelSize(
+ R.dimen.overview_actions_top_margin_gesture_grid_landscape);
+ overviewActionsBottomMarginGesturePx = res.getDimensionPixelSize(
+ R.dimen.overview_actions_bottom_margin_gesture_grid_landscape);
+ } else {
+ overviewActionsTopMarginGesturePx = res.getDimensionPixelSize(
+ R.dimen.overview_actions_top_margin_gesture_grid_portrait);
+ overviewActionsBottomMarginGesturePx = res.getDimensionPixelSize(
+ R.dimen.overview_actions_bottom_margin_gesture_grid_portrait);
+ }
+ } else {
+ overviewActionsTopMarginGesturePx = res.getDimensionPixelSize(
+ R.dimen.overview_actions_margin_gesture);
+ overviewActionsBottomMarginGesturePx = overviewActionsTopMarginGesturePx;
+ }
overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
- R.dimen.overview_actions_bottom_margin_three_button);
+ R.dimen.overview_actions_margin_three_button);
+ overviewPageSpacing = overviewShowAsGrid
+ ? res.getDimensionPixelSize(R.dimen.recents_page_spacing_grid)
+ : res.getDimensionPixelSize(R.dimen.recents_page_spacing);
+ overviewRowSpacing = isLandscape
+ ? res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing_landscape)
+ : res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing_portrait);
// Calculate all of the remaining variables.
extraSpace = updateAvailableDimensions(res);
@@ -434,6 +458,10 @@
cellLayoutBorderSpacingPx = isScalableGrid ? borderSpacing : 0;
}
+ public Info getDisplayInfo() {
+ return mInfo;
+ }
+
/**
* We inset the widget padding added by the system and instead rely on the border spacing
* between cells to create reliable consistency between widgets
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e736022..07c2113 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -222,7 +222,8 @@
* Default launcher application.
*/
public class Launcher extends StatefulActivity<LauncherState> implements LauncherExterns,
- Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin> {
+ Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin>,
+ LauncherOverlayCallbacks {
public static final String TAG = "Launcher";
public static final ActivityTracker<Launcher> ACTIVITY_TRACKER = new ActivityTracker<>();
@@ -622,7 +623,7 @@
@Override
public void setLauncherOverlay(LauncherOverlay overlay) {
if (overlay != null) {
- overlay.setOverlayCallbacks(new LauncherOverlayCallbacksImpl());
+ overlay.setOverlayCallbacks(this);
}
mWorkspace.setLauncherOverlay(overlay);
}
@@ -1126,12 +1127,15 @@
mAppWidgetHost.setActivityResumed(false);
}
- class LauncherOverlayCallbacksImpl implements LauncherOverlayCallbacks {
-
- public void onScrollChanged(float progress) {
- if (mWorkspace != null) {
- mWorkspace.onOverlayScrollChanged(progress);
- }
+ /**
+ * {@code LauncherOverlayCallbacks} scroll amount.
+ * Indicates transition progress to -1 screen.
+ * @param progress From 0 to 1.
+ */
+ @Override
+ public void onScrollChanged(float progress) {
+ if (mWorkspace != null) {
+ mWorkspace.onOverlayScrollChanged(progress);
}
}
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index faf2dd2..5200456 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -198,7 +198,6 @@
private final int[] mTempXY = new int[2];
private final float[] mTempFXY = new float[2];
@Thunk float[] mDragViewVisualCenter = new float[2];
- private final float[] mTempTouchCoordinates = new float[2];
private SpringLoadedDragController mSpringLoadedDragController;
@@ -208,8 +207,6 @@
private boolean mStripScreensOnPageStopMoving = false;
- private DragPreviewProvider mOutlineProvider = null;
-
private boolean mWorkspaceFadeInAdjacentScreens;
final WallpaperOffsetInterpolator mWallpaperOffset;
@@ -494,7 +491,6 @@
});
mDragInfo = null;
- mOutlineProvider = null;
mDragSourceInternal = null;
}
@@ -1333,11 +1329,7 @@
position[0], position[1], 0, null);
}
- public void prepareDragWithProvider(DragPreviewProvider outlineProvider) {
- mOutlineProvider = outlineProvider;
- }
-
- private void onStartStateTransition(LauncherState state) {
+ private void onStartStateTransition() {
mIsSwitchingState = true;
mTransitionProgress = 0;
@@ -1358,7 +1350,7 @@
*/
@Override
public void setState(LauncherState toState) {
- onStartStateTransition(toState);
+ onStartStateTransition();
mStateTransitionAnimation.setState(toState);
onEndStateTransition();
}
@@ -1369,7 +1361,7 @@
@Override
public void setStateWithAnimation(
LauncherState toState, StateAnimationConfig config, PendingAnimation animation) {
- StateTransitionListener listener = new StateTransitionListener(toState);
+ StateTransitionListener listener = new StateTransitionListener();
mStateTransitionAnimation.setStateWithAnimation(toState, config, animation);
// Invalidate the pages now, so that we have the visible pages before the
@@ -1478,8 +1470,6 @@
icon.clearPressedBackground();
}
- mOutlineProvider = previewProvider;
-
if (draggableView == null && child instanceof DraggableView) {
draggableView = (DraggableView) child;
}
@@ -1791,17 +1781,14 @@
int snapScreen = -1;
boolean resizeOnDrop = false;
+ Runnable onCompleteRunnable = null;
if (d.dragSource != this || mDragInfo == null) {
final int[] touchXY = new int[] { (int) mDragViewVisualCenter[0],
(int) mDragViewVisualCenter[1] };
onDropExternal(touchXY, dropTargetLayout, d);
} else {
final View cell = mDragInfo.cell;
- final DragView dragView = d.dragView;
boolean droppedOnOriginalCellDuringTransition = false;
- Runnable onCompleteRunnable = dragView::resumeColorExtraction;
-
- dragView.disableColorExtraction();
if (dropTargetLayout != null && !d.cancelled) {
// Move internally
@@ -1912,9 +1899,7 @@
AppWidgetProviderInfo pInfo = hostView.getAppWidgetInfo();
if (pInfo != null && pInfo.resizeMode != AppWidgetProviderInfo.RESIZE_NONE
&& !options.isAccessibleDrag) {
- final Runnable previousRunnable = onCompleteRunnable;
onCompleteRunnable = () -> {
- previousRunnable.run();
if (!isPageInTransition()) {
AppWidgetResizeFrame.showForWidget(hostView, cellLayout);
}
@@ -1983,7 +1968,7 @@
parent.onDropChild(cell);
mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY,
- forSuccessCallback(onCompleteRunnable));
+ onCompleteRunnable == null ? null : forSuccessCallback(onCompleteRunnable));
mStatsLogManager.logger().withItemInfo(d.dragInfo).withInstanceId(d.logInstanceId)
.log(LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED);
}
@@ -2301,25 +2286,16 @@
int nextPage = getNextPage();
if (layout == null && !isPageInTransition()) {
- // Check if the item is dragged over currentPage - 1 page
- mTempTouchCoordinates[0] = Math.min(centerX, d.x);
- mTempTouchCoordinates[1] = d.y;
- layout = verifyInsidePage(nextPage + (mIsRtl ? 1 : -1), mTempTouchCoordinates);
+ layout = verifyInsidePage(nextPage + (mIsRtl ? 1 : -1), Math.min(centerX, d.x), d.y);
}
if (layout == null && !isPageInTransition()) {
- // Check if the item is dragged over currentPage + 1 page
- mTempTouchCoordinates[0] = Math.max(centerX, d.x);
- mTempTouchCoordinates[1] = d.y;
- layout = verifyInsidePage(nextPage + (mIsRtl ? -1 : 1), mTempTouchCoordinates);
+ layout = verifyInsidePage(nextPage + (mIsRtl ? -1 : 1), Math.max(centerX, d.x), d.y);
}
// If two panel is enabled, users can also drag items to currentPage + 2
if (isTwoPanelEnabled() && layout == null && !isPageInTransition()) {
- // Check if the item is dragged over currentPage + 2 page
- mTempTouchCoordinates[0] = Math.max(centerX, d.x);
- mTempTouchCoordinates[1] = d.y;
- layout = verifyInsidePage(nextPage + (mIsRtl ? -2 : 2), mTempTouchCoordinates);
+ layout = verifyInsidePage(nextPage + (mIsRtl ? -2 : 2), Math.max(centerX, d.x), d.y);
}
// Always pick the current page.
@@ -2337,12 +2313,11 @@
/**
* Returns the child CellLayout if the point is inside the page coordinates, null otherwise.
*/
- private CellLayout verifyInsidePage(int pageNo, float[] touchXy) {
+ private CellLayout verifyInsidePage(int pageNo, float x, float y) {
if (pageNo >= 0 && pageNo < getPageCount()) {
CellLayout cl = (CellLayout) getChildAt(pageNo);
- mapPointFromSelfToChild(cl, touchXy);
- if (touchXy[0] >= 0 && touchXy[0] <= cl.getWidth() &&
- touchXy[1] >= 0 && touchXy[1] <= cl.getHeight()) {
+ if (x >= cl.getLeft() && x <= cl.getRight()
+ && y >= cl.getTop() && y <= cl.getBottom()) {
// This point is inside the cell layout
return cl;
}
@@ -3341,12 +3316,6 @@
private class StateTransitionListener extends AnimatorListenerAdapter
implements AnimatorUpdateListener {
- private final LauncherState mToState;
-
- StateTransitionListener(LauncherState toState) {
- mToState = toState;
- }
-
@Override
public void onAnimationUpdate(ValueAnimator anim) {
mTransitionProgress = anim.getAnimatedFraction();
@@ -3354,7 +3323,7 @@
@Override
public void onAnimationStart(Animator animation) {
- onStartStateTransition(mToState);
+ onStartStateTransition();
}
@Override
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java
index f2ab96c..57d6cc3 100644
--- a/src/com/android/launcher3/dragndrop/DragView.java
+++ b/src/com/android/launcher3/dragndrop/DragView.java
@@ -23,6 +23,8 @@
import static com.android.launcher3.Utilities.getBadge;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
@@ -63,7 +65,6 @@
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.BaseDragLayer;
-import com.android.launcher3.widget.LauncherAppWidgetHostView;
/** A custom view for rendering an icon, folder, shortcut or widget during drag-n-drop. */
public abstract class DragView<T extends Context & ActivityContext> extends FrameLayout {
@@ -94,6 +95,8 @@
private boolean mHasDrawn = false;
final ValueAnimator mAnim;
+ // Whether mAnim has started. Unlike mAnim.isStarted(), this is true even after mAnim ends.
+ private boolean mAnimStarted;
private int mLastTouchX;
private int mLastTouchY;
@@ -171,6 +174,12 @@
animation.cancel();
}
});
+ mAnim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ mAnimStarted = true;
+ }
+ });
setDragRegion(new Rect(0, 0, width, height));
@@ -289,16 +298,6 @@
mOnDragStartCallback.executeAllAndDestroy();
}
- // TODO(b/183609936): This is only for LauncherAppWidgetHostView that is rendered in a drawable.
- // Once LauncherAppWidgetHostView is directly rendered in this view, removes this method.
- @Override
- public void invalidate() {
- super.invalidate();
- if (mContent instanceof ImageView) {
- mContent.invalidate();
- }
- }
-
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(makeMeasureSpec(mWidth, EXACTLY), makeMeasureSpec(mHeight, EXACTLY));
@@ -396,6 +395,10 @@
}
}
+ public boolean isAnimationFinished() {
+ return mAnimStarted && !mAnim.isRunning();
+ }
+
/**
* Move the window containing this view.
*
@@ -474,24 +477,6 @@
}
/**
- * If the drag view uses color extraction, block it.
- */
- public void disableColorExtraction() {
- if (mContent instanceof LauncherAppWidgetHostView) {
- ((LauncherAppWidgetHostView) mContent).disableColorExtraction();
- }
- }
-
- /**
- * If the drag view uses color extraction, restores it.
- */
- public void resumeColorExtraction() {
- if (mContent instanceof LauncherAppWidgetHostView) {
- ((LauncherAppWidgetHostView) mContent).enableColorExtraction(/* updateColors= */ false);
- }
- }
-
- /**
* Removes this view from the {@link DragLayer}.
*
* <p>If the drag content is a {@link #mContent}, this call doesn't reattach the
diff --git a/src/com/android/launcher3/folder/LauncherDelegate.java b/src/com/android/launcher3/folder/LauncherDelegate.java
index e599e8c..c5b3913 100644
--- a/src/com/android/launcher3/folder/LauncherDelegate.java
+++ b/src/com/android/launcher3/folder/LauncherDelegate.java
@@ -18,8 +18,6 @@
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_CONVERTED_TO_ICON;
import android.content.Context;
-import android.graphics.Rect;
-import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.View;
@@ -38,10 +36,7 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.views.ActivityContext;
import com.android.launcher3.views.BaseDragLayer;
-import com.android.launcher3.views.BaseDragLayer.LayoutParams;
-import com.android.launcher3.widget.LocalColorExtractor;
-import java.util.Arrays;
import java.util.Optional;
import java.util.function.Consumer;
@@ -51,8 +46,6 @@
public class LauncherDelegate {
private final Launcher mLauncher;
- private final Rect mTempRect = new Rect();
- private final RectF mTempRectF = new RectF();
private LauncherDelegate(Launcher launcher) {
mLauncher = launcher;
@@ -84,15 +77,6 @@
return mLauncher;
}
- void addRectForColorExtraction(BaseDragLayer.LayoutParams lp, LocalColorExtractor target) {
- mTempRect.set(lp.x, lp.y, lp.x + lp.width, lp.y + lp.height);
- target.getExtractedRectForViewRect(mLauncher,
- mLauncher.getWorkspace().getCurrentPage(), mTempRect, mTempRectF);
- if (!mTempRectF.isEmpty()) {
- target.addLocation(Arrays.asList(mTempRectF));
- }
- }
-
boolean replaceFolderWithFinalItem(Folder folder) {
// Add the last remaining child to the workspace in place of the folder
Runnable onCompleteRunnable = new Runnable() {
@@ -215,9 +199,6 @@
folder.close(true);
return true;
}
-
- @Override
- void addRectForColorExtraction(LayoutParams lp, LocalColorExtractor target) { }
}
static LauncherDelegate from(ActivityContext context) {
diff --git a/src/com/android/launcher3/graphics/PreloadIconDrawable.java b/src/com/android/launcher3/graphics/PreloadIconDrawable.java
index e45b8f7..24d6fe5 100644
--- a/src/com/android/launcher3/graphics/PreloadIconDrawable.java
+++ b/src/com/android/launcher3/graphics/PreloadIconDrawable.java
@@ -142,7 +142,7 @@
mSystemBackgroundColor = preloadColors[PRELOAD_BACKGROUND_COLOR_INDEX];
mIsDarkMode = isDarkMode;
- setInternalProgress(info.getProgressLevel());
+ setLevel(info.getProgressLevel());
setIsStartable(info.isAppStartable());
}
diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java
index a534ee3..3bb49f5 100644
--- a/src/com/android/launcher3/popup/ArrowPopup.java
+++ b/src/com/android/launcher3/popup/ArrowPopup.java
@@ -33,7 +33,6 @@
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
-import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
@@ -50,7 +49,6 @@
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseDraggingActivity;
@@ -69,7 +67,6 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
/**
@@ -126,11 +123,8 @@
private Runnable mOnCloseCallback = () -> { };
// The rect string of the view that the arrow is attached to, in screen reference frame.
- protected String mArrowColorRectString;
private int mArrowColor;
- protected final HashMap<String, View> mViewForRect = new HashMap<>();
-
- @Nullable protected LocalColorExtractor mColorExtractor;
+ protected final List<LocalColorExtractor> mColorExtractors;
private final float mElevation;
private final int mBackgroundColor;
@@ -178,7 +172,9 @@
boolean isAboveAnotherSurface = getTopOpenViewWithType(mLauncher, TYPE_FOLDER) != null
|| mLauncher.getStateManager().getState() == LauncherState.ALL_APPS;
if (!isAboveAnotherSurface && Utilities.ATLEAST_S && ENABLE_LOCAL_COLOR_POPUPS.get()) {
- setupColorExtraction();
+ mColorExtractors = new ArrayList<>();
+ } else {
+ mColorExtractors = null;
}
if (isAboveAnotherSurface) {
@@ -323,37 +319,6 @@
return colors.get(index, mBackgroundColor);
}
- @TargetApi(Build.VERSION_CODES.S)
- private void setupColorExtraction() {
- Workspace workspace = mLauncher.findViewById(R.id.workspace);
- if (workspace == null) {
- return;
- }
-
- mColorExtractor = LocalColorExtractor.newInstance(mLauncher);
- mColorExtractor.setListener((rect, extractedColors) -> {
- String rectString = rect.toShortString();
- View v = mViewForRect.get(rectString);
- AnimatorSet colors = new AnimatorSet();
- if (v != null) {
- int newColor = getExtractedColor(extractedColors);
- setChildColor(v, newColor, colors);
- int numChildren = v instanceof ViewGroup ? ((ViewGroup) v).getChildCount() : 0;
- for (int i = 0; i < numChildren; ++i) {
- View childView = ((ViewGroup) v).getChildAt(i);
- setChildColor(childView, newColor, colors);
-
- }
- if (rectString.equals(mArrowColorRectString)) {
- mArrowColor = newColor;
- updateArrowColor();
- }
- }
- colors.setDuration(150);
- v.post(colors::start);
- });
- }
-
protected void addPreDrawForColorExtraction(Launcher launcher) {
getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
@@ -374,40 +339,55 @@
}
private void initColorExtractionLocations(Launcher launcher) {
- if (mColorExtractor == null) {
+ if (mColorExtractors == null) {
return;
}
- ArrayList<RectF> locations = new ArrayList<>();
+ Workspace workspace = launcher.getWorkspace();
+ if (workspace == null) {
+ return;
+ }
boolean firstVisibleChild = true;
+ int screenId = workspace.getScreenIdForPageIndex(workspace.getCurrentPage());
+ DragLayer dragLayer = launcher.getDragLayer();
+
+ final View[] viewAlignedWithArrow = new View[1];
+
// Order matters here, since we need the arrow to match the color of its adjacent view.
- for (View view : getChildrenForColorExtraction()) {
+ for (final View view : getChildrenForColorExtraction()) {
if (view != null && view.getVisibility() == VISIBLE) {
- RectF rf = new RectF();
- mColorExtractor.getExtractedRectForView(launcher,
- launcher.getWorkspace().getCurrentPage(), view, rf);
- if (!rf.isEmpty()) {
- locations.add(rf);
- String rectString = rf.toShortString();
- mViewForRect.put(rectString, view);
- if (mIsAboveIcon) {
- mArrowColorRectString = rectString;
- } else {
- if (firstVisibleChild) {
- mArrowColorRectString = rectString;
+ Rect pos = new Rect();
+ dragLayer.getDescendantRectRelativeToSelf(view, pos);
+ if (!pos.isEmpty()) {
+ LocalColorExtractor extractor = LocalColorExtractor.newInstance(launcher);
+ extractor.setWorkspaceLocation(pos, dragLayer, screenId);
+ extractor.setListener(extractedColors -> {
+ AnimatorSet colors = new AnimatorSet();
+ int newColor = getExtractedColor(extractedColors);
+ setChildColor(view, newColor, colors);
+ int numChildren = view instanceof ViewGroup
+ ? ((ViewGroup) view).getChildCount() : 0;
+ for (int i = 0; i < numChildren; ++i) {
+ View childView = ((ViewGroup) view).getChildAt(i);
+ setChildColor(childView, newColor, colors);
}
- }
+ if (viewAlignedWithArrow[0] == view) {
+ mArrowColor = newColor;
+ updateArrowColor();
+ }
+ colors.setDuration(150);
+ view.post(colors::start);
+ });
+ mColorExtractors.add(extractor);
- if (firstVisibleChild) {
- firstVisibleChild = false;
+ if (mIsAboveIcon || firstVisibleChild) {
+ viewAlignedWithArrow[0] = view;
}
-
+ firstVisibleChild = false;
}
}
}
- if (!locations.isEmpty()) {
- mColorExtractor.addLocation(locations);
- }
+
}
/**
@@ -807,11 +787,8 @@
getPopupContainer().removeView(this);
getPopupContainer().removeView(mArrow);
mOnCloseCallback.run();
- mArrowColorRectString = null;
- mViewForRect.clear();
- if (mColorExtractor != null) {
- mColorExtractor.removeLocations();
- mColorExtractor.setListener(null);
+ if (mColorExtractors != null) {
+ mColorExtractors.forEach(e -> e.setListener(null));
}
}
diff --git a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java
index 0313e68..f0b4ba0 100644
--- a/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/widget/LauncherAppWidgetHostView.java
@@ -19,9 +19,7 @@
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.res.Configuration;
-import android.graphics.Canvas;
import android.graphics.Rect;
-import android.graphics.RectF;
import android.os.Handler;
import android.os.SystemClock;
import android.util.SparseBooleanArray;
@@ -35,23 +33,17 @@
import android.widget.Advanceable;
import android.widget.RemoteViews;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.CheckLongPressHelper;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
-import com.android.launcher3.Workspace;
import com.android.launcher3.dragndrop.DragLayer;
-import com.android.launcher3.keyboard.ViewGroupFocusHelper;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.BaseDragLayer.TouchCompleteListener;
-import com.android.launcher3.widget.dragndrop.AppWidgetHostViewDragListener;
-
-import java.util.List;
/**
* {@inheritDoc}
@@ -60,8 +52,6 @@
implements TouchCompleteListener, View.OnLongClickListener,
LocalColorExtractor.Listener {
- private static final String LOG_TAG = "LauncherAppWidgetHostView";
-
// Related to the auto-advancing of widgets
private static final long ADVANCE_INTERVAL = 20000;
private static final long ADVANCE_STAGGER = 250;
@@ -71,9 +61,9 @@
// Maximum duration for which updates can be deferred.
private static final long UPDATE_LOCK_TIMEOUT_MILLIS = 1000;
+ private final Rect mTempRect = new Rect();
private final CheckLongPressHelper mLongPressHelper;
protected final Launcher mLauncher;
- private final Workspace mWorkspace;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mReinflateOnConfigChange;
@@ -85,24 +75,14 @@
private boolean mIsAttachedToWindow;
private boolean mIsAutoAdvanceRegistered;
private Runnable mAutoAdvanceRunnable;
- private RectF mLastLocationRegistered = null;
- // Used to store the widget sizes in drag layer coordinates.
- private final Rect mCurrentWidgetSize = new Rect();
- private final Rect mWidgetSizeAtDrag = new Rect();
-
- private final RectF mTempRectF = new RectF();
- private final Object mUpdateLock = new Object();
- private final ViewGroupFocusHelper mDragLayerRelativeCoordinateHelper;
private long mDeferUpdatesUntilMillis = 0;
private RemoteViews mDeferredRemoteViews;
private boolean mHasDeferredColorChange = false;
private @Nullable SparseIntArray mDeferredColorChange = null;
- private boolean mEnableColorExtraction = true;
// The following member variables are only used during drag-n-drop.
private boolean mIsInDragMode = false;
- @Nullable private AppWidgetHostViewDragListener mDragListener;
/** The drag content width which is only set when the drag content scale is not 1f. */
private int mDragContentWidth = 0;
/** The drag content height which is only set when the drag content scale is not 1f. */
@@ -111,7 +91,6 @@
public LauncherAppWidgetHostView(Context context) {
super(context);
mLauncher = Launcher.getLauncher(context);
- mWorkspace = mLauncher.getWorkspace();
mLongPressHelper = new CheckLongPressHelper(this, this);
setAccessibilityDelegate(mLauncher.getAccessibilityDelegate());
setBackgroundResource(R.drawable.widget_internal_focus_bg);
@@ -120,9 +99,6 @@
setOnLightBackground(true);
}
mColorExtractor = LocalColorExtractor.newInstance(getContext());
- mColorExtractor.setListener(this);
-
- mDragLayerRelativeCoordinateHelper = new ViewGroupFocusHelper(mLauncher.getDragLayer());
}
@Override
@@ -135,14 +111,6 @@
}
@Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- if (mIsInDragMode && mDragListener != null) {
- mDragListener.onDragContentChanged();
- }
- }
-
- @Override
public boolean onLongClick(View view) {
if (mIsScrollable) {
DragLayer dragLayer = mLauncher.getDragLayer();
@@ -154,13 +122,11 @@
@Override
public void updateAppWidget(RemoteViews remoteViews) {
- synchronized (mUpdateLock) {
- if (isDeferringUpdates()) {
- mDeferredRemoteViews = remoteViews;
- return;
- }
- mDeferredRemoteViews = null;
+ if (isDeferringUpdates()) {
+ mDeferredRemoteViews = remoteViews;
+ return;
}
+ mDeferredRemoteViews = null;
super.updateAppWidget(remoteViews);
@@ -211,9 +177,7 @@
* {@link #onColorsChanged} call after {@link #UPDATE_LOCK_TIMEOUT_MILLIS} have elapsed.
*/
public void beginDeferringUpdates() {
- synchronized (mUpdateLock) {
- mDeferUpdatesUntilMillis = SystemClock.uptimeMillis() + UPDATE_LOCK_TIMEOUT_MILLIS;
- }
+ mDeferUpdatesUntilMillis = SystemClock.uptimeMillis() + UPDATE_LOCK_TIMEOUT_MILLIS;
}
/**
@@ -225,20 +189,19 @@
RemoteViews remoteViews;
SparseIntArray deferredColors;
boolean hasDeferredColors;
- synchronized (mUpdateLock) {
- mDeferUpdatesUntilMillis = 0;
- remoteViews = mDeferredRemoteViews;
- mDeferredRemoteViews = null;
- deferredColors = mDeferredColorChange;
- hasDeferredColors = mHasDeferredColorChange;
- mDeferredColorChange = null;
- mHasDeferredColorChange = false;
- }
+ mDeferUpdatesUntilMillis = 0;
+ remoteViews = mDeferredRemoteViews;
+ mDeferredRemoteViews = null;
+ deferredColors = mDeferredColorChange;
+ hasDeferredColors = mHasDeferredColorChange;
+ mDeferredColorChange = null;
+ mHasDeferredColorChange = false;
+
if (remoteViews != null) {
updateAppWidget(remoteViews);
}
if (hasDeferredColors) {
- onColorsChanged(null /* rectF */, deferredColors);
+ onColorsChanged(deferredColors);
}
}
@@ -263,13 +226,9 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
-
mIsAttachedToWindow = true;
checkIfAutoAdvance();
-
- if (mLastLocationRegistered != null) {
- mColorExtractor.addLocation(List.of(mLastLocationRegistered));
- }
+ mColorExtractor.setListener(this);
}
@Override
@@ -280,7 +239,7 @@
// state is updated. So isAttachedToWindow() will return true until next frame.
mIsAttachedToWindow = false;
checkIfAutoAdvance();
- mColorExtractor.removeLocations();
+ mColorExtractor.setListener(null);
}
@Override
@@ -311,9 +270,13 @@
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
-
mIsScrollable = checkScrollableRecursively(this);
- updateColorExtraction();
+
+ if (!mIsInDragMode && getTag() instanceof LauncherAppWidgetInfo) {
+ LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) getTag();
+ mTempRect.set(left, top, right, bottom);
+ mColorExtractor.setWorkspaceLocation(mTempRect, (View) getParent(), info.screenId);
+ }
}
@Override
@@ -327,9 +290,8 @@
}
/** Starts the drag mode. */
- public void startDrag(AppWidgetHostViewDragListener dragListener) {
+ public void startDrag() {
mIsInDragMode = true;
- mDragListener = dragListener;
// In the case of dragging a scaled preview from widgets picker, we should reuse the
// previously measured dimension from WidgetCell#measureAndComputeWidgetPreviewScale, which
// measures the dimension of a widget preview without its parent's bound before scaling
@@ -340,98 +302,30 @@
}
}
- /** Handles a drag event occurred on a workspace page, {@code pageId}. */
- public void handleDrag(Rect rectInDragLayer, int pageId) {
- mWidgetSizeAtDrag.set(rectInDragLayer);
- updateColorExtraction(mWidgetSizeAtDrag, pageId);
+ /** Handles a drag event occurred on a workspace page corresponding to the {@code screenId}. */
+ public void handleDrag(Rect rectInView, View view, int screenId) {
+ if (mIsInDragMode) {
+ mColorExtractor.setWorkspaceLocation(rectInView, view, screenId);
+ }
}
/** Ends the drag mode. */
public void endDrag() {
mIsInDragMode = false;
- mDragListener = null;
mDragContentWidth = 0;
mDragContentHeight = 0;
- mWidgetSizeAtDrag.setEmpty();
- }
-
- /**
- * @param rectInDragLayer Rect of widget in drag layer coordinates.
- * @param pageId The workspace page the widget is on.
- */
- private void updateColorExtraction(Rect rectInDragLayer, int pageId) {
- if (!mEnableColorExtraction) return;
- mColorExtractor.getExtractedRectForViewRect(mLauncher, pageId, rectInDragLayer, mTempRectF);
-
- if (mTempRectF.isEmpty()) {
- return;
- }
- if (!isSameLocation(mTempRectF, mLastLocationRegistered, /* epsilon= */ 1e-6f)) {
- if (mLastLocationRegistered != null) {
- mColorExtractor.removeLocations();
- }
- mLastLocationRegistered = new RectF(mTempRectF);
- mColorExtractor.addLocation(List.of(mLastLocationRegistered));
- }
- }
-
- /**
- * Update the color extraction, using the current position of the app widget.
- */
- private void updateColorExtraction() {
- if (!mIsInDragMode && getTag() instanceof LauncherAppWidgetInfo) {
- LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) getTag();
- mDragLayerRelativeCoordinateHelper.viewToRect(this, mCurrentWidgetSize);
- updateColorExtraction(mCurrentWidgetSize,
- mWorkspace.getPageIndexForScreenId(info.screenId));
- }
- }
-
- /**
- * Enables the local color extraction.
- *
- * @param updateColors If true, this will update the color extraction using the current location
- * of the App Widget.
- */
- public void enableColorExtraction(boolean updateColors) {
- mEnableColorExtraction = true;
- if (updateColors) {
- updateColorExtraction();
- }
- }
-
- /**
- * Disables the local color extraction.
- */
- public void disableColorExtraction() {
- mEnableColorExtraction = false;
- }
-
- // Compare two location rectangles. Locations are always in the [0;1] range.
- private static boolean isSameLocation(@NonNull RectF rect1, @Nullable RectF rect2,
- float epsilon) {
- if (rect2 == null) return false;
- return isSameCoordinate(rect1.left, rect2.left, epsilon)
- && isSameCoordinate(rect1.right, rect2.right, epsilon)
- && isSameCoordinate(rect1.top, rect2.top, epsilon)
- && isSameCoordinate(rect1.bottom, rect2.bottom, epsilon);
- }
-
- private static boolean isSameCoordinate(float c1, float c2, float epsilon) {
- return Math.abs(c1 - c2) < epsilon;
+ requestLayout();
}
@Override
- public void onColorsChanged(RectF rectF, SparseIntArray colors) {
- synchronized (mUpdateLock) {
- if (isDeferringUpdates()) {
- mDeferredColorChange = colors;
- mHasDeferredColorChange = true;
- return;
- }
- mDeferredColorChange = null;
- mHasDeferredColorChange = false;
+ public void onColorsChanged(SparseIntArray colors) {
+ if (isDeferringUpdates()) {
+ mDeferredColorChange = colors;
+ mHasDeferredColorChange = true;
+ return;
}
+ mDeferredColorChange = null;
+ mHasDeferredColorChange = false;
// setColorResources will reapply the view, which must happen in the UI thread.
post(() -> setColorResources(colors));
diff --git a/src/com/android/launcher3/widget/LocalColorExtractor.java b/src/com/android/launcher3/widget/LocalColorExtractor.java
index 23d9e15..96e7531 100644
--- a/src/com/android/launcher3/widget/LocalColorExtractor.java
+++ b/src/com/android/launcher3/widget/LocalColorExtractor.java
@@ -20,18 +20,14 @@
import android.appwidget.AppWidgetHostView;
import android.content.Context;
import android.graphics.Rect;
-import android.graphics.RectF;
import android.util.SparseIntArray;
import android.view.View;
import androidx.annotation.Nullable;
-import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.util.ResourceBasedOverride;
-import java.util.List;
-
/** Extracts the colors we need from the wallpaper at given locations. */
public class LocalColorExtractor implements ResourceBasedOverride {
@@ -44,7 +40,7 @@
* their value, in a format that can be passed directly to
* {@link AppWidgetHostView#setColorResources(SparseIntArray)}.
*/
- void onColorsChanged(RectF rect, SparseIntArray extractedColors);
+ void onColorsChanged(SparseIntArray extractedColors);
}
/**
@@ -60,15 +56,13 @@
// no-op
}
- /** Adds a list of locations to track with this listener. */
- public void addLocation(List<RectF> locations) {
- // no-op
- }
-
- /** Stops tracking any locations. */
- public void removeLocations() {
- // no-op
- }
+ /**
+ * Sets the location used for color extraction
+ * @param pos position to use for color extraction
+ * @param child view whose coordinate space is used for {@code pos}
+ * @param screenId the workspace screenId
+ */
+ public void setWorkspaceLocation(Rect pos, View child, int screenId) { }
/**
* Updates the base context to contain the colors override
@@ -83,32 +77,4 @@
return null;
}
- /**
- * Takes a view and returns its rect that can be used by the wallpaper local color extractor.
- *
- * @param launcher Launcher class class.
- * @param pageId The page the workspace item is on.
- * @param v The view.
- * @param colorExtractionRectOut The location rect, but converted to a format expected by the
- * wallpaper local color extractor.
- */
- public void getExtractedRectForView(Launcher launcher, int pageId, View v,
- RectF colorExtractionRectOut) {
- // no-op
- }
-
- /**
- * Takes a rect in drag layer coordinates and returns the rect that can be used by the wallpaper
- * local color extractor.
- *
- * @param launcher Launcher class.
- * @param pageId The page the workspace item is on.
- * @param rectInDragLayer The relevant bounds of the view in drag layer coordinates.
- * @param colorExtractionRectOut The location rect, but converted to a format expected by the
- * wallpaper local color extractor.
- */
- public void getExtractedRectForViewRect(Launcher launcher, int pageId, Rect rectInDragLayer,
- RectF colorExtractionRectOut) {
- // no-op
- }
}
diff --git a/src/com/android/launcher3/widget/PendingItemDragHelper.java b/src/com/android/launcher3/widget/PendingItemDragHelper.java
index a4003d4..991910d 100644
--- a/src/com/android/launcher3/widget/PendingItemDragHelper.java
+++ b/src/com/android/launcher3/widget/PendingItemDragHelper.java
@@ -205,10 +205,6 @@
draggableView = DraggableView.ofType(DraggableView.DRAGGABLE_ICON);
}
- // Since we are not going through the workspace for starting the drag, set drag related
- // information on the workspace before starting the drag.
- launcher.getWorkspace().prepareDragWithProvider(this);
-
int dragLayerX = screenPos.x + previewBounds.left
+ (int) ((scale * previewWidth - previewWidth) / 2);
int dragLayerY = screenPos.y + previewBounds.top
diff --git a/src/com/android/launcher3/widget/dragndrop/AppWidgetHostViewDragListener.java b/src/com/android/launcher3/widget/dragndrop/AppWidgetHostViewDragListener.java
index 4a60983..3e54b33 100644
--- a/src/com/android/launcher3/widget/dragndrop/AppWidgetHostViewDragListener.java
+++ b/src/com/android/launcher3/widget/dragndrop/AppWidgetHostViewDragListener.java
@@ -24,7 +24,6 @@
/** A drag listener of {@link LauncherAppWidgetHostView}. */
public final class AppWidgetHostViewDragListener implements DragController.DragListener {
private final Launcher mLauncher;
- private DropTarget.DragObject mDragObject;
private LauncherAppWidgetHostView mAppWidgetHostView;
public AppWidgetHostViewDragListener(Launcher launcher) {
@@ -34,9 +33,8 @@
@Override
public void onDragStart(DropTarget.DragObject dragObject, DragOptions unused) {
if (dragObject.dragView.getContentView() instanceof LauncherAppWidgetHostView) {
- mDragObject = dragObject;
mAppWidgetHostView = (LauncherAppWidgetHostView) dragObject.dragView.getContentView();
- mAppWidgetHostView.startDrag(this);
+ mAppWidgetHostView.startDrag();
} else {
mLauncher.getDragController().removeDragListener(this);
}
@@ -47,11 +45,4 @@
mAppWidgetHostView.endDrag();
mLauncher.getDragController().removeDragListener(this);
}
-
- /** Notifies when there is a content change in the drag view. */
- public void onDragContentChanged() {
- if (mDragObject.dragView != null) {
- mDragObject.dragView.invalidate();
- }
- }
}
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index 641e53a..a5694fc 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -87,7 +87,6 @@
}
@Test
- @ScreenRecord //b/192005114
public void testPinWidgetNoConfig_customPreview() throws Throwable {
// Command to set custom preview
Intent command = RequestPinItemActivity.getCommandIntent(