|
|
@@ -1,13 +1,13 @@
|
|
|
package com.grkj.iscs.activity
|
|
|
|
|
|
import android.content.Intent
|
|
|
-import com.grkj.iscs.BusinessManager
|
|
|
-import com.grkj.iscs.R
|
|
|
+import android.view.InputDevice
|
|
|
+import android.view.KeyEvent
|
|
|
+import android.widget.EditText
|
|
|
import com.grkj.iscs.base.BaseMvpActivity
|
|
|
import com.grkj.iscs.databinding.ActivityLoginBinding
|
|
|
import com.grkj.iscs.iview.ILoginView
|
|
|
import com.grkj.iscs.presenter.LoginPresenter
|
|
|
-import com.grkj.iscs.util.Executor
|
|
|
import com.grkj.iscs.util.passwordStyle
|
|
|
|
|
|
class LoginActivity : BaseMvpActivity<ILoginView, LoginPresenter, ActivityLoginBinding>() {
|
|
|
@@ -50,4 +50,19 @@ class LoginActivity : BaseMvpActivity<ILoginView, LoginPresenter, ActivityLoginB
|
|
|
override fun initPresenter(): LoginPresenter {
|
|
|
return LoginPresenter()
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
|
|
+ if (event.action == KeyEvent.ACTION_UP && event.source == InputDevice.SOURCE_KEYBOARD) {
|
|
|
+ val view = currentFocus
|
|
|
+ if (view is EditText) {
|
|
|
+ val text = view.text?.toString()
|
|
|
+ if (text!!.isNotEmpty()) {
|
|
|
+ val rst = text.substring(0, text.length - 1)
|
|
|
+ view.setText(rst)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return super.dispatchKeyEvent(event)
|
|
|
+ }
|
|
|
}
|