[2110] 账号登录登出、切换路线
This commit is contained in:
@@ -7,8 +7,8 @@ import android.view.View
|
||||
import com.mogo.eagle.core.data.temp.EventBusOperation
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ShadowUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import kotlinx.android.synthetic.main.view_och_bus_operation.view.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
||||
@@ -41,11 +41,27 @@ class BusOperationView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
context?.let {
|
||||
actvAccountPhone.text = SharedPrefs.getInstance(it).getString("account","")
|
||||
actvAccountPhone.text = phoneMask(SharedPrefs.getInstance(it).getString("och_account",""))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
EventBus.getDefault().post(EventBusOperation(1))
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户电话号码的打码隐藏加星号加*
|
||||
* 一般都是中间四位
|
||||
* @return 处理完成的手机号码
|
||||
*/
|
||||
fun phoneMask(phone: String?): String? {
|
||||
var res = ""
|
||||
if (!StringUtils.isEmpty(phone)&&phone?.length==11) {
|
||||
val stringBuilder = StringBuilder(phone)
|
||||
res = stringBuilder.replace(3, 7, "****").toString()
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user