From a22d35781901db204df40b9cac30f8fc0279217f Mon Sep 17 00:00:00 2001 From: lixiaoqiang Date: Wed, 27 Nov 2019 11:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B0=E8=83=BD=E6=BA=90?= =?UTF-8?q?=E8=BD=A6=E7=89=8C=E5=8F=B7=E8=BE=93=E5=85=A5=E5=8F=8A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ keyboard/gradle.properties | 2 +- keyboard/src/main/java/com/parkingwang/keyboard/Texts.java | 2 +- .../com/parkingwang/keyboard/engine/AvailableKeyRegistry.java | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a07241d..7dc2531 100644 --- a/README.md +++ b/README.md @@ -313,6 +313,10 @@ mPopupKeyboard.getKeyboardEngine().setLocalProvinceName("广东省"); ## 六、版本更新 +### v0.7.4 2019.11.27 + +- 修改新能源车牌号输入及校验规则 + ### v0.7.3 2019.3.25 - 添加了新能源和普通车牌是否需要规则校验控制选项 diff --git a/keyboard/gradle.properties b/keyboard/gradle.properties index f796054..058ec40 100644 --- a/keyboard/gradle.properties +++ b/keyboard/gradle.properties @@ -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 diff --git a/keyboard/src/main/java/com/parkingwang/keyboard/Texts.java b/keyboard/src/main/java/com/parkingwang/keyboard/Texts.java index 5db13d7..5c22e78 100644 --- a/keyboard/src/main/java/com/parkingwang/keyboard/Texts.java +++ b/keyboard/src/main/java/com/parkingwang/keyboard/Texts.java @@ -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; diff --git a/keyboard/src/main/java/com/parkingwang/keyboard/engine/AvailableKeyRegistry.java b/keyboard/src/main/java/com/parkingwang/keyboard/engine/AvailableKeyRegistry.java index cddd393..36cb8d1 100644 --- a/keyboard/src/main/java/com/parkingwang/keyboard/engine/AvailableKeyRegistry.java +++ b/keyboard/src/main/java/com/parkingwang/keyboard/engine/AvailableKeyRegistry.java @@ -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"));