From 348d5617e078761a5d6e3a1a70971d95586cfcc8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Jul 2018 23:37:49 +0200 Subject: [PATCH] removing a helper function related to moving path in recycle bin --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- .../com/simplemobiletools/gallery/extensions/Activity.kt | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 32a672fc8..5b937556a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -935,7 +935,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View val path = getCurrentMedia().getOrNull(mPos)?.path ?: return val fileDirItem = FileDirItem(path, path.getFilenameFromPath()) if (config.useRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) { - movePathInRecycleBin(path) { + movePathsInRecycleBin(arrayListOf(path)) { if (it) { tryDeleteFileDirItem(fileDirItem, false, false) { refreshViewPager() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt index be1d25aae..f35514f52 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Activity.kt @@ -187,10 +187,6 @@ fun BaseSimpleActivity.tryDeleteFileDirItem(fileDirItem: FileDirItem, allowDelet } } -fun BaseSimpleActivity.movePathInRecycleBin(path: String, callback: ((wasSuccess: Boolean) -> Unit)?) { - movePathsInRecycleBin(arrayListOf(path), callback) -} - fun BaseSimpleActivity.movePathsInRecycleBin(paths: ArrayList, callback: ((wasSuccess: Boolean) -> Unit)?) { Thread { var pathsCnt = paths.size