From 25d3eebb4fbc71aa62dbb5b2b22d185527a3d1a4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Apr 2017 23:03:49 +0200 Subject: [PATCH] remove some redundant functions --- .../gallery/activities/ViewPagerActivity.kt | 12 ++---------- .../gallery/adapters/DirectoryAdapter.kt | 12 ++---------- 2 files changed, 4 insertions(+), 20 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 0f2825ae3..fed65fac1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -184,8 +184,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View when (item.itemId) { R.id.menu_set_as_wallpaper -> trySetAsWallpaper(getCurrentFile()) - R.id.menu_copy_to -> copyTo() - R.id.menu_move_to -> moveTo() + R.id.menu_copy_to -> copyMoveTo(true) + R.id.menu_move_to -> copyMoveTo(false) R.id.menu_open_with -> openWith(getCurrentFile()) R.id.menu_hide -> toggleFileVisibility(true) R.id.menu_unhide -> toggleFileVisibility(false) @@ -217,14 +217,6 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } } - private fun copyTo() { - copyMoveTo(true) - } - - private fun moveTo() { - copyMoveTo(false) - } - private fun copyMoveTo(isCopyOperation: Boolean) { val files = ArrayList(1).apply { add(getCurrentFile()) } tryCopyMoveFilesTo(files, isCopyOperation) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 6c0ac3290..c75e607c8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -83,8 +83,8 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList toggleFoldersVisibility(true) R.id.cab_unhide -> toggleFoldersVisibility(false) R.id.cab_exclude -> tryExcludeFolder() - R.id.cab_copy_to -> copyTo() - R.id.cab_move_to -> moveTo() + R.id.cab_copy_to -> copyMoveTo(true) + R.id.cab_move_to -> copyMoveTo(false) R.id.cab_select_all -> selectAll() R.id.cab_delete -> askConfirmDelete() else -> return false @@ -243,14 +243,6 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList