From bf486415bedba4d1d38b047073683eb80f43a676 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 26 May 2020 22:52:40 +0200 Subject: [PATCH] adding a Decompress menu item at the Decompress activity --- .../pro/activities/DecompressActivity.kt | 20 +++++++++++++++++++ .../res/drawable/ic_decompress_vector.xml | 9 +++++++++ app/src/main/res/menu/menu_decompress.xml | 9 +++++++++ 3 files changed, 38 insertions(+) create mode 100644 app/src/main/res/drawable/ic_decompress_vector.xml create mode 100644 app/src/main/res/menu/menu_decompress.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt index bc2a78a0..f335d6cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt @@ -3,6 +3,8 @@ package com.simplemobiletools.filemanager.pro.activities import android.annotation.SuppressLint import android.net.Uri import android.os.Bundle +import android.view.Menu +import android.view.MenuItem import com.simplemobiletools.commons.extensions.getFilenameFromPath import com.simplemobiletools.commons.extensions.getRealPathFromURI import com.simplemobiletools.commons.extensions.showErrorToast @@ -42,6 +44,24 @@ class DecompressActivity : SimpleActivity() { } } + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.menu_decompress, menu) + updateMenuItemColors(menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.decompress -> decompressFiles() + } + + return true + } + + private fun decompressFiles() { + + } + @SuppressLint("NewApi") private fun getListItems(uri: Uri): ArrayList { val listItems = ArrayList() diff --git a/app/src/main/res/drawable/ic_decompress_vector.xml b/app/src/main/res/drawable/ic_decompress_vector.xml new file mode 100644 index 00000000..dbc02d31 --- /dev/null +++ b/app/src/main/res/drawable/ic_decompress_vector.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/menu/menu_decompress.xml b/app/src/main/res/menu/menu_decompress.xml new file mode 100644 index 00000000..119912a4 --- /dev/null +++ b/app/src/main/res/menu/menu_decompress.xml @@ -0,0 +1,9 @@ + + + +