diff --git a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java index 27db79ca..96b99efc 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java @@ -392,7 +392,7 @@ public class ItemsFragment extends android.support.v4.app.Fragment if (itemIndexes.size() == 1) { showOneItemProperties(); } else { - showMultipleItemProperties(); + showMultipleItemProperties(itemIndexes); } } @@ -404,8 +404,12 @@ public class ItemsFragment extends android.support.v4.app.Fragment new PropertiesDialog(getContext(), item.getPath(), mConfig.getShowHidden()); } - private void showMultipleItemProperties() { - + private void showMultipleItemProperties(List itemIndexes) { + final List paths = new ArrayList<>(itemIndexes.size()); + for (int i : itemIndexes) { + paths.add(mItems.get(i).getPath()); + } + new PropertiesDialog(getContext(), paths, mConfig.getShowHidden()); } private void displayRenameDialog() { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/PropertiesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/PropertiesDialog.kt index e57f8571..91682cdb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/PropertiesDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/PropertiesDialog.kt @@ -26,10 +26,9 @@ class PropertiesDialog() { mCountHiddenItems = countHiddenItems mInflater = LayoutInflater.from(context) mResources = mContext.resources - - val file = File(path) mPropertyView = mInflater.inflate(R.layout.item_properties, null) as ViewGroup + val file = File(path) addProperty(R.string.name, file.name) addProperty(R.string.path, file.parent) addProperty(R.string.size, getItemSize(file)) @@ -54,6 +53,21 @@ class PropertiesDialog() { .show() } + constructor(context: Context, paths: List, countHiddenItems: Boolean = false) : this() { + mContext = context + mCountHiddenItems = countHiddenItems + mInflater = LayoutInflater.from(context) + mResources = mContext.resources + mPropertyView = mInflater.inflate(R.layout.item_properties, null) as ViewGroup + + AlertDialog.Builder(context) + .setTitle(mResources.getString(R.string.properties)) + .setView(mPropertyView) + .setPositiveButton(R.string.ok, null) + .create() + .show() + } + private fun addProperty(labelId: Int, value: String) { val view = mInflater.inflate(R.layout.property_item, mPropertyView, false) view.property_label.text = mResources.getString(labelId)