Commit af7e28d8 by 霍志良

feat:密码登录UI逻辑修改

parent dff34ba5
......@@ -8,7 +8,7 @@ ext {
"m-confide" : "0.0.48.91",
"m-consultant" : "0.0.59.40",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.48",
"m-user" : "0.0.60.49",
"m-home" : "0.0.22.51",
"m-im" : "0.0.18.30",
"m-dynamic" : "0.0.7.13",
......@@ -91,7 +91,7 @@ ext {
"m-confide" : "0.0.48.91",
"m-consultant" : "0.0.51.16",
"m-fm" : "0.0.23.5",
"m-user" : "0.0.60.48",
"m-user" : "0.0.60.49",
"m-home" : "0.0.22.51",
"m-im" : "0.0.3.15",
"m-dynamic" : "0.0.1.7",
......
......@@ -362,6 +362,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
String unionid = map.get("unionid");
userHttp.bindWX(new BindWX(openid, unionid))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
......
......@@ -152,12 +152,9 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
private fun setClickEvent() {
et_input_password.addTextChangedListener(object:TextWatcher{
override fun afterTextChanged(s: Editable?) {
if (s.toString().isNotEmpty()){
if (checkPassWordNoAnim()){
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)
}
}
......@@ -291,12 +288,27 @@ class InputPassWordActivity : BaseMvpActivity<IInputPassWordContract.View,IInput
}
return true
}
/**
* 校验密码
*/
private fun checkPassWordNoAnim(): Boolean {
val regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$"
val pwd = et_input_password.text.toString()
if (TextUtils.isEmpty(pwd)) {
return false
}
if (!pwd.matches(regex.toRegex())) {
return false
}
return true
}
override fun startAnim() {
val shake = AnimationUtils.loadAnimation(this, R.anim.user_shake_input)//加载动画资源文件 
et_input_password.startAnimation(shake)
view_lin.startAnimation(shake)
view_lin.setBackgroundColor(Color.parseColor("#FB6761"))
login_password.isEnabled=false
login_password.background=ContextCompat.getDrawable(this@InputPassWordActivity,R.drawable.login_password_unable_bg_24dp)
}
override fun showNormalDialog() {
......
......@@ -128,6 +128,7 @@
android:gravity="center"
android:textColor="@color/white"
android:text="登录"
android:enabled="false"
android:textSize="17sp"
android:id="@+id/login_password"
android:background="@drawable/login_password_unable_bg_24dp"
......
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