司机注册流程优化
This commit is contained in:
@@ -52,7 +52,7 @@ class PopBottomPic(
|
||||
var xiangce = findViewById<Button>(R.id.btnXiangce)
|
||||
var btnQuxiao = findViewById<Button>(R.id.btn_quxiao)
|
||||
var img = findViewById<ImageView>(R.id.img)
|
||||
if (isReturn) img.setBackgroundResource(R.drawable.huidan)
|
||||
if (isReturn) img.setImageResource(R.drawable.huidan)
|
||||
paizhao.setOnClickListener {
|
||||
|
||||
// 单独拍照
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.dahe.mylibrary.utils
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
||||
/**
|
||||
* @ClassName RegexpUtils
|
||||
* @Author john
|
||||
* @Date 2024/4/18 10:01
|
||||
* @Description TODO
|
||||
*/
|
||||
class RegexpUtils {
|
||||
var regularExpression =
|
||||
"(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
|
||||
"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)"
|
||||
|
||||
fun isNumeric(str: String?): Boolean {
|
||||
val pattern = Pattern.compile("[0-9]*")
|
||||
val isNum = pattern.matcher(str)
|
||||
return if (!isNum.matches()) {
|
||||
false
|
||||
} else true
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 车牌号码Pattern
|
||||
*/
|
||||
val PLATE_NUMBER_PATTERN = Pattern
|
||||
.compile("^[\u0391-\uFFE5]{1}[a-zA-Z0-9]{6,7}$")
|
||||
|
||||
/**
|
||||
* 证件号码Pattern
|
||||
*/
|
||||
val ID_CODE_PATTERN = Pattern
|
||||
.compile("^[a-zA-Z0-9]+$")
|
||||
|
||||
/**
|
||||
* 编码Pattern
|
||||
*/
|
||||
val CODE_PATTERN = Pattern
|
||||
.compile("^[a-zA-Z0-9]+$")
|
||||
|
||||
/**
|
||||
* 固定电话编码Pattern
|
||||
*/
|
||||
val PHONE_NUMBER_PATTERN = Pattern
|
||||
.compile("0\\d{2,3}-[0-9]+")
|
||||
|
||||
/**
|
||||
* 邮政编码Pattern
|
||||
*/
|
||||
val POST_CODE_PATTERN = Pattern.compile("\\d{6}")
|
||||
|
||||
/**
|
||||
* 面积Pattern
|
||||
*/
|
||||
val AREA_PATTERN = Pattern.compile("\\d*.?\\d*")
|
||||
|
||||
/**
|
||||
* 手机号码Pattern
|
||||
*/
|
||||
val MOBILE_NUMBER_PATTERN = Pattern
|
||||
.compile("\\d{11}")
|
||||
val ID_CARD = Pattern.compile(
|
||||
"^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}(" +
|
||||
"(0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"
|
||||
)
|
||||
|
||||
/**
|
||||
* 银行帐号Pattern
|
||||
*/
|
||||
val ACCOUNT_NUMBER_PATTERN = Pattern
|
||||
.compile("\\d{16,21}")
|
||||
|
||||
/**
|
||||
* 车牌号码是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isPlateNumber(s: String?): Boolean {
|
||||
val m = PLATE_NUMBER_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 证件号码是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isIDCode(s: String?): Boolean {
|
||||
val m = ID_CODE_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isCode(s: String?): Boolean {
|
||||
val m = CODE_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 固话编码是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isPhoneNumber(s: String?): Boolean {
|
||||
val m = PHONE_NUMBER_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮政编码是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isPostCode(s: String?): Boolean {
|
||||
val m = POST_CODE_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 面积是否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isArea(s: String?): Boolean {
|
||||
val m = AREA_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号码否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isMobileNumber(s: String?): Boolean {
|
||||
val m = MOBILE_NUMBER_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
fun isIdCard(s: String?): Boolean {
|
||||
val m = ID_CARD.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
|
||||
/**
|
||||
* 银行账号否正确
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
fun isAccountNumber(s: String?): Boolean {
|
||||
val m = ACCOUNT_NUMBER_PATTERN.matcher(s)
|
||||
return m.matches()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user