optimize code

androidx
Ztiany 5 years ago
parent db09ca5d79
commit af215378a8
  1. 4
      lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java
  2. 8
      lib_base/src/main/java/com/android/base/utils/common/Strings.kt
  3. 8
      lib_media_selector/src/main/res/values-zh/strings.xml

@ -68,7 +68,9 @@ public class AutoPermissionRequester {
mOnAllPermissionGrantedListener = null;
mOnPermissionDeniedListener = null;
mPermissionUIProvider = null;
mPermissionCallback.setDestroyed();
if (mPermissionCallback != null) {
mPermissionCallback.setDestroyed();
}
}
};

@ -19,6 +19,14 @@ private const val CONTAINS_LOWERCASE_LETTERS_REG = "^.*[a-z]+.*$"
private const val CONTAINS_UPPERCASE_LETTERS_REG = "^.*[A-Z]+.*$"
private const val CHINESE_HAN_NATIONALITY_NAME_REG = "^[\\u4E00-\\u9FA5]{2,4}\$"
private const val CHINESE_NAME_REG = "^[\\u4E00-\\u9FA5]+(·[\\u4E00-\\u9FA5]+)*\$"
private const val PASSPORT_REG = "^([a-zA-z]|[0-9]){5,17}\$"
/**
* 验证护照号
*/
fun isPassport(mobile: String?): Boolean {
return !isEmpty(mobile) && Pattern.matches(PASSPORT_REG, mobile)
}
/**
* 验证中国的手机号

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ExtraTranslation">
<string name="ucrop_rotate" tools:ignore="PrivateResource">旋转</string>
<string name="ucrop_scale" tools:ignore="PrivateResource">缩放</string>
<string name="ucrop_crop" tools:ignore="PrivateResource">裁剪</string>
</resources>
Loading…
Cancel
Save