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
f0fb211c
Commit
f0fb211c
authored
Jan 07, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:手机号\登陆注册页面
parent
52d7e580
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
37 deletions
+102
-37
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+41
-34
user_activity_register_and_login_bottom.xml
m-user/src/main/res/layout/user_activity_register_and_login_bottom.xml
+3
-0
user_activity_register_and_login_new.xml
m-user/src/main/res/layout/user_activity_register_and_login_new.xml
+58
-3
No files found.
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
f0fb211c
...
...
@@ -8,6 +8,7 @@ import android.graphics.Color
import
android.net.Uri
import
android.os.Handler
import
android.provider.Settings
import
android.support.v4.content.ContextCompat
import
android.text.*
import
android.text.method.LinkMovementMethod
import
android.text.style.AbsoluteSizeSpan
...
...
@@ -51,7 +52,9 @@ import com.yidianling.user.safePrivate.HandUnlockCheckActivity
import
com.yidianling.user.ui.CountryListActivity
import
com.yidianling.user.ui.login.contract.ILoginContract
import
com.yidianling.user.ui.login.presenter.LoginPresenterImpl
import
kotlinx.android.synthetic.main.user_activity_register_and_login.*
import
kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.*
import
kotlinx.android.synthetic.main.user_activity_register_and_login_new.*
/**
* @author jiucheng
...
...
@@ -109,7 +112,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
user_activity_register_and_login
return
R
.
layout
.
user_activity_register_and_login
_new
}
override
fun
initDataAndEvent
()
{
...
...
@@ -124,7 +127,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
private
fun
setWindowStatusBarColor
()
{
StatusBarUtils
.
Companion
.
setWindowStatusBarColor
(
this
,
R
.
color
.
platform_color_075b66
)
StatusBarUtils
.
Companion
.
setWindowStatusBarColor
(
this
,
R
.
color
.
white
)
StatusBarUtils
.
Companion
.
setStatusBarLightMode
(
this
,
true
)
}
@SuppressLint
(
"CheckResult"
)
...
...
@@ -178,7 +182,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
isCanAuth
=
true
val
phone
=
SharedPreferencesEditor
.
getString
(
UserHelper
.
USER_PHONE
)
phone
?.
let
{
et_phone_number
.
setPhoneText
(
phone
)
et_phone_number
.
setSelection
(
phone
.
length
)
iv_del
.
visibility
=
View
.
VISIBLE
}
...
...
@@ -214,7 +217,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
spannableString
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
super
.
updateDrawState
(
ds
)
ds
.
color
=
Co
lor
.
WHITE
ds
.
color
=
Co
ntextCompat
.
getColor
(
this
@RegisterAndLoginActivity
,
R
.
color
.
platform_color_1DA1F2
)
ds
.
isUnderlineText
=
true
//设置下划线
}
...
...
@@ -231,7 +234,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
spannableString
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
super
.
updateDrawState
(
ds
)
ds
.
color
=
Co
lor
.
WHITE
ds
.
color
=
Co
ntextCompat
.
getColor
(
this
@RegisterAndLoginActivity
,
R
.
color
.
platform_color_1DA1F2
)
ds
.
isUnderlineText
=
true
//设置下划线
}
...
...
@@ -258,12 +261,12 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if
(
isUmengLoginState
)
{
// tv_skip.visibility = View.VISIBLE
// tv_des.text = "首次绑定即送大礼包"
tv_des
.
visibility
=
View
.
GONE
// tv_des.visibility = View.GONE//"同意"
iv_select_protocol
.
visibility
=
View
.
GONE
tv_des_first
.
visibility
=
View
.
VISIBLE
iv_weixin
.
visibility
=
View
.
GONE
iv
_qq
.
visibility
=
View
.
GONE
tv_
reg
_title
.
text
=
"手机号绑定"
// tv_des_first.visibility = View.VISIBLE//注释首次绑定就送100大红包
login_wechat
.
visibility
=
View
.
GONE
login
_qq
.
visibility
=
View
.
GONE
tv_
login
_title
.
text
=
"手机号绑定"
tv_protocol
.
visibility
=
View
.
GONE
}
...
...
@@ -278,7 +281,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if
(!
TextUtils
.
isEmpty
(
YDLCacheUtils
.
getCountryPhoneCode
()))
{
countryCode
=
YDLCacheUtils
.
getCountryPhoneCode
()
tv_
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
}
setCountryIcon
(
countryCode
)
...
...
@@ -322,7 +325,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private
fun
setHint
()
{
val
hintStr
=
SpannableString
(
resources
.
getString
(
R
.
string
.
user_edittext_hint
))
// 定义hint的值
val
ass
=
AbsoluteSizeSpan
(
16
,
true
)
// 设置字体大小 true表示单位是SP
val
ass
=
AbsoluteSizeSpan
(
20
,
true
)
// 设置字体大小 true表示单位是SP
hintStr
.
setSpan
(
ass
,
0
,
hintStr
.
length
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
et_phone_number
.
hint
=
SpannedString
(
hintStr
)
}
...
...
@@ -355,7 +358,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
isAgreeProtocol
=
true
iv_select_protocol
.
setImageResource
(
R
.
drawable
.
user_login_protocol_selected
)
}
view_click
.
setOnClickListener
{
iv_select_protocol
.
setOnClickListener
{
if
(
iv_select_protocol
.
visibility
==
View
.
VISIBLE
)
{
isAgreeProtocol
=
!
isAgreeProtocol
if
(
isAgreeProtocol
)
{
...
...
@@ -366,26 +369,26 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
}
//微信登录
iv_weixin
.
setOnClickListener
{
login_wechat
.
setOnClickListener
{
mPresenter
.
loginByThird
(
this
,
SHARE_MEDIA
.
WEIXIN
)
}
//QQ 登录
iv
_qq
.
setOnClickListener
{
login
_qq
.
setOnClickListener
{
val
config
=
UMShareConfig
()
config
.
isNeedAuthOnGetUserInfo
(
true
)
UMShareAPI
.
get
(
this
).
setShareConfig
(
config
)
mPresenter
.
loginByThird
(
this
,
SHARE_MEDIA
.
QQ
)
}
ll_country
.
setOnClickListener
{
country_code
.
setOnClickListener
{
val
intent
=
Intent
(
this
,
CountryListActivity
::
class
.
java
)
intent
.
putExtra
(
"userCountryCode"
,
countryCode
)
startActivityForResult
(
intent
,
REQUEST_CODE_COUNTRY
)
overridePendingTransition
(
R
.
anim
.
platform_slide_in_from_bottom
,
R
.
anim
.
user_slide_null
)
}
//下一步
iv
_next
.
setOnClickListener
{
ll
_next
.
setOnClickListener
{
if
(
iv_select_protocol
.
visibility
==
View
.
VISIBLE
&&
!
isAgreeProtocol
)
{
ToastUtil
.
toastShort
(
"请您先同意壹点灵《用户使用协议》、《隐私保护政策》,才能登录使用"
)
return
@setOnClickListener
...
...
@@ -405,6 +408,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
iv_del
.
visibility
=
View
.
VISIBLE
iv_del
.
isEnabled
=
true
}
if
(
it
.
toString
().
length
==
13
){
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
)
}
}
//删除按钮
iv_del
.
setOnClickListener
{
...
...
@@ -471,12 +481,12 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
isUmengLoginState
=
true
// tv_skip.visibility = View.VISIBLE
// tv_des.text = "首次绑定即送大礼包"
tv_des
.
visibility
=
View
.
GONE
//
tv_des.visibility = View.GONE
iv_select_protocol
.
visibility
=
View
.
GONE
tv_des_first
.
visibility
=
View
.
VISIBLE
iv_weixin
.
visibility
=
View
.
GONE
iv
_qq
.
visibility
=
View
.
GONE
tv_
reg
_title
.
text
=
"手机号绑定"
//
tv_des_first.visibility = View.VISIBLE
login_wechat
.
visibility
=
View
.
GONE
login
_qq
.
visibility
=
View
.
GONE
tv_
login
_title
.
text
=
"手机号绑定"
tv_protocol
.
visibility
=
View
.
GONE
}
else
{
LoginUtils
.
LoginSuccessOperate
(
this
)
...
...
@@ -556,14 +566,10 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*菊花框
*/
override
fun
showLoading
(
state
:
Boolean
)
{
if
(
state
)
{
iv_next
.
visibility
=
View
.
GONE
iv_next
.
isEnabled
=
false
pb_Normal
.
visibility
=
View
.
VISIBLE
}
else
{
iv_next
.
visibility
=
View
.
VISIBLE
iv_next
.
isEnabled
=
true
pb_Normal
.
visibility
=
View
.
GONE
if
(
state
){
showProgressDialog
()
}
else
{
dismissProgressDialog
()
}
}
...
...
@@ -634,7 +640,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
countryCode
=
data
!!
.
getStringExtra
(
"code"
)
setCountryIcon
(
countryCode
)
tv_
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
}
}
...
...
@@ -642,7 +648,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
* 根据国家个地区号设置国旗
*/
private
fun
setCountryIcon
(
code
:
String
?)
{
when
(
code
)
{
country_code
.
text
=
"+$code"
/* when (code) {
"0086" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
"001" -> iv_country_icon.setImageResource(R.drawable.user_country_usa)
"00886" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
...
...
@@ -654,7 +661,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
"0060" -> iv_country_icon.setImageResource(R.drawable.user_country_malaysia)
"0044" -> iv_country_icon.setImageResource(R.drawable.user_country_uk)
else -> iv_country_icon.visibility = View.VISIBLE
}
}
*/
}
override
fun
onDestroy
()
{
...
...
m-user/src/main/res/layout/user_activity_register_and_login_bottom.xml
View file @
f0fb211c
...
...
@@ -83,6 +83,8 @@
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/platform_dp_4"
android:textSize=
"12sp"
android:id=
"@+id/tv_protocol"
android:textColor=
"@color/platform_color_999999"
android:text=
"同意壹点灵用户注册协议"
/>
</LinearLayout>
</merge>
\ No newline at end of file
m-user/src/main/res/layout/user_activity_register_and_login_new.xml
View file @
f0fb211c
...
...
@@ -10,12 +10,51 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/platform_dp_16"
android:layout_marginTop=
"@dimen/platform_dp_
2
0"
android:layout_marginTop=
"@dimen/platform_dp_
3
0"
android:src=
"@drawable/user_ic_back_black"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<LinearLayout
android:id=
"@+id/ll_success"
android:layout_width=
"match_parent"
android:layout_height=
"64dp"
android:background=
"#fff"
android:gravity=
"center"
android:orientation=
"vertical"
android:visibility=
"gone"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
>
<ImageView
android:layout_width=
"16dp"
android:layout_height=
"16dp"
android:src=
"@drawable/user_ic_log_succee"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"6dp"
android:text=
"登录成功!"
android:textColor=
"#32D296"
android:textSize=
"13dp"
android:textStyle=
"bold"
/>
</LinearLayout>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"35dp"
android:text=
"您已通过阿里云号码认证服务,一键登录更安全。"
android:textColor=
"#666666"
android:textSize=
"13dp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_login_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
@@ -41,7 +80,7 @@
<com.ydl.ydlcommon.view.PhoneEditText
android:id=
"@+id/et_phone_number"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginLeft=
"@dimen/platform_dp_24"
...
...
@@ -52,10 +91,12 @@
android:inputType=
"phone"
android:lines=
"1"
android:maxLength=
"13"
android:textColor=
"@color/platform_color_242424"
android:textColorHint=
"@color/platform_color_EBEBEB"
android:textSize=
"20sp"
app:layout_constraintBottom_toBottomOf=
"@id/country_code"
app:layout_constraintLeft_toRightOf=
"@id/country_code"
app:layout_constraintStart_toEndOf=
"@id/country_code"
app:layout_constraintEnd_toStartOf=
"@id/iv_del"
app:layout_constraintTop_toTopOf=
"@id/country_code"
/>
<View
...
...
@@ -69,7 +110,20 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/country_code"
/>
<ImageView
android:id=
"@+id/iv_del"
android:layout_width=
"23dp"
android:layout_height=
"23dp"
android:layout_gravity=
"center_vertical"
android:padding=
"5dp"
android:scaleType=
"fitXY"
android:src=
"@drawable/user_ic_del"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"@id/view_lin"
app:layout_constraintTop_toTopOf=
"@id/et_phone_number"
app:layout_constraintBottom_toBottomOf=
"@id/et_phone_number"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
...
...
@@ -85,6 +139,7 @@
android:paddingTop=
"@dimen/platform_dp_13"
android:paddingBottom=
"@dimen/platform_dp_13"
android:textSize=
"15sp"
android:id=
"@+id/ll_next"
android:textColor=
"@color/white"
/>
<include
layout=
"@layout/user_activity_register_and_login_bottom"
/>
...
...
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