Update LockPatternView

This commit is contained in:
NekoInverter committed 2021-01-06 18:27:17 +08:00
1 parent 47e1686705
commit a8356c37cb
2 files changed
+141 -172

No files matched your search

@@ -34,8 +34,7 @@ public class LockPatternUtils {
List<LockPatternView.Cell> result = new ArrayList<>();
final byte[] bytes = string.getBytes();
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
for (byte b : bytes) {
result.add(LockPatternView.Cell.of(b / 3, b % 3));
}
return result;
@@ -61,17 +60,4 @@ public class LockPatternUtils {
return new String(res);
}
public static boolean isPatternVaild(String pattern) {
byte[] bytes = pattern.getBytes();
if (bytes.length <= 9 && bytes.length >= 2) {
for (byte b : bytes) {
if (b >= 9 || b < 0) {
return false;
}
}
return true;
} else {
return false;
}
}
}