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 androidx.fragment.app.DialogFragment
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
import io.timelimit.android.async.Threads
|
||||
import io.timelimit.android.databinding.EditTextBottomSheetDialogBinding
|
||||
|
||||
abstract class EditTextBottomSheetDialog: DialogFragment() {
|
||||
|
@ -36,10 +37,12 @@ abstract class EditTextBottomSheetDialog: DialogFragment() {
|
|||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?) = BottomSheetDialog(context!!, theme).apply {
|
||||
setOnShowListener {
|
||||
Threads.mainThreadHandler.post {
|
||||
binding.editText.requestFocus()
|
||||
inputMethodManager.showSoftInput(binding.editText, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun didInitField() {
|
||||
binding.editText.setSelection(binding.editText.text.length)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue