获取验证码放到手机号登录页面调
This commit is contained in:
@@ -67,7 +67,7 @@ class LoginCodeActivity : BaseViewBindingActivity<ActivityLoginCodeBinding>() {
|
||||
EventBus.getDefault().register(this)
|
||||
initData()
|
||||
initListener()
|
||||
getSmsCode()
|
||||
startCounter()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@@ -132,7 +132,7 @@ class LoginCodeActivity : BaseViewBindingActivity<ActivityLoginCodeBinding>() {
|
||||
override fun onError(e: Throwable) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(e.message)
|
||||
LogUtils.e(ResUtil.getString(R.string.ui_login_logincodeactivity_01))
|
||||
LogUtils.e(e.message)
|
||||
}
|
||||
|
||||
})
|
||||
|
@@ -6,11 +6,19 @@ import android.text.TextUtils
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import com.coorchice.library.utils.LogUtils
|
||||
import com.netease.nim.uikit.StatusBarUtil
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewBindingActivity
|
||||
import com.yizhuan.erban.databinding.ActivityLoginPhoneBinding
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel
|
||||
import com.yizhuan.xchat_android_core.auth.event.LoginEvent
|
||||
import com.yizhuan.xchat_android_core.code.CodeType
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import io.reactivex.SingleObserver
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@@ -53,12 +61,38 @@ class LoginPhoneActivity : BaseViewBindingActivity<ActivityLoginPhoneBinding>(),
|
||||
return
|
||||
}
|
||||
hideIME()
|
||||
LoginCodeActivity.start(
|
||||
this,
|
||||
binding.tvAreaCode.text.toString()
|
||||
.substring(1) + binding.etAccount.text.toString(),
|
||||
binding.tvAreaCode.text.toString().substring(1)
|
||||
)
|
||||
dialogManager.showProgressDialog(this)
|
||||
val areaCode = binding.tvAreaCode.text.toString().substring(1)
|
||||
val phone = binding.tvAreaCode.text.toString()
|
||||
.substring(1) + binding.etAccount.text.toString()
|
||||
AuthModel.get()
|
||||
.getSmsCode(
|
||||
areaCode,
|
||||
phone,
|
||||
CodeType.REGISTER
|
||||
)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(object : SingleObserver<String?> {
|
||||
override fun onSubscribe(d: Disposable) {}
|
||||
|
||||
override fun onSuccess(tip: String) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(tip)
|
||||
LoginCodeActivity.start(
|
||||
this@LoginPhoneActivity,
|
||||
phone,
|
||||
areaCode
|
||||
)
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
dialogManager.dismissDialog()
|
||||
toast(e.message)
|
||||
LogUtils.e(e.message)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,6 +131,7 @@ class LoginPhoneActivity : BaseViewBindingActivity<ActivityLoginPhoneBinding>(),
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
dialogManager.dismissDialog()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
|
@@ -54,9 +54,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_facebook"
|
||||
android:layout_width="308dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="63dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:drawablePadding="35dp"
|
||||
android:gravity="center_vertical"
|
||||
@@ -69,9 +71,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_line"
|
||||
android:layout_width="308dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="63dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:drawablePadding="35dp"
|
||||
android:gravity="center_vertical"
|
||||
@@ -84,9 +88,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_google"
|
||||
android:layout_width="308dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="63dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:drawablePadding="35dp"
|
||||
android:gravity="center_vertical"
|
||||
@@ -99,13 +105,15 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="308dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="63dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginStart="34dp"
|
||||
android:layout_marginEnd="34dp"
|
||||
android:background="@drawable/shape_login_btn_bg"
|
||||
android:drawablePadding="35dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="25dp"
|
||||
android:paddingStart="32dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:text="@string/login_phone"
|
||||
android:textColor="@color/text_title_color"
|
||||
|
Reference in New Issue
Block a user