Jelajahi Sumber

Hide encrypt & decrypt when the current file is not pdf

GameJob 4 tahun lalu
induk
melakukan
810e5d0bd7
1 mengubah file dengan 11 tambahan dan 6 penghapusan
  1. 11 6
      src/main/java/com/kdanmobile/reader/ReaderActivity.kt

+ 11 - 6
src/main/java/com/kdanmobile/reader/ReaderActivity.kt

@@ -318,12 +318,17 @@ abstract class ReaderActivity :
             }
             menuItemBookmark?.isVisible = false
         }
-        if (isPdf()) {
-            menu?.apply {
-                when (password.isEmpty()) {
-                    true -> findItem(R.id.item_reader_more_decrypt)
-                    false -> findItem(R.id.item_reader_more_encrypt)
-                }?.isVisible = false
+        menu?.apply {
+            val isPdf = isPdf()
+            when (password.isEmpty()) {
+                true -> {
+                    findItem(R.id.item_reader_more_encrypt)?.isVisible = isPdf
+                    findItem(R.id.item_reader_more_decrypt)?.isVisible = false
+                }
+                false -> {
+                    findItem(R.id.item_reader_more_encrypt)?.isVisible = false
+                    findItem(R.id.item_reader_more_decrypt)?.isVisible = isPdf
+                }
             }
         }
         if (!isIBonPrintEnabled()) {