Lines Matching refs:spanX

754     void regionToCenterPoint(int cellX, int cellY, int spanX, int spanY, int[] result) {
758 (spanX * mCellWidth + (spanX - 1) * mWidthGap) / 2;
770 void regionToRect(int cellX, int cellY, int spanX, int spanY, Rect result) {
775 result.set(left, top, left + (spanX * mCellWidth + (spanX - 1) * mWidthGap),
1018 int cellY, int spanX, int spanY, boolean resize, Point dragOffset, Rect dragRegion) {
1048 left += ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap)
1054 left += dragOffset.x + ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap)
1061 left += ((mCellWidth * spanX) + ((spanX - 1) * mWidthGap)
1073 cellToRect(cellX, cellY, spanX, spanY, r);
1093 * @param spanX Horizontal span of the object.
1100 int[] findNearestVacantArea(int pixelX, int pixelY, int spanX, int spanY, int[] result) {
1101 return findNearestVacantArea(pixelX, pixelY, spanX, spanY, spanX, spanY, result, null);
1112 * @param spanX Horizontal span of the object.
1119 int[] findNearestVacantArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX,
1121 return findNearestArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, true,
1148 * @param spanX Horizontal span of the object.
1156 private int[] findNearestArea(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX,
1160 // For items with a spanX / spanY > 1, the passed in point (pixelX, pixelY) corresponds
1163 pixelX -= (mCellWidth + mWidthGap) * (spanX - 1) / 2f;
1175 if (minSpanX <= 0 || minSpanY <= 0 || spanX <= 0 || spanY <= 0 ||
1176 spanX < minSpanX || spanY < minSpanY) {
1201 boolean hitMaxX = xSize >= spanX;
1225 hitMaxX |= xSize >= spanX;
1230 hitMaxX = xSize >= spanX;
1282 * @param spanX Horizontal span of the object.
1289 * cellY, spanX, spanY) are occupied. This is used when try to move a group of views.
1295 private int[] findNearestArea(int cellX, int cellY, int spanX, int spanY, int[] direction,
1307 for (int x = 0; x < countX - (spanX - 1); x++) {
1309 for (int i = 0; i < spanX; i++) {
1350 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false);
1353 findNearestArea(c.x, c.y, c.spanX, c.spanY, direction, mTmpOccupied, null, mTempLocation);
1360 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true);
1423 int right = cs.x + cs.spanX;
1432 for (int j = cs.x; j < cs.x + cs.spanX; j++) {
1440 for (int j = cs.x; j < cs.x + cs.spanX; j++) {
1458 if (edge[i] == cs.x + cs.spanX) {
1471 for (int i = cs.x; i < cs.x + cs.spanX; i++) {
1478 for (int i = cs.x; i < cs.x + cs.spanX; i++) {
1521 boundingRect.set(c.x, c.y, c.x + c.spanX, c.y + c.spanY);
1524 boundingRect.union(c.x, c.y, c.x + c.spanX, c.y + c.spanY);
1581 return (r.x + r.spanX) - (l.x + l.spanX);
1632 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false);
1662 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false);
1688 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true);
1704 boundingRect = new Rect(c.x, c.y, c.x + c.spanX, c.y + c.spanY);
1706 boundingRect.union(c.x, c.y, c.x + c.spanX, c.y + c.spanY);
1713 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, false);
1723 markCellsForView(c.x - left, c.y - top, c.spanX, c.spanY, blockOccupied, true);
1746 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true);
1852 private boolean rearrangementExists(int cellX, int cellY, int spanX, int spanY, int[] direction,
1858 mOccupiedRect.set(cellX, cellY, cellX + spanX, cellY + spanY);
1868 Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY);
1874 r1.set(c.x, c.y, c.x + c.spanX, c.y + c.spanY);
1934 int spanX, int spanY, int[] direction, View dragView, boolean decX,
1945 result = findNearestArea(pixelX, pixelY, spanX, spanY, result);
1950 success = rearrangementExists(result[0], result[1], spanX, spanY, direction, dragView,
1956 if (spanX > minSpanX && (minSpanY == spanY || decX)) {
1957 return findReorderSolution(pixelX, pixelY, minSpanX, minSpanY, spanX - 1, spanY,
1960 return findReorderSolution(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY - 1,
1968 solution.dragViewSpanX = spanX;
2005 lp.cellHSpan = c.spanX;
2007 markCellsForView(c.x, c.y, c.spanX, c.spanY, mTmpOccupied, true);
2032 markCellsForView(c.x, c.y, c.spanX, c.spanY, occupied, true);
2056 lp.cellY, c.x, c.y, c.spanX, c.spanY);
2083 int cellY1, int spanX, int spanY) {
2084 regionToCenterPoint(cellX0, cellY0, spanX, spanY, mTmpPoint);
2087 regionToCenterPoint(cellX1, cellY1, spanX, spanY, mTmpPoint);
2210 info.spanX != lp.cellHSpan || info.spanY != lp.cellVSpan) {
2215 info.spanX = lp.cellHSpan;
2231 int spanX, int spanY, View dragView, ItemConfiguration solution) {
2234 findNearestVacantArea(pixelX, pixelY, minSpanX, minSpanY, spanX, spanY, result,
2261 private void getDirectionVectorForDrop(int dragViewCenterX, int dragViewCenterY, int spanX,
2265 findNearestArea(dragViewCenterX, dragViewCenterY, spanX, spanY, targetDestination);
2267 regionToRect(targetDestination[0], targetDestination[1], spanX, spanY, dragRect);
2271 getViewsIntersectingRegion(targetDestination[0], targetDestination[1], spanX, spanY,
2280 int deltaX = (dropRegionRect.centerX() - dragViewCenterX) / spanX;
2283 if (dropRegionSpanX == mCountX || spanX == mCountX) {
2300 private void getViewsIntersectingRegion(int cellX, int cellY, int spanX, int spanY,
2303 boundingRect.set(cellX, cellY, cellX + spanX, cellY + spanY);
2306 Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY);
2323 boolean isNearestDropLocationOccupied(int pixelX, int pixelY, int spanX, int spanY,
2325 result = findNearestArea(pixelX, pixelY, spanX, spanY, result);
2326 getViewsIntersectingRegion(result[0], result[1], spanX, spanY, dragView, null,
2349 boolean createAreaForResize(int cellX, int cellY, int spanX, int spanY,
2352 regionToCenterPoint(cellX, cellY, spanX, spanY, pixelXY);
2355 ItemConfiguration swapSolution = findReorderSolution(pixelXY[0], pixelXY[1], spanX, spanY,
2356 spanX, spanY, direction, dragView, true, new ItemConfiguration());
2380 int[] performReorder(int pixelX, int pixelY, int minSpanX, int minSpanY, int spanX, int spanY,
2383 result = findNearestArea(pixelX, pixelY, spanX, spanY, result);
2402 getDirectionVectorForDrop(pixelX, pixelY, spanX, spanY, dragView, mDirectionVector);
2409 spanX, spanY, mDirectionVector, dragView, true, new ItemConfiguration());
2413 minSpanY, spanX, spanY, dragView, new ItemConfiguration());
2525 int spanX, spanY;
2533 copy.spanX = spanX;
2537 public CellAndSpan(int x, int y, int spanX, int spanY) {
2540 this.spanX = spanX;
2545 return "(" + x + ", " + y + ": " + spanX + ", " + spanY + ")";
2556 * @param spanX Horizontal span of the object.
2563 int[] findNearestArea(int pixelX, int pixelY, int spanX, int spanY, int[] result) {
2564 return findNearestArea(pixelX, pixelY, spanX, spanY, spanX, spanY, false, result, null);
2579 * @param spanX The horizontal span of the cell we want to find.
2584 public boolean findCellForSpan(int[] cellXY, int spanX, int spanY) {
2586 final int endX = mCountX - (spanX - 1);
2592 for (int i = 0; i < spanX; i++) {
2709 int spanX = (int) Math.ceil(width / (float) smallerSize);
2713 return new int[] { spanX, spanY };
2715 result[0] = spanX;
2735 info.spanX = info.spanY = 1;
2739 info.spanX = spans[0];
2763 private void markCellsForView(int cellX, int cellY, int spanX, int spanY, boolean[][] occupied,
2766 for (int x = cellX; x < cellX + spanX && x < mCountX; x++) {
2960 // its spanX, spanY, and the screen it is on
2968 int spanX;
2977 spanX = info.spanX;
2990 public boolean findVacantCell(int spanX, int spanY, int[] outXY) {
2991 return Utilities.findVacantCell(outXY, spanX, spanY, mCountX, mCountY, mOccupied);
2994 public boolean isRegionVacant(int x, int y, int spanX, int spanY) {
2995 int x2 = x + spanX - 1;