summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util/CellAndSpan.java
blob: 3a0a6cdca94a76efa6f01454ad8bd524a510abfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.android.launcher3.util;

/**
 * Base class which represents an area on the grid.
 */
public class CellAndSpan {

    /**
     * Indicates the X position of the associated cell.
     */
    public int cellX = -1;

    /**
     * Indicates the Y position of the associated cell.
     */
    public int cellY = -1;

    /**
     * Indicates the X cell span.
     */
    public int spanX = 1;

    /**
     * Indicates the Y cell span.
     */
    public int spanY = 1;

    public CellAndSpan() {
    }

    public void copyFrom(CellAndSpan copy) {
        cellX = copy.cellX;
        cellY = copy.cellY;
        spanX = copy.spanX;
        spanY = copy.spanY;
    }

    public CellAndSpan(int cellX, int cellY, int spanX, int spanY) {
        this.cellX = cellX;
        this.cellY = cellY;
        this.spanX = spanX;
        this.spanY = spanY;
    }

    public String toString() {
        return "(" + cellX + ", " + cellY + ": " + spanX + ", " + spanY + ")";
    }
}