Skip to content

Commit

Permalink
修改新能源车牌号输入及校验规则
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiaoqiang committed Nov 27, 2019
1 parent ce24fa8 commit a22d357
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ mPopupKeyboard.getKeyboardEngine().setLocalProvinceName("广东省");

## 六、版本更新

### v0.7.4 2019.11.27

- 修改新能源车牌号输入及校验规则

### v0.7.3 2019.3.25

- 添加了新能源和普通车牌是否需要规则校验控制选项
Expand Down
2 changes: 1 addition & 1 deletion keyboard/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GROUP=com.parkingwang
VERSION_NAME=0.7.3
VERSION_NAME=0.7.4
POM_NAME=vehicle-keyboard
POM_PACKAGING=aar
POM_DESCRIPTION=Vehicle number keyboard for Android
Expand Down
2 changes: 1 addition & 1 deletion keyboard/src/main/java/com/parkingwang/keyboard/Texts.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static boolean isNewEnergyType(String number) {
for (int i = 0; i < size; i++) {
number += "0";
}
if (Pattern.matches("\\w[A-Z][0-9DF][0-9A-Z]\\d{3}[0-9DF]", number)) {
if (Pattern.matches("\\w[A-Z][0-9A-Z][0-9A-Z]\\w{3}[0-9A-Z]", number)) {
return true;
} else {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class AvailableKeyRegistry {
final RowEntry numericDF = mkEntitiesOf(NUMERIC + "DF");
mCache.put(mkKey(NEW_ENERGY, 0), civilProvince);
mCache.put(mkKey(NEW_ENERGY, 1), lettersHasO);
mCache.put(mkKey(NEW_ENERGY, 2), numericDF);
mCache.put(mkKey(NEW_ENERGY, 2), lettersNumeric);
mCache.put(mkKey(NEW_ENERGY, 3), lettersNumeric);
mCache.put(mkKey(NEW_ENERGY, 4), lettersNumeric);
mCache.put(mkKey(NEW_ENERGY, 5), lettersNumeric);
mCache.put(mkKey(NEW_ENERGY, 6), lettersNumeric);
mCache.put(mkKey(NEW_ENERGY, 7), numericDF);
mCache.put(mkKey(NEW_ENERGY, 7), lettersNumeric);

//// 武警2012式
mCache.put(mkKey(WJ2012, 0), mkEntitiesOf("W"));
Expand Down

0 comments on commit a22d357

Please # to comment.