Merge "Removing Launcher dependency from Folders" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b32fd46c8d
@@ -491,7 +491,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
||||
List<View> viewsToAnimate = new ArrayList<>();
|
||||
|
||||
Workspace workspace = mLauncher.getWorkspace();
|
||||
workspace.getVisiblePages().forEach(
|
||||
workspace.forEachVisiblePage(
|
||||
view -> viewsToAnimate.add(((CellLayout) view).getShortcutsAndWidgets()));
|
||||
|
||||
viewsToAnimate.add(mLauncher.getHotseat());
|
||||
|
||||
@@ -16,12 +16,24 @@
|
||||
package com.android.launcher3.taskbar;
|
||||
|
||||
import android.content.ContextWrapper;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.DragSource;
|
||||
import com.android.launcher3.DropTarget;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.dragndrop.DragController;
|
||||
import com.android.launcher3.dragndrop.DragOptions;
|
||||
import com.android.launcher3.dragndrop.DragView;
|
||||
import com.android.launcher3.dragndrop.DraggableView;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
import com.android.launcher3.views.BaseDragLayer;
|
||||
|
||||
@@ -35,6 +47,7 @@ public class TaskbarActivityContext extends ContextWrapper implements ActivityCo
|
||||
private final DeviceProfile mDeviceProfile;
|
||||
private final LayoutInflater mLayoutInflater;
|
||||
private final TaskbarContainerView mTaskbarContainerView;
|
||||
private final MyDragController mDragController;
|
||||
|
||||
public TaskbarActivityContext(BaseQuickstepLauncher launcher) {
|
||||
super(launcher);
|
||||
@@ -47,6 +60,7 @@ public class TaskbarActivityContext extends ContextWrapper implements ActivityCo
|
||||
|
||||
mTaskbarContainerView = (TaskbarContainerView) mLayoutInflater
|
||||
.inflate(R.layout.taskbar, null, false);
|
||||
mDragController = new MyDragController(this);
|
||||
}
|
||||
|
||||
public TaskbarContainerView getTaskbarContainerView() {
|
||||
@@ -72,4 +86,31 @@ public class TaskbarActivityContext extends ContextWrapper implements ActivityCo
|
||||
public Rect getFolderBoundingBox() {
|
||||
return mTaskbarContainerView.getFolderBoundingBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragController getDragController() {
|
||||
return mDragController;
|
||||
}
|
||||
|
||||
private static class MyDragController extends DragController<TaskbarActivityContext> {
|
||||
MyDragController(TaskbarActivityContext activity) {
|
||||
super(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DragView startDrag(@Nullable Drawable drawable, @Nullable View view,
|
||||
DraggableView originalView, int dragLayerX, int dragLayerY, DragSource source,
|
||||
ItemInfo dragInfo, Point dragOffset, Rect dragRegion, float initialDragViewScale,
|
||||
float dragViewScaleOnDrop, DragOptions options) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void exitDrag() { }
|
||||
|
||||
@Override
|
||||
protected DropTarget getDefaultDropTarget(int[] dropCoordinates) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,8 +89,7 @@ public class StaggeredWorkspaceAnim {
|
||||
int totalRows = grid.inv.numRows + (grid.isVerticalBarLayout() ? 0 : 2);
|
||||
|
||||
// Add animation for all the visible workspace pages
|
||||
workspace.getVisiblePages()
|
||||
.forEach(page -> addAnimationForPage((CellLayout) page, totalRows));
|
||||
workspace.forEachVisiblePage(page -> addAnimationForPage((CellLayout) page, totalRows));
|
||||
|
||||
boolean workspaceClipChildren = workspace.getClipChildren();
|
||||
boolean workspaceClipToPadding = workspace.getClipToPadding();
|
||||
|
||||
Reference in New Issue
Block a user