Home | History | Annotate | Download | only in widget

Lines Matching refs:Cell

78     private ArrayList<Cell> mPattern = new ArrayList<Cell>(9);
132 * Represents a cell in the 3 X 3 matrix of the unlock pattern view.
134 public static class Cell {
139 static Cell[][] sCells = new Cell[3][3];
143 sCells[i][j] = new Cell(i, j);
149 * @param row The row of the cell.
150 * @param column The column of the cell.
152 private Cell(int row, int column) {
167 * @param row The row of the cell.
168 * @param column The column of the cell.
170 public static synchronized Cell of(int row, int column) {
226 * The user extended the pattern currently being drawn by one cell.
227 * @param pattern The pattern with newly added cell.
229 void onPatternCellAdded(List<Cell> pattern);
235 void onPatternDetected(List<Cell> pattern);
343 public void setPattern(DisplayMode displayMode, List<Cell> pattern) {
347 for (Cell cell : pattern) {
348 mPatternDrawLookup[cell.getRow()][cell.getColumn()] = true;
368 final Cell first = mPattern.get(0);
510 * pattern (in addition to finding the cell, also makes heuristic choices
515 private Cell detectAndAddHit(float x, float y) {
516 final Cell cell = checkForNewHit(x, y);
517 if (cell != null) {
520 Cell fillInGapCell = null;
521 final ArrayList<Cell> pattern = mPattern;
523 final Cell lastCell = pattern.get(pattern.size() - 1);
524 int dRow = cell.row - lastCell.row;
525 int dColumn = cell.column - lastCell.column;
538 fillInGapCell = Cell.of(fillInRow, fillInColumn);
545 addCellToPattern(cell);
551 return cell;
556 private void addCellToPattern(Cell newCell) {
562 // helper method to find which cell a point maps to
563 private Cell checkForNewHit(float x, float y) {
577 return Cell.of(rowHit, columnHit);
685 Cell hitCell = detectAndAddHit(x, y);
699 final ArrayList<Cell> pattern = mPattern;
700 final Cell lastCell = pattern.get(patternSize - 1);
704 // Adjust for drawn segment from last cell to (x,y). Radius accounts for line width.
710 // Invalidate between the pattern's new cell and the pattern's previous cell
723 // Invalidate between the pattern's last cell and the previous location
762 final Cell hitCell = detectAndAddHit(x, y);
801 final ArrayList<Cell> pattern = mPattern;
817 final Cell cell = pattern.get(i);
818 drawLookup[cell.getRow()][cell.getColumn()] = true;
831 final Cell currentCell = pattern.get(numCircles - 1);
835 final Cell nextCell = pattern.get(numCircles);
869 // TODO: the path should be created and cached every time we hit-detect a cell
881 Cell cell = pattern.get(i);
882 Cell next = pattern.get(i + 1);
891 float leftX = paddingLeft + cell.column * squareWidth;
892 float topY = paddingTop + cell.row * squareHeight;
894 drawArrow(canvas, leftX, topY, cell, next);
901 Cell cell = pattern.get(i);
906 if (!drawLookup[cell.row][cell.column]) {
911 float centerX = getCenterXForColumn(cell.column);
912 float centerY = getCenterYForRow(cell.row);
931 private void drawArrow(Canvas canvas, float leftX, float topY, Cell start, Cell end) {
939 // offsets for centering the bitmap in the cell
958 mArrowMatrix.setTranslate(leftX + offsetX, topY + offsetY); // transform to cell position
962 mArrowMatrix.preRotate(angle, cellWidth / 2.0f, cellHeight / 2.0f); // rotate about cell center