Commit d3d16055 by YKai

feat:去除无用导包

parent 4f7c7e1e
......@@ -10,6 +10,7 @@ import android.view.View
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.DeviceTool
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -40,7 +41,9 @@ import java.util.concurrent.TimeUnit
* @Company 壹点灵
* @date 2018/11/29
*/
class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,IVerificationCodeContract.Presenter>(), IVerificationCodeContract.View {
class VerificationCodeActivity :
BaseMvpActivity<IVerificationCodeContract.View, IVerificationCodeContract.Presenter>(),
IVerificationCodeContract.View {
private var codeType = STATUS_LOGIN_BY_CODE//页面状态: 1 忘记密码界面 2验证码登录界面
private var userPhoneNumber: String? = null
......@@ -66,7 +69,13 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
/**
* @param isBindPhone 是否是绑定手机号
*/
fun start(activity: Activity, phone: String, countryCode: String, type: Int, isBindPhone: Boolean) {
fun start(
activity: Activity,
phone: String,
countryCode: String,
type: Int,
isBindPhone: Boolean
) {
if (TextUtils.isEmpty(phone)) {
ToastUtil.toastShort("手机号不能为空")
return
......@@ -83,7 +92,14 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
* @param isBindPhone 是否是绑定手机号
* @param hasPassword 是否有密码
*/
fun start(activity: Activity, phone: String, countryCode: String, type: Int, isBindPhone: Boolean, hasPassword: Boolean) {
fun start(
activity: Activity,
phone: String,
countryCode: String,
type: Int,
isBindPhone: Boolean,
hasPassword: Boolean
) {
if (TextUtils.isEmpty(phone)) {
ToastUtil.toastShort("手机号不能为空")
return
......@@ -169,7 +185,9 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
if (ActivityManager.getInstance().getSecondTaskActivity() == null) {
closeAnim(true)
} else {
if (ActivityManager.getInstance().getSecondTaskActivity() is InputPassWordActivity) {
if (ActivityManager.getInstance()
.getSecondTaskActivity() is InputPassWordActivity
) {
closeAnim(false)
} else {
closeAnim(true)
......@@ -197,7 +215,9 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
if (ActivityManager.getInstance().getSecondTaskActivity() == null) {
closeAnim(true)
} else {
if (ActivityManager.getInstance().getSecondTaskActivity() is InputPassWordActivity) {
if (ActivityManager.getInstance()
.getSecondTaskActivity() is InputPassWordActivity
) {
closeAnim(false)
} else {
closeAnim(true)
......@@ -220,7 +240,13 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
val msgCode = pc_1.phoneCode
if (codeType == STATUS_LOGIN_BY_CODE) {//验证码登录界面
if (isBindPhone) {
var param = BindPhoneJavaParam("", countryCode!!, userPhoneNumber!!, msgCode, UserHelper.getUserInfo()!!.uid!!)
var param = BindPhoneJavaParam(
"",
countryCode!!,
userPhoneNumber!!,
msgCode,
UserHelper.getUserInfo()!!.uid!!
)
mPresenter.bindPhone(param)
} else {
mPresenter.loginByMsgCode(userPhoneNumber!!, countryCode!!, msgCode)
......@@ -232,7 +258,11 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
override fun baiduActionBury() {
ActionCountUtils.baiduCount(UserBIConstants.APP_REGISTER_PAGE, UserBIConstants.POSITION_CODE_REGISTER_CLICK, 25)
ActionCountUtils.baiduCount(
UserBIConstants.APP_REGISTER_PAGE,
UserBIConstants.POSITION_CODE_REGISTER_CLICK,
25
)
}
/**
......@@ -286,28 +316,39 @@ class VerificationCodeActivity : BaseMvpActivity<IVerificationCodeContract.View,
tv_countdown_time.setTextColor(ContextCompat.getColor(this, R.color.platform_white))
msgCodeDispoable = Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation())
.take(remainTime.toLong())
.map {
(remainTime - it).toString()
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
tv_countdown_time.text = it + "s"
}, {
}, {
tv_countdown_time.isEnabled = true
tv_countdown_time.text = "重新发送"
tv_countdown_time.setTextColor(ContextCompat.getColor(this, R.color.platform_color_2EB0FF))
})
.subscribeOn(Schedulers.computation())
.take(remainTime.toLong())
.map {
(remainTime - it).toString()
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
tv_countdown_time.text = it + "s"
}, {
}, {
tv_countdown_time.isEnabled = true
tv_countdown_time.text = "重新发送"
tv_countdown_time.setTextColor(
ContextCompat.getColor(
this,
R.color.platform_color_2EB0FF
)
)
})
}
/**
* 重置密码的验证码校验成功
*/
override fun checkResetCodeSuccess(code: String) {
InputPassWordActivity.start(this, userPhoneNumber!!, countryCode!!, InputPassWordActivity.STATUS_SET_PWD, code)
InputPassWordActivity.start(
this,
userPhoneNumber!!,
countryCode!!,
InputPassWordActivity.STATUS_SET_PWD,
code
)
overridePendingTransition(0, 0)
}
......
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