Skip to content

Commit

Permalink
feat: 限制输入框手机号位数
Browse files Browse the repository at this point in the history
  • Loading branch information
cofbro committed Nov 5, 2023
1 parent 1f6387c commit 4724db9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file removed app.apk
Binary file not shown.
Binary file added app/app-20231105.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/src/main/java/com/cofbro/qian/login/LoginActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {

private fun toVerifyCodeActivity() {
val phoneNumber = binding?.ipUsername?.getTextString() ?: ""
if (phoneNumber.isEmpty()) {
ToastUtils.show("请先输入手机号")
if (phoneNumber.length == 11) {
ToastUtils.show("请输入正确的手机号")
return
}
val intent = Intent(this, SMSActivity::class.java)
Expand Down

0 comments on commit 4724db9

Please sign in to comment.