Commit 0784f321 by 霍志良

feat:密码登录、设置密码页面

parent f0fb211c
...@@ -3,13 +3,18 @@ package com.yidianling.user.ui.login ...@@ -3,13 +3,18 @@ package com.yidianling.user.ui.login
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.support.v4.content.ContextCompat
import android.text.Editable
import android.text.TextUtils import android.text.TextUtils
import android.text.TextWatcher
import android.text.method.HideReturnsTransformationMethod import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod import android.text.method.PasswordTransformationMethod
import android.view.View import android.view.View
import android.view.animation.AnimationUtils import android.view.animation.AnimationUtils
import com.umeng.socialize.UMShareAPI
import com.umeng.socialize.UMShareConfig
import com.umeng.socialize.bean.SHARE_MEDIA
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
...@@ -20,13 +25,17 @@ import com.yidianling.common.tools.ToastUtil ...@@ -20,13 +25,17 @@ import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.route.UserIn
import com.yidianling.user.safePrivate.FingerPrintCheckActivity
import com.yidianling.user.safePrivate.FingerPrintUtil
import com.yidianling.user.safePrivate.HandUnlockCheckActivity
import com.yidianling.user.ui.login.contract.IInputPassWordContract import com.yidianling.user.ui.login.contract.IInputPassWordContract
import com.yidianling.user.ui.login.presenter.InputPassWordPresenterImpl import com.yidianling.user.ui.login.presenter.InputPassWordPresenterImpl
import kotlinx.android.synthetic.main.user_activity_input_password.* import kotlinx.android.synthetic.main.user_activity_input_password_new.*
import kotlinx.android.synthetic.main.user_activity_input_password_new.et_input_password
import kotlinx.android.synthetic.main.user_activity_input_password_new.img_reg_back
import kotlinx.android.synthetic.main.user_activity_input_password_new.iv_visibility
import kotlinx.android.synthetic.main.user_activity_input_password_new.tv_forget
import kotlinx.android.synthetic.main.user_activity_input_password_new.tv_msm_login
import kotlinx.android.synthetic.main.user_activity_input_password_new.view_lin
import kotlinx.android.synthetic.main.user_activity_register_and_login_bottom.*
import kotlinx.android.synthetic.main.user_activity_register_and_login_new.*
/** /**
* @author jiucheng * @author jiucheng
...@@ -82,7 +91,7 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -82,7 +91,7 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
} }
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.user_activity_input_password return R.layout.user_activity_input_password_new
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
...@@ -115,18 +124,20 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -115,18 +124,20 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
val sb = StringBuffer(userPhoneNumber) val sb = StringBuffer(userPhoneNumber)
sb.insert(3, " ") sb.insert(3, " ")
sb.insert(8, " ") sb.insert(8, " ")
tv_user_phone.text = sb.toString() // tv_user_phone.text = sb.toString()
} else { } else {
tv_user_phone.text = userPhoneNumber // tv_user_phone.text = userPhoneNumber
} }
} }
STATUS_SET_PWD -> {//设置密码 STATUS_SET_PWD -> {//设置密码
//设置新密码
tv_forget.visibility = View.GONE tv_forget.visibility = View.GONE
tv_msm_login.visibility = View.GONE tv_msm_login.visibility = View.GONE
tv_setPass2.visibility = View.VISIBLE // tv_setPass2.visibility = View.VISIBLE
input_password.text = "设置新密码" tv_password_orSet_title.text = "设置新密码"
tv_phone_num.text = "密码为6-16个字符,数字或英文字母组合" et_input_password.hint="输入新密码"
forget_password_hint.visibility=View.VISIBLE
bottom_wechat_qq.visibility=View.INVISIBLE
//设置密码时默认密码明文显示 //设置密码时默认密码明文显示
iv_visibility.isSelected = true iv_visibility.isSelected = true
switchPwdShowType() switchPwdShowType()
...@@ -144,7 +155,25 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -144,7 +155,25 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
private fun setClickEvent() { private fun setClickEvent() {
input_img_back.setOnClickListener { et_input_password.addTextChangedListener(object:TextWatcher{
override fun afterTextChanged(s: Editable?) {
if (s.toString().isNotEmpty()){
login_password.isEnabled=true
login_password.background= ContextCompat.getDrawable(this@InputPassWordActivity,R.drawable.bg_one_click_login)
}else{
login_password.isEnabled=false
login_password.background=ContextCompat.getDrawable(this@InputPassWordActivity,R.drawable.login_password_unable_bg_24dp)
}
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
img_reg_back.setOnClickListener {
if (ActivityManager.getInstance().getSecondTaskActivity() == null) { if (ActivityManager.getInstance().getSecondTaskActivity() == null) {
closeAnim(true) closeAnim(true)
} else { } else {
...@@ -155,7 +184,7 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -155,7 +184,7 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
} }
} }
} }
input_iv_next.setOnClickListener { login_password.setOnClickListener {
//下一步 //下一步
if (STATUS_INPUT_PWD == codeStatus) { if (STATUS_INPUT_PWD == codeStatus) {
...@@ -170,9 +199,9 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -170,9 +199,9 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
} }
} }
input_iv_del.setOnClickListener { /* input_iv_del.setOnClickListener {
et_input_password.setText("") et_input_password.setText("")
} }*/
iv_visibility.setOnClickListener { iv_visibility.setOnClickListener {
iv_visibility.isSelected = !iv_visibility.isSelected iv_visibility.isSelected = !iv_visibility.isSelected
...@@ -191,6 +220,19 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -191,6 +220,19 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
VerificationCodeActivity.start(this, userPhoneNumber!!, countryCode!!, VerificationCodeActivity.STATUS_FORGET_PWD) VerificationCodeActivity.start(this, userPhoneNumber!!, countryCode!!, VerificationCodeActivity.STATUS_FORGET_PWD)
overridePendingTransition(0, 0) overridePendingTransition(0, 0)
} }
//微信登录
login_wechat.setOnClickListener {
// mPresenter.loginByThird(this, SHARE_MEDIA.WEIXIN)
}
//QQ 登录
login_qq.setOnClickListener {
val config = UMShareConfig()
config.isNeedAuthOnGetUserInfo(true)
UMShareAPI.get(this).setShareConfig(config)
// mPresenter.loginByThird(this, SHARE_MEDIA.QQ)
}
} }
...@@ -234,12 +276,17 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -234,12 +276,17 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
*菊花框 *菊花框
*/ */
override fun showLoading(state: Boolean) { override fun showLoading(state: Boolean) {
if (state) { /*if (state) {
input_iv_next.visibility = View.GONE input_iv_next.visibility = View.GONE
input_progressBarNormal.visibility = View.VISIBLE input_progressBarNormal.visibility = View.VISIBLE
} else { } else {
input_iv_next.visibility = View.VISIBLE input_iv_next.visibility = View.VISIBLE
input_progressBarNormal.visibility = View.GONE input_progressBarNormal.visibility = View.GONE
}*/
if (state){
showProgressDialog()
}else{
dismissProgressDialog()
} }
} }
...@@ -265,8 +312,8 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput ...@@ -265,8 +312,8 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
override fun startAnim() { override fun startAnim() {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件  val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
et_input_password.startAnimation(shake) et_input_password.startAnimation(shake)
view_input_lin.startAnimation(shake) view_lin.startAnimation(shake)
view_input_lin.setBackgroundColor(Color.parseColor("#FB6761")) view_lin.setBackgroundColor(Color.parseColor("#FB6761"))
} }
override fun showNormalDialog() { override fun showNormalDialog() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
/> />
<TextView <TextView
android:id="@+id/tv_login_title" android:id="@+id/tv_password_orSet_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_40" android:layout_marginTop="@dimen/platform_dp_40"
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@id/tv_login_title" app:layout_constraintTop_toBottomOf="@id/tv_password_orSet_title"
android:layout_marginTop="100dp" android:layout_marginTop="100dp"
app:layout_constraintLeft_toLeftOf="@id/tv_login_title" app:layout_constraintLeft_toLeftOf="@id/tv_password_orSet_title"
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
android:layout_marginEnd="@dimen/platform_dp_40" android:layout_marginEnd="@dimen/platform_dp_40"
android:background="@color/platform_color_EBEBEB" android:background="@color/platform_color_EBEBEB"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_login_title" app:layout_constraintStart_toStartOf="@id/tv_password_orSet_title"
app:layout_constraintTop_toBottomOf="@id/et_input_password" app:layout_constraintTop_toBottomOf="@id/et_input_password"
/> />
<ImageView <ImageView
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
app:layout_constraintEnd_toEndOf="@id/view_lin" app:layout_constraintEnd_toEndOf="@id/view_lin"
android:layout_marginEnd="@dimen/platform_dp_27" android:layout_marginEnd="@dimen/platform_dp_27"
android:id="@+id/forget_password_hint" android:id="@+id/forget_password_hint"
android:visibility="gone"
> >
</TextView> </TextView>
<TextView <TextView
...@@ -134,6 +135,13 @@ ...@@ -134,6 +135,13 @@
app:layout_constraintEnd_toEndOf="@id/tv_forget" app:layout_constraintEnd_toEndOf="@id/tv_forget"
android:layout_marginTop="@dimen/platform_dp_40" android:layout_marginTop="@dimen/platform_dp_40"
/> />
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/bottom_wechat_qq"
>
<include
layout="@layout/user_activity_register_and_login_bottom" />
</android.support.constraint.ConstraintLayout>
<include layout="@layout/user_activity_register_and_login_bottom" />
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment