Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public class PatternLockView extends View {
private float mHitFactor = 0.6f;

// Made static so that the static inner class can use it
private static Dot[][] sDots;
private static int sDotCount;

private boolean mAspectRatioEnabled;
Expand Down Expand Up @@ -578,11 +579,18 @@ public void setViewMode(@PatternViewMode int patternViewMode) {

public void setDotCount(int dotCount) {
sDotCount = dotCount;
mPatternSize = sDotCount * sDotCount;
sDots = new Dot[dotCount][dotCount];
for (int i = 0; i < dotCount; i++) {
for (int j = 0; j < dotCount; j++) {
sDots[i][j] = new Dot(i, j);
}
}

mPatternSize = dotCount * dotCount;
mPattern = new ArrayList<>(mPatternSize);
mPatternDrawLookup = new boolean[sDotCount][sDotCount];
mPatternDrawLookup = new boolean[dotCount][dotCount];

mDotStates = new DotState[sDotCount][sDotCount];
mDotStates = new DotState[dotCount][dotCount];
for (int i = 0; i < sDotCount; i++) {
for (int j = 0; j < sDotCount; j++) {
mDotStates[i][j] = new DotState();
Expand Down Expand Up @@ -1149,7 +1157,6 @@ public static class Dot implements Parcelable {

private int mRow;
private int mColumn;
private static Dot[][] sDots;

static {
sDots = new Dot[sDotCount][sDotCount];
Expand Down