From 116359c0c64ea84188aea211991149b905063601 Mon Sep 17 00:00:00 2001 From: fatih ergin Date: Sun, 18 Jun 2023 13:08:01 +0300 Subject: [PATCH] move last callback param of DeleteWithRememberDialog out of the parentheses for better readability --- .../gallery/pro/activities/ViewPagerActivity.kt | 3 +-- .../com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 747757778..585fe2df2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -1078,7 +1078,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } val message = String.format(resources.getString(baseString), filenameAndSize) - val callback = fun(remember: Boolean, skipRecycleBin: Boolean) { + DeleteWithRememberDialog(this, message, config.useRecycleBin) { remember, skipRecycleBin -> config.tempSkipDeleteConfirmation = remember if (remember) { @@ -1087,7 +1087,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View deleteConfirmed(skipRecycleBin) } - DeleteWithRememberDialog(this, message, config.useRecycleBin, callback) } private fun deleteConfirmed(skipRecycleBin: Boolean) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index 7b6a86fd5..13bf88b8a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -509,7 +509,7 @@ class MediaAdapter( if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation val question = String.format(resources.getString(baseString), itemsAndSize) - val callback = fun(remember: Boolean, skipRecycleBin: Boolean) { + DeleteWithRememberDialog(activity, question, config.useRecycleBin) { remember, skipRecycleBin -> config.tempSkipDeleteConfirmation = remember if (remember) { @@ -518,7 +518,6 @@ class MediaAdapter( deleteFiles(skipRecycleBin) } - DeleteWithRememberDialog(activity, question, config.useRecycleBin, callback) } private fun deleteFiles(skipRecycleBin: Boolean) {