mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-22 03:20:16 +01:00
updating commons
This commit is contained in:
parent
55bba0fa23
commit
4873fed83f
@ -56,8 +56,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:6cc19172f0'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:7e0240b1e3'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
|
||||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
|
|
||||||
kapt 'androidx.room:room-compiler:2.3.0'
|
kapt 'androidx.room:room-compiler:2.3.0'
|
||||||
|
@ -30,9 +30,11 @@ import com.simplemobiletools.notes.pro.models.ChecklistItem
|
|||||||
import kotlinx.android.synthetic.main.item_checklist.view.*
|
import kotlinx.android.synthetic.main.item_checklist.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class ChecklistAdapter(activity: BaseSimpleActivity, var items: ArrayList<ChecklistItem>, val listener: ChecklistItemsListener?,
|
class ChecklistAdapter(
|
||||||
recyclerView: MyRecyclerView, val showIcons: Boolean, itemClick: (Any) -> Unit) :
|
activity: BaseSimpleActivity, var items: ArrayList<ChecklistItem>, val listener: ChecklistItemsListener?,
|
||||||
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick), ItemTouchHelperContract {
|
recyclerView: MyRecyclerView, val showIcons: Boolean, itemClick: (Any) -> Unit
|
||||||
|
) :
|
||||||
|
MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
|
||||||
|
|
||||||
private lateinit var crossDrawable: Drawable
|
private lateinit var crossDrawable: Drawable
|
||||||
private lateinit var checkDrawable: 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)
|
view.note_title.setText(note.title)
|
||||||
|
|
||||||
AlertDialog.Builder(activity)
|
AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.create().apply {
|
.create().apply {
|
||||||
activity.setupDialogStuff(view, this, R.string.rename_note) {
|
activity.setupDialogStuff(view, this, R.string.rename_note) {
|
||||||
showKeyboard(view.note_title)
|
showKeyboard(view.note_title)
|
||||||
getButton(BUTTON_POSITIVE).setOnClickListener {
|
getButton(BUTTON_POSITIVE).setOnClickListener {
|
||||||
val title = view.note_title.value
|
val title = view.note_title.value
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
newTitleConfirmed(title, this)
|
newTitleConfirmed(title, this)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun newTitleConfirmed(title: String, dialog: AlertDialog) {
|
private fun newTitleConfirmed(title: String, dialog: AlertDialog) {
|
||||||
@ -66,8 +66,8 @@ class RenameNoteDialog(val activity: SimpleActivity, val note: Note, val current
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.renameFile(file.absolutePath, newFile.absolutePath) {
|
activity.renameFile(file.absolutePath, newFile.absolutePath, false) { success, useAndroid30Way ->
|
||||||
if (it) {
|
if (success) {
|
||||||
note.path = newFile.absolutePath
|
note.path = newFile.absolutePath
|
||||||
NotesHelper(activity).insertOrUpdateNote(note) {
|
NotesHelper(activity).insertOrUpdateNote(note) {
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/dialog_holder"
|
android:id="@+id/dialog_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -91,8 +90,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:text="@string/move_done_checklist_items"
|
android:text="@string/move_done_checklist_items" />
|
||||||
app:switchPadding="@dimen/medium_margin" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -9,7 +9,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
Loading…
x
Reference in New Issue
Block a user