From 0c2063f8f3a4f0ec3229a026647ba0970954d87a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jan 2022 17:58:33 +0100 Subject: [PATCH] updating commons --- app/build.gradle | 2 +- .../musicplayer/dialogs/EditDialog.kt | 12 +++++++----- build.gradle | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e2e52c27..d05e72e9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:ccc1f8b958' + implementation 'com.github.SimpleMobileTools:Simple-Commons:14033f9b50' implementation 'org.greenrobot:eventbus:3.2.0' implementation 'androidx.media:media:1.4.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' diff --git a/app/src/main/kotlin/com/simplemobiletools/musicplayer/dialogs/EditDialog.kt b/app/src/main/kotlin/com/simplemobiletools/musicplayer/dialogs/EditDialog.kt index c317a5b3..f75ddb02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/musicplayer/dialogs/EditDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/musicplayer/dialogs/EditDialog.kt @@ -12,8 +12,8 @@ import com.simplemobiletools.musicplayer.models.Track import kotlinx.android.synthetic.main.dialog_rename_song.* import kotlinx.android.synthetic.main.dialog_rename_song.view.* -class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callback: (Track) -> Unit) { - private val tagHelper by lazy { TagHelper(activity) } +class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callback: (track: Track) -> Unit) { + private val tagHelper = TagHelper(activity) init { val view = activity.layoutInflater.inflate(R.layout.dialog_rename_song, null).apply { @@ -24,7 +24,9 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac file_name.setText(filename.substring(0, filename.lastIndexOf("."))) extension.setText(track.path.getFilenameExtension()) if (isRPlus()) { - arrayOf(file_name_label, file_name, extension_label, extension).forEach { it.beGone() } + arrayOf(file_name_label, file_name, extension_label, extension).forEach { + it.beGone() + } } } @@ -61,8 +63,8 @@ class EditDialog(val activity: BaseSimpleActivity, val track: Track, val callbac } if (!isRPlus()) { - activity.renameFile(oldPath, newPath) { - if (it) { + activity.renameFile(oldPath, newPath, false) { success, andd -> + if (success) { storeEditedSong(track, oldPath, newPath) track.path = newPath callback(track) diff --git a/build.gradle b/build.gradle index 26027b91..e681b55b 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong