diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt index fc7b20ea..88ef7f0d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/adapters/ItemsAdapter.kt @@ -25,6 +25,7 @@ import com.simplemobiletools.filemanager.R import com.simplemobiletools.filemanager.activities.SimpleActivity import com.simplemobiletools.filemanager.dialogs.CompressAsDialog import com.simplemobiletools.filemanager.extensions.config +import com.simplemobiletools.filemanager.extensions.isZipFile import kotlinx.android.synthetic.main.list_item.view.* import java.io.Closeable import java.io.File @@ -94,6 +95,7 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList copyMoveTo(true) R.id.cab_move_to -> copyMoveTo(false) R.id.cab_compress -> compressSelection() + R.id.cab_decompress -> decompressSelection() R.id.cab_select_all -> selectAll() R.id.cab_delete -> askConfirmDelete() else -> return false @@ -109,8 +111,8 @@ class ItemsAdapter(val activity: SimpleActivity, var mItems: MutableList, targetPath: String): Boolean { val queue = LinkedList() val out = FileOutputStream(File(targetPath)) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/extensions/string.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/extensions/string.kt new file mode 100644 index 00000000..dfe597fb --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/extensions/string.kt @@ -0,0 +1,3 @@ +package com.simplemobiletools.filemanager.extensions + +fun String.isZipFile() = endsWith(".zip", true) diff --git a/app/src/main/res/menu/cab.xml b/app/src/main/res/menu/cab.xml index 00911d42..bc58e7c4 100644 --- a/app/src/main/res/menu/cab.xml +++ b/app/src/main/res/menu/cab.xml @@ -28,6 +28,10 @@ android:id="@+id/cab_compress" android:title="@string/compress" app:showAsAction="never"/> +