From b3fa4bf8804e2ca89e4bff85965998be19131cab Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 3 Nov 2016 23:16:47 +0100 Subject: [PATCH] add the properties dialog th the media activity --- .../gallery/activities/MediaActivity.java | 17 +++++++++++++++++ app/src/main/res/menu/cab_media.xml | 5 +++++ 2 files changed, 22 insertions(+) diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java index f8925caf8..1a8993258 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MediaActivity.java @@ -28,6 +28,7 @@ import android.widget.GridView; import com.bumptech.glide.Glide; import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.target.SimpleTarget; +import com.simplemobiletools.fileproperties.dialogs.PropertiesDialog; import com.simplemobiletools.gallery.Constants; import com.simplemobiletools.gallery.R; import com.simplemobiletools.gallery.Utils; @@ -368,6 +369,19 @@ public class MediaActivity extends SimpleActivity } } + private void showProperties() { + final List selectedMedia = getSelectedMedia(); + if (selectedMedia.size() == 1) { + new PropertiesDialog(this, selectedMedia.get(0).getPath(), false); + } else { + final List paths = new ArrayList<>(selectedMedia.size()); + for (Medium medium : selectedMedia) { + paths.add(medium.getPath()); + } + new PropertiesDialog(this, paths, false); + } + } + private boolean isSetWallpaperIntent() { return getIntent().getBooleanExtra(Constants.SET_WALLPAPER_INTENT, false); } @@ -439,6 +453,9 @@ public class MediaActivity extends SimpleActivity @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { switch (item.getItemId()) { + case R.id.cab_properties: + showProperties(); + return true; case R.id.cab_share: shareMedia(); return true; diff --git a/app/src/main/res/menu/cab_media.xml b/app/src/main/res/menu/cab_media.xml index 71f9bc8dc..b742b423d 100644 --- a/app/src/main/res/menu/cab_media.xml +++ b/app/src/main/res/menu/cab_media.xml @@ -1,6 +1,11 @@ +