From dc2e621d6b2a2c8d95cae79b3c4e4448ec0f5e55 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 1 Apr 2017 16:18:47 +0200 Subject: [PATCH] split copy and move to 2 items --- app/build.gradle | 2 +- .../gallery/activities/ViewPagerActivity.kt | 11 ++++++++++- .../gallery/adapters/DirectoryAdapter.kt | 11 ++++++++++- .../gallery/adapters/MediaAdapter.kt | 11 ++++++++++- app/src/main/res/menu/cab_directories.xml | 11 +++++++---- app/src/main/res/menu/cab_media.xml | 13 ++++++++----- app/src/main/res/menu/menu_viewpager.xml | 8 ++++++-- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eae78811f..7494f0499 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { } dependencies { - compile 'com.simplemobiletools:commons:2.14.7' + compile 'com.simplemobiletools:commons:2.14.8' compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0' compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1' compile 'com.bignerdranch.android:recyclerview-multiselect:0.2' 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 b322d3d90..ab0090a35 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -148,7 +148,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View when (item.itemId) { R.id.menu_set_as_wallpaper -> setAsWallpaper(getCurrentFile()) - R.id.menu_copy_move -> displayCopyDialog() + R.id.cab_copy_to -> copyTo() + R.id.cab_move_to -> moveTo() R.id.menu_open_with -> openWith(getCurrentFile()) R.id.menu_share -> shareMedium(getCurrentMedium()!!) R.id.menu_delete -> askConfirmDelete() @@ -196,6 +197,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View }) } + private fun copyTo() { + + } + + private fun moveTo() { + + } + private fun saveImageAs() { val currPath = getCurrentMedium()!!.path SaveAsDialog(this, currPath) { 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 9d65718ad..296b42cc9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -85,7 +85,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_move -> displayCopyDialog() + R.id.cab_copy_to -> copyTo() + R.id.cab_move_to -> moveTo() R.id.cab_select_all -> selectAll() R.id.cab_delete -> askConfirmDelete() else -> return false @@ -253,6 +254,14 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList, R.id.cab_rename -> renameFile() R.id.cab_edit -> editFile() R.id.cab_share -> shareMedia() - R.id.cab_copy_move -> displayCopyDialog() + R.id.cab_copy_to -> copyTo() + R.id.cab_move_to -> moveTo() R.id.cab_select_all -> selectAll() R.id.cab_delete -> askConfirmDelete() else -> return false @@ -161,6 +162,14 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, }) } + private fun copyTo() { + + } + + private fun moveTo() { + + } + fun selectAll() { val cnt = media.size for (i in 0..cnt - 1) { diff --git a/app/src/main/res/menu/cab_directories.xml b/app/src/main/res/menu/cab_directories.xml index fea10e45e..1a7c733a8 100644 --- a/app/src/main/res/menu/cab_directories.xml +++ b/app/src/main/res/menu/cab_directories.xml @@ -36,10 +36,13 @@ android:title="@string/exclude" app:showAsAction="never"/> + android:id="@+id/cab_copy_to" + android:title="@string/copy_to" + app:showAsAction="never"/> + - + + diff --git a/app/src/main/res/menu/menu_viewpager.xml b/app/src/main/res/menu/menu_viewpager.xml index bc5abba82..807553576 100644 --- a/app/src/main/res/menu/menu_viewpager.xml +++ b/app/src/main/res/menu/menu_viewpager.xml @@ -35,8 +35,12 @@ android:title="@string/share" app:showAsAction="ifRoom"/> +