mirror of
https://codeberg.org/timelimit/opentimelimit-android.git
synced 2025-10-05 10:49:29 +02:00
Make showing keyboard more reliable
This commit is contained in:
parent
96df39eead
commit
fc0d0be25f
1 changed files with 5 additions and 2 deletions
|
@ -25,6 +25,7 @@ import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
|
import io.timelimit.android.async.Threads
|
||||||
import io.timelimit.android.databinding.EditTextBottomSheetDialogBinding
|
import io.timelimit.android.databinding.EditTextBottomSheetDialogBinding
|
||||||
|
|
||||||
abstract class EditTextBottomSheetDialog: DialogFragment() {
|
abstract class EditTextBottomSheetDialog: DialogFragment() {
|
||||||
|
@ -36,8 +37,10 @@ abstract class EditTextBottomSheetDialog: DialogFragment() {
|
||||||
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?) = BottomSheetDialog(context!!, theme).apply {
|
override fun onCreateDialog(savedInstanceState: Bundle?) = BottomSheetDialog(context!!, theme).apply {
|
||||||
setOnShowListener {
|
setOnShowListener {
|
||||||
binding.editText.requestFocus()
|
Threads.mainThreadHandler.post {
|
||||||
inputMethodManager.showSoftInput(binding.editText, 0)
|
binding.editText.requestFocus()
|
||||||
|
inputMethodManager.showSoftInput(binding.editText, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue