Merge branch 'heads/android-14.0.0_r18' into 14-dev
This commit is contained in:
@@ -71,9 +71,9 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.app.animation.Interpolators;
|
||||
import com.android.launcher3.accessibility.AccessibleDragListenerAdapter;
|
||||
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.celllayout.CellLayoutLayoutParams;
|
||||
import com.android.launcher3.celllayout.CellPosMapper;
|
||||
@@ -620,9 +620,9 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
// animation.
|
||||
// This prevents empty adjacent pages to overlay during animation
|
||||
mLayoutTransition.setInterpolator(LayoutTransition.DISAPPEARING,
|
||||
Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0, 0.5f));
|
||||
Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0, 0.5f));
|
||||
mLayoutTransition.setInterpolator(LayoutTransition.CHANGE_DISAPPEARING,
|
||||
Interpolators.clampToProgress(Interpolators.ACCEL_DEACCEL, 0.5f, 1));
|
||||
Interpolators.clampToProgress(Interpolators.ACCELERATE_DECELERATE, 0.5f, 1));
|
||||
|
||||
mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING);
|
||||
mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
|
||||
@@ -803,6 +803,13 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the given screenId is already in the Workspace
|
||||
*/
|
||||
public boolean containsScreenId(int screenId) {
|
||||
return this.mWorkspaceScreens.containsKey(screenId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts extra empty pages to the end of the existing workspaces.
|
||||
* Usually we add one extra empty screen, but when two panel home is enabled we
|
||||
@@ -982,9 +989,8 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
mWorkspaceScreens.remove(emptyScreenId);
|
||||
mScreenOrder.removeValue(emptyScreenId);
|
||||
|
||||
int newScreenId = LauncherSettings.Settings.call(getContext().getContentResolver(),
|
||||
LauncherSettings.Settings.METHOD_NEW_SCREEN_ID)
|
||||
.getInt(LauncherSettings.Settings.EXTRA_VALUE);
|
||||
int newScreenId = LauncherAppState.getInstance(getContext())
|
||||
.getModel().getModelDbController().getNewScreenId();
|
||||
// Launcher database isn't aware of empty pages that are already bound, so we
|
||||
// need to
|
||||
// skip those IDs manually.
|
||||
@@ -1835,6 +1841,15 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (dragOptions.preDragCondition != null) {
|
||||
int xDragOffSet = dragOptions.preDragCondition.getDragOffset().x;
|
||||
int yDragOffSet = dragOptions.preDragCondition.getDragOffset().y;
|
||||
if (xDragOffSet != 0 || yDragOffSet != 0) {
|
||||
dragLayerX += xDragOffSet;
|
||||
dragLayerY += yDragOffSet;
|
||||
}
|
||||
}
|
||||
|
||||
final DragView dv;
|
||||
if (contentView instanceof View) {
|
||||
if (contentView instanceof LauncherAppWidgetHostView) {
|
||||
@@ -1976,7 +1991,6 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
&& ((WorkspaceItemInfo) dropOverView
|
||||
.getTag()).container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION);
|
||||
boolean willBecomeShortcut = (info.itemType == ITEM_TYPE_APPLICATION ||
|
||||
info.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT ||
|
||||
info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT);
|
||||
|
||||
return (aboveShortcut && willBecomeShortcut);
|
||||
@@ -2917,7 +2931,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
final PendingAddItemInfo pendingInfo = (PendingAddItemInfo) info;
|
||||
|
||||
boolean findNearestVacantCell = true;
|
||||
if (pendingInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) {
|
||||
if (pendingInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
|
||||
mTargetCell = findNearestArea(touchXY[0], touchXY[1], spanX, spanY,
|
||||
cellLayout, mTargetCell);
|
||||
float distance = cellLayout.getDistanceFromWorkspaceCellVisualCenter(
|
||||
@@ -2989,8 +3003,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
View view;
|
||||
|
||||
switch (info.itemType) {
|
||||
case ITEM_TYPE_APPLICATION:
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT:
|
||||
case LauncherSettings.Favorites.ITEM_TYPE_SEARCH_ACTION:
|
||||
if (info instanceof WorkspaceItemFactory) {
|
||||
|
||||
Reference in New Issue
Block a user