8715 Commits

Author SHA1 Message Date
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
MohitMaliFtechiz
51bd9e7908 Fixed: NavController adding multiple instances of the same fragment in backStack with causing issues when navigating.
* Refactored the `DarkModeViewPainterTest` with compose UI.
* Refactored the `CopyMoveFileHandlerTest` according to compose UI.
* Refactored the test cases to get the fragments in test cases according to compose based navigation.
* Refactored the `SearchFragmentTestForCustomApp` test case.
2025-08-01 00:57:03 +05:30
MohitMaliFtechiz
08880afa17 Fixed: Many UI test cases to work with the new Compose-based UI in MainActivity.
* Removed `kiwix_nav_graph` and `custom_nav_graph`, and refactored the remaining code that depended on them.
* Refactored `HotspotNotificationManager` to use the Compose-based navigation graph instead of the XML one.
2025-07-31 00:44:50 +05:30
MohitMaliFtechiz
23e1dcdbdc Refactored the UI test cases according to compose based navigation. 2025-07-30 15:10:11 +05:30
MohitMaliFtechiz
4d97eeebc8 Fixed: The system bar was not correctly showing the icons.
* Fixed: When scrolling, the BottomAppBar was appearing behind the navigation buttons.
* Fixed: The hint in the table of contents was not showing on first-time app install.
* Fixed: Pressing the back button was immediately exiting the app when the table of contents drawer was open.
* Created the `CustomNavGraph` for custom app navigation and refactored related code.
* Refactored the logic to dynamically disable the left drawer when a custom app is configured not to show it.
* Simplified the code for enabling/disabling the sidebar.
* Resolved all lint and Detekt errors.
2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
8afaa8be52 Fixed: Clicking on a table of content item wasn’t scrolling the WebView to the selected section because the Compose ScrollState caused recomposition back to the previous scroll position — now replaced with a custom approach to smoothly scroll to the target section. * Fixed: The whole screen was scrolling when scrolling the table of contents.
* Fixed: App was crashing and not opening the intro screen on fresh install.
* Fixed: Design and appearance of the table of contents in dark mode.
2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
f041ee9cf0 Added a Table of Contents drawer to the reader screen and refactored all related code. * Fixed: BottomAppBar was not showing when hiding the tab switcher (tabs view).
* Removed some unused code from the project.
* Fixed: Some lint, and detekt issues in kiwix app.
2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
078ecb48cf Fixed: BottomAppBar was not scrolling when scrolling the WebView content on reader screen. * Fixed: Opening searched items was not working.
* Fixed: Flickering of the toolbar and BottomAppBar on the reader screen when scrolling the WebView slowly.
* Removed some unused code.
2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
16c5cc78ee Fixed: WebView scrolling is lagging with compose UI. * Fixed: the bottomAppBar is not showing when closing the tabs. 2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
877c4a7166 Introduced route-based navigation to pass arguments to fragments. * Removed some unused files. * Fixed: all library controls for navigation (e.g., sharing files, navigating to downloads, etc.).
* Fixed: Open library button not working.
* Fixed: opening ZIM file from storage (using the plus button) had too much bottom margin after migrating MainActivity to Compose.
* Added support for automatically hiding and showing the BottomAppBar while scrolling, using the Compose approach.
* Many other improvements in UI and logics.
* Show or hide the BottomAppBar when full screen mode is enabled/disabled or when tabs are visible.
* Disable the left drawer when opening full screen mode, tabs, etc.
2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
edae60fa52 Added support to reflect locale changes: when the application language changes, all UI now updates automatically to the selected language in a Compose-friendly way. Introduced a Compose-based approach to enable or disable the left drawer, simplifying drawer state management. 2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
a3d6ea49f9 Changed navigation to a Compose-based architecture using named routes instead of fragment IDs, and refactored all related code for both Kiwix and custom apps. 2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
86d9b1266f Refactored left drawer to support Kiwix and custom apps dynamically; improved right drawer UI. 2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
4e56c2c781 Created the KiwixNavGraph for Compose-based navigation. 2025-07-30 13:45:35 +05:30
MohitMaliFtechiz
095317e102 Migrated KiwixMainActivity and CustomMainActivity to Jetpack Compose. 2025-07-30 13:45:35 +05:30