mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
updating commons
This commit is contained in:
@ -30,9 +30,11 @@ import com.simplemobiletools.notes.pro.models.ChecklistItem
|
||||
import kotlinx.android.synthetic.main.item_checklist.view.*
|
||||
import java.util.*
|
||||
|
||||
class ChecklistAdapter(activity: BaseSimpleActivity, var items: ArrayList<ChecklistItem>, val listener: ChecklistItemsListener?,
|
||||
recyclerView: MyRecyclerView, val showIcons: Boolean, itemClick: (Any) -> Unit) :
|
||||
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick), ItemTouchHelperContract {
|
||||
class ChecklistAdapter(
|
||||
activity: BaseSimpleActivity, var items: ArrayList<ChecklistItem>, val listener: ChecklistItemsListener?,
|
||||
recyclerView: MyRecyclerView, val showIcons: Boolean, itemClick: (Any) -> Unit
|
||||
) :
|
||||
MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
|
||||
|
||||
private lateinit var crossDrawable: Drawable
|
||||
private lateinit var checkDrawable: Drawable
|
||||
|
@ -21,19 +21,19 @@ class RenameNoteDialog(val activity: SimpleActivity, val note: Note, val current
|
||||
view.note_title.setText(note.title)
|
||||
|
||||
AlertDialog.Builder(activity)
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.rename_note) {
|
||||
showKeyboard(view.note_title)
|
||||
getButton(BUTTON_POSITIVE).setOnClickListener {
|
||||
val title = view.note_title.value
|
||||
ensureBackgroundThread {
|
||||
newTitleConfirmed(title, this)
|
||||
}
|
||||
.setPositiveButton(R.string.ok, null)
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
activity.setupDialogStuff(view, this, R.string.rename_note) {
|
||||
showKeyboard(view.note_title)
|
||||
getButton(BUTTON_POSITIVE).setOnClickListener {
|
||||
val title = view.note_title.value
|
||||
ensureBackgroundThread {
|
||||
newTitleConfirmed(title, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun newTitleConfirmed(title: String, dialog: AlertDialog) {
|
||||
@ -66,8 +66,8 @@ class RenameNoteDialog(val activity: SimpleActivity, val note: Note, val current
|
||||
return
|
||||
}
|
||||
|
||||
activity.renameFile(file.absolutePath, newFile.absolutePath) {
|
||||
if (it) {
|
||||
activity.renameFile(file.absolutePath, newFile.absolutePath, false) { success, useAndroid30Way ->
|
||||
if (success) {
|
||||
note.path = newFile.absolutePath
|
||||
NotesHelper(activity).insertOrUpdateNote(note) {
|
||||
dialog.dismiss()
|
||||
|
Reference in New Issue
Block a user