Change the access of cellX/Y of CellLayoutLayoutParams to private
Cherry pick needed for changes on workspace lily Bug: 188081026 Test: no op change, should compile Test: ReorderWidgets Change-Id: I20367974e5a4cead406e18eb66dafd4d59651b2a
This commit is contained in:
1 parent
927a806dff
commit
a955403ba9
11 files changed
+136
-85
No files matched your search
@@ -1757,7 +1757,8 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
boolean willCreateUserFolder(ItemInfo info, View dropOverView, boolean considerTimeout) {
|
||||
if (dropOverView != null) {
|
||||
CellLayoutLayoutParams lp = (CellLayoutLayoutParams) dropOverView.getLayoutParams();
|
||||
if (lp.useTmpCoords && (lp.tmpCellX != lp.cellX || lp.tmpCellY != lp.cellY)) {
|
||||
if (lp.useTmpCoords && (lp.getTmpCellX() != lp.getCellX()
|
||||
|| lp.getTmpCellY() != lp.getCellY())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1792,7 +1793,8 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
boolean willAddToExistingUserFolder(ItemInfo dragInfo, View dropOverView) {
|
||||
if (dropOverView != null) {
|
||||
CellLayoutLayoutParams lp = (CellLayoutLayoutParams) dropOverView.getLayoutParams();
|
||||
if (lp.useTmpCoords && (lp.tmpCellX != lp.cellX || lp.tmpCellY != lp.cellY)) {
|
||||
if (lp.useTmpCoords && (lp.getTmpCellX() != lp.getCellX()
|
||||
|| lp.getTmpCellY() != lp.getCellY())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2009,8 +2011,10 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
|
||||
// update the item's position after drop
|
||||
CellLayoutLayoutParams lp = (CellLayoutLayoutParams) cell.getLayoutParams();
|
||||
lp.cellX = lp.tmpCellX = mTargetCell[0];
|
||||
lp.cellY = lp.tmpCellY = mTargetCell[1];
|
||||
lp.setTmpCellX(mTargetCell[0]);
|
||||
lp.setCellX(mTargetCell[0]);
|
||||
lp.setTmpCellY(mTargetCell[1]);
|
||||
lp.setCellY(mTargetCell[1]);
|
||||
lp.cellHSpan = item.spanX;
|
||||
lp.cellVSpan = item.spanY;
|
||||
lp.isLockedToGrid = true;
|
||||
@@ -2024,7 +2028,7 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
(LauncherAppWidgetHostView) cell, dropTargetLayout);
|
||||
}
|
||||
mLauncher.getModelWriter().modifyItemInDatabase(info, container, screenId,
|
||||
lp.cellX, lp.cellY, item.spanX, item.spanY);
|
||||
lp.getCellX(), lp.getCellY(), item.spanX, item.spanY);
|
||||
} else {
|
||||
if (!returnToOriginalCellToPreventShuffling) {
|
||||
onNoCellFound(dropTargetLayout, d.dragInfo, d.logInstanceId);
|
||||
@@ -2035,8 +2039,8 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
|
||||
// If we can't find a drop location, we return the item to its original position
|
||||
CellLayoutLayoutParams lp = (CellLayoutLayoutParams) cell.getLayoutParams();
|
||||
mTargetCell[0] = lp.cellX;
|
||||
mTargetCell[1] = lp.cellY;
|
||||
mTargetCell[0] = lp.getCellX();
|
||||
mTargetCell[1] = lp.getCellY();
|
||||
CellLayout layout = (CellLayout) cell.getParent().getParent();
|
||||
layout.markCellsAsOccupiedForView(cell);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user