8729 Commits

Author SHA1 Message Date
Kelson
8462128b70
Merge pull request #4393 from kiwix/Fixes#4392
Fixed: Tabs not restoring in multiple navigation scenarios.
2025-08-20 16:05:13 +02:00
MohitMaliFtechiz
5b68238e96 Added UI test cases for these scenarios to avoid future bugs like these. 2025-08-19 18:42:07 +05:30
MohitMaliFtechiz
2e36a7f788 Fixed: Tabs not restoring in multiple navigation scenarios.
* Fixed: When opening a new ZIM file from the local library and pressing the back button repeatedly, the previously loaded empty ZIM file reappeared in the reader.
* Fixed: Cached book for bookmarks sometimes returned "null" because it wasn’t properly cleared when navigating to other screens.
* Fixed: Tabs were not restoring when navigating to another screen via the bottomAppBar.
* Refactored the "FIND_IN_PAGE" flow — since we can now directly set the result on the previous back stack entry, relaunching the reader screen is no longer required.
* Fixed: Tabs not restoring when returning from left drawer screens.
2025-08-19 17:14:57 +05:30
Kelson
ad3f60133e
Merge pull request #4391 from kiwix/Fixes#4390
Fixed: Opening bookmarks, notes, and history in the reader screen does not work.
2025-08-19 06:15:33 +02:00
MohitMaliFtechiz
48ec6a81c5 Fixed: testBookMarkPageOpenInReader which was failing on API level 25, and 30. 2025-08-19 06:15:10 +02:00
MohitMaliFtechiz
d2ce4a71a1 Added UI test cases for bookmarks and notes to verify that saved items open the exact page in the reader. 2025-08-19 06:15:10 +02:00
MohitMaliFtechiz
629a7f18dc Fixed: Opening bookmarks, notes, and history in the reader screen does not work.
* The issue occurred because the reader screen route was not being created properly, as both modules had different destination classes. We made the openPage method abstract so that each module can provide its own destination with arguments to correctly open pages.
* Improved WebView creation in Compose.
2025-08-19 06:15:10 +02:00
Kelson
6bb8512391
Merge pull request #4388 from kiwix/Fixes#4387
Fixed: When changing the app's language, a blank screen appeared instead of the settings screen.
2025-08-19 06:14:53 +02:00
MohitMaliFtechiz
8938839e90 Fixed: updateOnlineLibraryFilters updates onlineLibraryRequest which sometimes fails on CI. 2025-08-15 21:54:29 +02:00
MohitMaliFtechiz
460c93a4ad Fixed: observeLanguages uses network when no cache and online which sometimes fails on CI. 2025-08-15 21:54:29 +02:00
MohitMaliFtechiz
9ef9f1b0fe Fixed: testPauseAndResumeInOtherLanguage was failing due to our recent change — we now wait for the frame to settle in production code, but Compose is unaware of this wait and immediately checks for the new view. This caused the failure where localLibrary was not found, as Compose was still waiting for synchronized execution. 2025-08-15 21:54:29 +02:00
MohitMaliFtechiz
456e348078 Fixed: When changing the app's language, a blank screen appeared instead of the settings screen.
* The issue occurred because we reopened the settings screen immediately after removing it from the back stack, causing Compose to not settle the previous frame and display a blank screen.
* Resolved by allowing the popBackStack frame to settle before reopening the settings screen.
* Removed some unused code from the project.
2025-08-15 21:54:29 +02:00
Kelson
fe7ded693a
Merge pull request #4386 from kiwix/Fixes#4385
Fixed: The search placeholder was cut off in the `Romansh` language.
2025-08-15 21:53:48 +02:00
MohitMaliFtechiz
4bc4d0a981 Fixed: testUserCanSeeNotesForDeletedFiles which sometimes fails on CI due to androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException. 2025-08-15 15:02:23 +05:30
MohitMaliFtechiz
54a66d1084 Fixed: The search placeholder was cut off in the Romansh language.
* Updated the placeholder text to display on a single line and show an ellipsis (...) at the end if the text is too long.
2025-08-14 13:14:08 +02:00
Kelson
0e39ce6f9d
Merge pull request #4384 from kiwix/Fixes#4383
Fixed: Pressing the back button did not close the application when there were no fragments in the back stack.
2025-08-14 12:29:23 +02:00
MohitMaliFtechiz
10357e78f4 Fixed: Pressing the back button did not close the application when there were no fragments in the back stack.
* The `BackHandler` of top-level destination fragments was always active, preventing the `MainActivity` handler from being called because the top-level fragment's back handler consumed the back event. As a result, when the back stack was empty, pressing the back button did not exit the application.
* We now dynamically enable the `BackHandler` only while a fragment can handle the back event. Once the fragment has handled it, the handler is disabled so that `MainActivity` can process the back event.
2025-08-14 12:28:56 +02:00
Kelson
17b148fc4f
Merge pull request #4382 from kiwix/Fixes#4381
Fixed: Online library was not retrieving after clicking “Allow downloading via mobile network” in the confirmation dialog.
2025-08-14 12:28:31 +02:00
MohitMaliFtechiz
2bc89b9ad2 Improved the testBookmarkRemainsSavedOrNot which sometimes fails on Android 15, and 16. 2025-08-14 12:45:34 +05:30
MohitMaliFtechiz
3b4a5d29fa Fixed: Online library was not retrieving after clicking “Allow downloading via mobile network” in the confirmation dialog.
* Cause: The request object emitted after user confirmation was identical to the previous one, so the flow collector skipped it and the fetch was never triggered.
* Solution: Added a `System.nanoTime()` field to the request to ensure a unique emission while still preserving existing values.
* Refactored the `updateOnlineLibraryFilters updates onlineLibraryRequest` according to this new change.
2025-08-13 17:32:56 +02:00
Kelson
26cc6faec8
Merge pull request #4380 from kiwix/Fixes#4379
Fixed: When opening the search from widget or from outside the application then search is broken with large ZIM files.
2025-08-13 17:32:43 +02:00
MohitMaliFtechiz
cf31f53484 Fixed: When opening the "Online Library" screen from an app shortcut, clicking on the reader screen did not work, causing the GetContentShortcutTest to fail. 2025-08-13 16:55:34 +05:30
MohitMaliFtechiz
67a05315a7 Fixed: When opening the search from widget or from outside the application then search is broken with large ZIM files.
* Fixed: When launching the app fresh (cold start), the search screen could appear before the ZIM file was ready (because ZIM file loading in the reader happens on the IO thread), resulting in no search results. Now, incoming actions are delayed until the ZIM file finishes loading so that search works correctly.
* Fixed: Multiple fragment instances were created when repeatedly opening different fragments via bottomAppBar buttons, causing the back button to bring them to the foreground one by one instead of expected behavior.
2025-08-13 16:54:17 +05:30
Kelson
bd7228354f
Merge pull request #4373 from kiwix/Fixes#4368
Fixed: File size unit / calculation differs from Kiwix-Server.
2025-08-13 11:38:03 +02:00
MohitMaliFtechiz
e9d3737955 Fixed: File size unit / calculation differs from Kiwix-Server.
* Changed the size calculation from GiB (binary format) to GB (decimal format).
* Removed the unused `OnSwipeTouchListener` class.
2025-08-13 11:37:27 +02:00
Kelson
b3090a175d
Merge pull request #4378 from kiwix/Fixes#4377
Fixed: `FIND_IN_PAGE` not working after switching to another ZIM file.
2025-08-13 11:33:55 +02:00
MohitMaliFtechiz
dab9754546 Fixed: FIND_IN_PAGE not working after switching to another ZIM file.
* NavBackStackEntry arguments are immutable, so switching to `FIND_IN_PAGE` used arguments from the previous ReaderFragment backstack entry.
* Fixed by popping the old ReaderFragment from the backstack and launching a fresh instance with the new search arguments.
* Fixed: Multiple `SearchScreen` instances showing when repeatedly opening the search screen.
* Fixed: Reader screen showing an older ZIM file after opening a new one and pressing back.
* Refactored `SearchInPreviousScreenTest` according to the new changes.
* Minor improvement in navigation.
2025-08-13 11:33:44 +02:00
Kelson
82a7fc3713
Merge pull request #4376 from kiwix/Fixes#4375
Fixed: Background downloading of ZIM files not working.
2025-08-13 11:33:11 +02:00
MohitMaliFtechiz
f99e37a017 Improved the background download test. 2025-08-11 22:51:18 +05:30
MohitMaliFtechiz
16ea02274b Added the downloadZIMFileInBackground for testing the download when application is in background.
* Removed some unused code from project.
2025-08-11 22:24:26 +05:30
MohitMaliFtechiz
7a828617b0 Fixed: Background downloading of ZIM files not working.
* There is a limitation with foreground services — we cannot update a foreground service notification from the background (when the application is not running). Starting with Android 16, foreground services also validate the notification ID to ensure it exists before running; this was not enforced in earlier versions, where it worked fine. When multiple downloads are running in the background and one completes, setting a new notification to the foreground service causes it to stop, which in turn stops all background downloads. Additionally, our foreground service was tied to a specific download ID, so when that download completed, was cancelled, or paused, the service also stopped.
* To fix this, we now show a persistent notification that remains active until all downloads are completed or cancelled. This ensures the foreground service stays active in the background and the network is not suspended while downloads are in progress.
2025-08-11 16:29:46 +05:30
Kelson
e7d9f3c809
Merge pull request #4372 from kiwix/Fixes#4371
Migrated the `CustomDownloadFragment` to Jetpack Compose.
2025-08-08 09:46:14 +02:00
MohitMaliFtechiz
a9becb3803 Migrated the CustomDownloadFragment to jetpack compose.
* Refactored the code to use Jetpack Compose UI.
* Removed unused code from the project.
* Fixed: When there is no ZIM file available and navigating to `CustomDownloadFragment` application sometimes crashes.
* Fixed: "Open Library" button was shown even when no readable ZIM file was available.
2025-08-08 09:45:42 +02:00
Kelson
f2a875dc92
Merge pull request #4354 from kiwix/Fixes#4326
Migrated `KiwixMainActivity` and `CustomMainActivity` to Jetpack Compose.
2025-08-08 09:45:15 +02:00
MohitMaliFtechiz
3226709d77 Improved the NoteFragmentTest. 2025-08-07 17:53:01 +05:30
MohitMaliFtechiz
2ff002143c Added retry mechanism for flaky unit tests to improve test reliability. 2025-08-07 16:24:30 +05:30
MohitMaliFtechiz
dccecd8d50 Fixed: ZimManageViewModelTest which sometimes failing on CI. 2025-08-07 15:09:22 +05:30
MohitMaliFtechiz
9e7ccc8e16 Fixed: The books deletes entities whose file does not exist and Save uses active language unit test cases, which were occasionally failing on CI. 2025-08-07 02:13:27 +05:30
MohitMaliFtechiz
b12b654c6a Improved the updating bookmark list when saving/removing the bookmarks. 2025-08-07 00:01:06 +05:30
MohitMaliFtechiz
4f1a442854 Improved the NavigationHistoryTest, DeepLinksTest, NoteFragmentTest, and ZimFileReaderWithSplittedZimFileTest test cases. 2025-08-06 23:03:44 +05:30
MohitMaliFtechiz
8b446a5200 Refactored the OpenSearchItemTest unit test.
* Fixed: ZimHostFragmentTest UI test.
2025-08-06 17:37:30 +05:30
MohitMaliFtechiz
7b03c5da3e Fixed: DarkModeViewPainterTest which was failing on CI. 2025-08-06 16:40:43 +05:30
MohitMaliFtechiz
0dc94eaeaf Fixed: NavigationHistoryTest, CopyMoveFileHandlerTest, and LibkiwixBookmarkTest which were failing on CI. 2025-08-06 14:52:40 +05:30
MohitMaliFtechiz
19006f30b7 Refactored the bottomNavigation to properly show the current selected page.
* Fixed: `JNI DETECTED ERROR IN APPLICATION` when opening the ZIM file in lower devices.
2025-08-06 00:56:47 +05:30
MohitMaliFtechiz
03cd131b9b Fixed: The OpenFilesFromStorageTest. 2025-08-05 22:07:27 +05:30
MohitMaliFtechiz
f561e5247a Fixed: When opening the ZIM file from storage application crashing.
* Fixed: `DeepLinksTest`, `LibkiwixBookmarkTest`.
2025-08-05 17:31:12 +05:30
MohitMaliFtechiz
a7120603f9 Fixed: ZimFileReaderWithSplittedZimFileTest, SearchFragmentTest, KiwixSplashActivityTest, and KiwixSettingsFragmentTest. 2025-08-05 00:54:05 +05:30
MohitMaliFtechiz
35ae3733e7 Fixed: App was crashing when opening a ZIM file from storage if the application was not already running in the background.
* Fixed: TopLevelDestinationTest, GetContentShortcutTest, and NoteFragmentTest.
* Fixed: NavigationHistoryTest and KiwixReaderFragmentTest.
2025-08-05 00:22:33 +05:30
MohitMaliFtechiz
21debceb82 Fixed: CodeFactor issues.
* Fixed: The `DownloadTest`.
* Fixed: The `uiDevice.pressBack` was not working with compose UI so we have replaced it with `Espresso.pressBack`.
* Fixed: NoteFragmentTest.
2025-08-02 01:00:28 +05:30
MohitMaliFtechiz
8112632c80 Fixed: Pressing the back button no longer reopens the Search fragment when you’re on the Reader fragment and navigated there from Search (which was happening before).
* Fixed: Pressing the back button now correctly closes the left drawer when it’s open on the Local Library or Online fragments.
* Introduced: A common mechanism to support back press handling across all fragments and the activity, and added support for "Periodic back navigation".
2025-08-01 17:54:39 +05:30