mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-04 02:31:08 +02:00
show keyboard when checklist dialog opens
This commit is contained in:
parent
2fdd2cc845
commit
059ba84775
@ -5,7 +5,6 @@ import android.content.DialogInterface.BUTTON_POSITIVE
|
|||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.WindowManager
|
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
@ -34,8 +33,7 @@ class NewChecklistItemDialog(val activity: Activity, callback: (titles: ArrayLis
|
|||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.add_new_checklist_items, cancelOnTouchOutside = false) {
|
activity.setupDialogStuff(view, this, R.string.add_new_checklist_items, cancelOnTouchOutside = false) {
|
||||||
activity.showKeyboard(titles.first())
|
showKeyboard(titles.first())
|
||||||
window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
|
|
||||||
getButton(BUTTON_POSITIVE).setOnClickListener {
|
getButton(BUTTON_POSITIVE).setOnClickListener {
|
||||||
when {
|
when {
|
||||||
titles.all { it.text.isEmpty() } -> activity.toast(R.string.empty_name)
|
titles.all { it.text.isEmpty() } -> activity.toast(R.string.empty_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user