|
@@ -6,6 +6,7 @@ import android.util.AttributeSet
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
+import android.view.inputmethod.InputMethodManager
|
|
|
import com.kdanmobile.kdanloginregisterui.widget.EmailLoginFormView
|
|
|
import kotlinx.android.synthetic.main.activity_login_b.view.*
|
|
|
|
|
@@ -42,16 +43,25 @@ class LoginBView @JvmOverloads constructor(
|
|
|
val dialog = AlertDialog.Builder(context)
|
|
|
.setView(view)
|
|
|
.setOnDismissListener {
|
|
|
+ val inputMethodManager = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
|
+ if (inputMethodManager.isActive) {
|
|
|
+ inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0)
|
|
|
+ }
|
|
|
(view.parent as ViewGroup).removeAllViews()
|
|
|
+ post{
|
|
|
+ requestFocus()
|
|
|
+ inputMethodManager.hideSoftInputFromWindow(windowToken, 0)
|
|
|
+ }
|
|
|
}
|
|
|
.show()
|
|
|
+
|
|
|
formView.let {
|
|
|
it.isRemember = isRemember
|
|
|
it.email = email
|
|
|
it.pwd = pwd
|
|
|
it.onSubmit = Runnable {
|
|
|
- onClickEmailLogin.run()
|
|
|
dialog.dismiss()
|
|
|
+ onClickEmailLogin.run()
|
|
|
}
|
|
|
it.onClickPwdHelp = View.OnClickListener { onClickPwdHelp.run() }
|
|
|
}
|