Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
c8b1f32b
Commit
c8b1f32b
authored
Jan 19, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:国内手机号校验,国外不做校验
parent
48baa470
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletions
+23
-1
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+23
-1
No files found.
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
c8b1f32b
...
...
@@ -405,6 +405,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
//手机号输入框
et_phone_number
.
setListener
{
if
(
TextUtils
.
isEmpty
(
it
))
{
setHint
()
...
...
@@ -414,13 +415,33 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
iv_del
.
visibility
=
View
.
VISIBLE
iv_del
.
isEnabled
=
true
}
if
(
it
.
toString
().
length
==
13
||
(!
country
Code
?.
equals
(
"+86"
)
!!
&&
et_phone_number
.
text
.
toString
().
length
>
0
))
{
/*if (it.toString().length == 13 || (!split
Code?.equals("+86")!! && et_phone_number.text.toString().length > 0)) {
ll_next.isEnabled = true
ll_next.background = ContextCompat.getDrawable(this, R.drawable.bg_one_click_login)
} else {
ll_next.isEnabled = false
ll_next.background =
ContextCompat.getDrawable(this, R.drawable.login_password_unable_bg_24dp)
}*/
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
==
13
){
ll_next
.
isEnabled
=
true
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
bg_one_click_login
)
}
else
{
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
){
ll_next
.
isEnabled
=
false
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
login_password_unable_bg_24dp
)
return
@setListener
}
if
(!
country_code
.
text
?.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
>
0
){
ll_next
.
isEnabled
=
true
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
bg_one_click_login
)
}
else
{
ll_next
.
isEnabled
=
false
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
login_password_unable_bg_24dp
)
}
}
}
//删除按钮
...
...
@@ -692,6 +713,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*/
private
fun
setCountryIcon
(
code
:
String
?)
{
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
val
splitCode
=
countryCode
?.
replace
(
"00"
,
""
)
/* when (code) {
"0086" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
"001" -> iv_country_icon.setImageResource(R.drawable.user_country_usa)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment