From 85427c45513802ccd960627a12aeb3b5e89b65d2 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Sat, 18 Jan 2025 13:57:53 +0530 Subject: [PATCH] Improved the behavior of enabling menu buttons. * Previously, when a ZIM file was in the process of opening, the reopenBook method was used to hide the "Open Library" button if it was visible. However, this method also enabled the menu buttons. If an error occurred while loading the ZIM file, the controls remained enabled, which was not desirable. Now, the "Open Library" button is hidden, and the menu buttons are shown only after the ZIM file has successfully loaded. If an error occurs during loading, an error message is displayed (as it was previously), and the UI is updated accordingly. --- .../java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt index 26ca13f03f..26c345ca1d 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreReaderFragment.kt @@ -1691,7 +1691,8 @@ abstract class CoreReaderFragment : if (zimReaderSource.canOpenInLibkiwix()) { // Show content if there is `Open Library` button showing // and we are opening the ZIM file - reopenBook() + hideNoBookOpenViews() + contentFrame?.visibility = View.VISIBLE openAndSetInContainer(zimReaderSource) updateTitle() } else {