mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-01-29 21:49:16 +01:00
show the keyboard at rename and new note dialogs
This commit is contained in:
parent
02e005ec37
commit
ff7d406c15
@ -1,7 +1,9 @@
|
||||
package com.simplemobiletools.notes.dialogs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.DialogInterface.BUTTON_POSITIVE
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.extensions.value
|
||||
@ -17,8 +19,9 @@ class NewNoteDialog(val activity: Activity, val db: DBHelper, callback: (title:
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||
activity.setupDialogStuff(view, this, R.string.new_note)
|
||||
getButton(android.support.v7.app.AlertDialog.BUTTON_POSITIVE).setOnClickListener {
|
||||
getButton(BUTTON_POSITIVE).setOnClickListener {
|
||||
val title = view.note_name.value
|
||||
if (title.isEmpty()) {
|
||||
activity.toast(R.string.no_title)
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.simplemobiletools.notes.dialogs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.DialogInterface.BUTTON_POSITIVE
|
||||
import android.support.v7.app.AlertDialog
|
||||
import android.view.LayoutInflater
|
||||
import android.view.WindowManager
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.extensions.value
|
||||
@ -21,8 +23,9 @@ class RenameNoteDialog(val activity: Activity, val db: DBHelper, val note: Note,
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||
activity.setupDialogStuff(view, this, R.string.rename_note)
|
||||
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
|
||||
getButton(BUTTON_POSITIVE).setOnClickListener({
|
||||
val title = view.note_name.value
|
||||
if (title.isEmpty()) {
|
||||
activity.toast(R.string.no_title)
|
||||
|
Loading…
x
Reference in New Issue
Block a user