From 4873fed83f5e8dc6d2d6cbce092d6dfec35e8839 Mon Sep 17 00:00:00 2001
From: tibbi <tibor@kaputa.sk>
Date: Fri, 24 Dec 2021 12:46:09 +0100
Subject: [PATCH] updating commons

---
 app/build.gradle                              |  4 ++--
 .../notes/pro/adapters/ChecklistAdapter.kt    |  8 ++++---
 .../notes/pro/dialogs/RenameNoteDialog.kt     | 24 +++++++++----------
 .../main/res/layout/dialog_sort_checklist.xml |  4 +---
 build.gradle                                  |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/app/build.gradle b/app/build.gradle
index a3c5f7d2..0592d11b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -56,8 +56,8 @@ android {
 }
 
 dependencies {
-    implementation 'com.github.SimpleMobileTools:Simple-Commons:6cc19172f0'
-    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
+    implementation 'com.github.SimpleMobileTools:Simple-Commons:7e0240b1e3'
+    implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
     implementation 'androidx.documentfile:documentfile:1.0.1'
 
     kapt 'androidx.room:room-compiler:2.3.0'
diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/ChecklistAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/ChecklistAdapter.kt
index 6d7a1044..46884306 100644
--- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/ChecklistAdapter.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/adapters/ChecklistAdapter.kt
@@ -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
diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/RenameNoteDialog.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/RenameNoteDialog.kt
index d4f43500..6acd37a4 100644
--- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/RenameNoteDialog.kt
+++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/RenameNoteDialog.kt
@@ -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()
diff --git a/app/src/main/res/layout/dialog_sort_checklist.xml b/app/src/main/res/layout/dialog_sort_checklist.xml
index 042dad42..62733ba7 100644
--- a/app/src/main/res/layout/dialog_sort_checklist.xml
+++ b/app/src/main/res/layout/dialog_sort_checklist.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <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:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -91,8 +90,7 @@
             android:layout_height="wrap_content"
             android:background="@null"
             android:clickable="false"
-            android:text="@string/move_done_checklist_items"
-            app:switchPadding="@dimen/medium_margin" />
+            android:text="@string/move_done_checklist_items" />
 
     </RelativeLayout>
 </LinearLayout>
diff --git a/build.gradle b/build.gradle
index 9b82dbc6..e26e771a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -9,7 +9,7 @@ buildscript {
     }
 
     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"
 
         // NOTE: Do not place your application dependencies here; they belong