Skip to content

Commit ff7d406

Browse files
committed
show the keyboard at rename and new note dialogs
1 parent 02e005e commit ff7d406

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/dialogs/NewNoteDialog.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.simplemobiletools.notes.dialogs
22

33
import android.app.Activity
4+
import android.content.DialogInterface.BUTTON_POSITIVE
45
import android.support.v7.app.AlertDialog
6+
import android.view.WindowManager
57
import com.simplemobiletools.commons.extensions.setupDialogStuff
68
import com.simplemobiletools.commons.extensions.toast
79
import com.simplemobiletools.commons.extensions.value
@@ -17,8 +19,9 @@ class NewNoteDialog(val activity: Activity, val db: DBHelper, callback: (title:
1719
.setPositiveButton(R.string.ok, null)
1820
.setNegativeButton(R.string.cancel, null)
1921
.create().apply {
22+
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
2023
activity.setupDialogStuff(view, this, R.string.new_note)
21-
getButton(android.support.v7.app.AlertDialog.BUTTON_POSITIVE).setOnClickListener {
24+
getButton(BUTTON_POSITIVE).setOnClickListener {
2225
val title = view.note_name.value
2326
if (title.isEmpty()) {
2427
activity.toast(R.string.no_title)

app/src/main/kotlin/com/simplemobiletools/notes/dialogs/RenameNoteDialog.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package com.simplemobiletools.notes.dialogs
22

33
import android.app.Activity
4+
import android.content.DialogInterface.BUTTON_POSITIVE
45
import android.support.v7.app.AlertDialog
56
import android.view.LayoutInflater
7+
import android.view.WindowManager
68
import com.simplemobiletools.commons.extensions.setupDialogStuff
79
import com.simplemobiletools.commons.extensions.toast
810
import com.simplemobiletools.commons.extensions.value
@@ -21,8 +23,9 @@ class RenameNoteDialog(val activity: Activity, val db: DBHelper, val note: Note,
2123
.setPositiveButton(R.string.ok, null)
2224
.setNegativeButton(R.string.cancel, null)
2325
.create().apply {
26+
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
2427
activity.setupDialogStuff(view, this, R.string.rename_note)
25-
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
28+
getButton(BUTTON_POSITIVE).setOnClickListener({
2629
val title = view.note_name.value
2730
if (title.isEmpty()) {
2831
activity.toast(R.string.no_title)

0 commit comments

Comments
 (0)