From 1ed02e5ab08ac53c41d6e5d21beeca9412de680c Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 30 Jan 2025 17:25:58 +0530 Subject: [PATCH] Fixed: FIND_IN_PAGE feature only works with first tab page. * The previously loaded article was not loading in custom apps when switching to another fragment and then returning to the reader screen. Instead, the home page of the ZIM file was loading. A fix has been implemented to resolve this issue. --- .../kiwix/kiwixmobile/custom/main/CustomReaderFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomReaderFragment.kt b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomReaderFragment.kt index 362bdc69b..a5b5730ad 100644 --- a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomReaderFragment.kt +++ b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomReaderFragment.kt @@ -144,7 +144,6 @@ class CustomReaderFragment : CoreReaderFragment() { zimReaderContainer?.zimFileReader?.let(::setUpBookmarks) } else { openObbOrZim() - manageExternalLaunchAndRestoringViewState() } requireArguments().clear() } @@ -207,11 +206,15 @@ class CustomReaderFragment : CoreReaderFragment() { val bookOnDisk = BookOnDisk(zimFileReader) repositoryActions?.saveBook(bookOnDisk) } + // Open the previous loaded pages after ZIM file loads. + manageExternalLaunchAndRestoringViewState() } is ValidationState.HasBothFiles -> { it.zimFile.delete() openZimFile(ZimReaderSource(it.obbFile), true) + // Open the previous loaded pages after ZIM file loads. + manageExternalLaunchAndRestoringViewState() } else -> {}