| | |
| | | import android.widget.CheckedTextView |
| | | import android.widget.EditText |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.igo.user.R |
| | | import com.igo.user.network.HttpManager |
| | | import com.igo.user.network.request |
| | | import com.igo.user.ui.TransparentStatusBarActivity |
| | | import com.igo.user.utils.Const |
| | | import org.jetbrains.anko.find |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | |
| | | class ChangePwdActivity: TransparentStatusBarActivity() { |
| | | class ChangePwdActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView(): Int = R.layout.activity_change_pwd |
| | | private val tv_hide by lazy { find<CheckedTextView>(R.id.tv_hide) } |
| | | private val et_pwd by lazy { find<EditText>(R.id.et_pwd) } |
| | |
| | | } |
| | | tv_action.onClick { |
| | | val s = et_pwd.text.toString().trim() |
| | | if(s.length<6){ |
| | | if (s.length < 6) { |
| | | myToast(getString(R.string.密码不能小于6位)) |
| | | return@onClick |
| | | } |
| | | HttpManager.updatePassword(s).request(this@ChangePwdActivity){ _, _-> |
| | | HttpManager.updatePassword(s).request(this@ChangePwdActivity) { _, _ -> |
| | | SPUtils.instance() |
| | | .put(Const.User.NEED_SET_PASSWORD, "2") |
| | | .apply() |
| | | myToast(getString(R.string.密码设置成功)) |
| | | finish() |
| | | } |