use of com.android.launcher3.util.CellAndSpan in project android_packages_apps_Launcher3 by crdroidandroid.
the class CellLayout method addViewToTempLocation.
private boolean addViewToTempLocation(View v, Rect rectOccupiedByPotentialDrop, int[] direction, ItemConfiguration currentState) {
CellAndSpan c = currentState.map.get(v);
boolean success = false;
mTmpOccupied.markCells(c, false);
mTmpOccupied.markCells(rectOccupiedByPotentialDrop, true);
findNearestArea(c.cellX, c.cellY, c.spanX, c.spanY, direction, mTmpOccupied.cells, null, mTempLocation);
if (mTempLocation[0] >= 0 && mTempLocation[1] >= 0) {
c.cellX = mTempLocation[0];
c.cellY = mTempLocation[1];
success = true;
}
mTmpOccupied.markCells(c, true);
return success;
}
use of com.android.launcher3.util.CellAndSpan in project android_packages_apps_Launcher3 by crdroidandroid.
the class CellLayout method animateItemsToSolution.
private void animateItemsToSolution(ItemConfiguration solution, View dragView, boolean commitDragView) {
GridOccupancy occupied = DESTRUCTIVE_REORDER ? mOccupied : mTmpOccupied;
occupied.clear();
int childCount = mShortcutsAndWidgets.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = mShortcutsAndWidgets.getChildAt(i);
if (child == dragView)
continue;
CellAndSpan c = solution.map.get(child);
if (c != null) {
animateChildToPosition(child, c.cellX, c.cellY, REORDER_ANIMATION_DURATION, 0, DESTRUCTIVE_REORDER, false);
occupied.markCells(c, true);
}
}
if (commitDragView) {
occupied.markCells(solution, true);
}
}
use of com.android.launcher3.util.CellAndSpan in project android_packages_apps_Launcher3 by crdroidandroid.
the class CellLayout method copySolutionToTempState.
private void copySolutionToTempState(ItemConfiguration solution, View dragView) {
mTmpOccupied.clear();
int childCount = mShortcutsAndWidgets.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = mShortcutsAndWidgets.getChildAt(i);
if (child == dragView)
continue;
LayoutParams lp = (LayoutParams) child.getLayoutParams();
CellAndSpan c = solution.map.get(child);
if (c != null) {
lp.tmpCellX = c.cellX;
lp.tmpCellY = c.cellY;
lp.cellHSpan = c.spanX;
lp.cellVSpan = c.spanY;
mTmpOccupied.markCells(c, true);
}
}
mTmpOccupied.markCells(solution, true);
}
Aggregations