3431 Commits

Author SHA1 Message Date
MohitMaliFtechiz
93d6b66fcf Added a Gradle task to remove the es-formal directory from all variants, since it is an invalid directory in Android and the same translations are already available in the es version. 2025-09-19 22:38:26 +05:30
translatewiki.net
51fc3b0a8d
Localisation updates from https://translatewiki.net. 2025-09-18 14:08:46 +02:00
MohitMaliFtechiz
fdef01c6da Fixed test cases and compilation error. 2025-09-16 15:51:38 +05:30
Yorgo Haykal
62e4dbca21 refactor(core/settings): adjust variable/class/enum names per reviewer feedback. 2025-09-16 15:16:55 +05:30
MohitMaliFtechiz
6c0ac69043 Implemented proper dark mode for ZIM files.
* Removed the custom logic for color inversion of WebView content so that ZIM files can automatically apply the `prefered-color-scheme` setting based on the app theme.
* Removed unused code and test cases from the project.
2025-09-15 19:46:46 +05:30
MohitMaliFtechiz
79b4448e41 Merged the download state and ETA. Now, when the download is "In Progress", it shows the ETA. Otherwise, it displays the download status as before. 2025-09-11 19:58:24 +05:30
MohitMaliFtechiz
0539ff4780 Fixed: Show the downloaded size and total file size in the download notification.
* Displaying the downloaded size and total size in the download notification.
* Displaying the same information in the Download screen UI. We have moved the Download Progress text ("In Progress", "Downloading", "Paused") above the progress bar, and now show the size information in its place.
2025-09-10 21:50:42 +05:30
MohitMaliFtechiz
268b411f6e Added zim scheme deep link support.
* Refactored code to retrieve the ZIM file from `LibkiwixBookOnDisk` instead of `NewBookDao`, since `NewBookDao` no longer exists and books are now stored in `Libkiwix`.
* Added a UI test case for this deep link to verify correct behavior.
* Added `testZimHostDeepLink` to specifically test the new compose deep link and help prevent future regressions.
2025-09-06 13:43:14 +02:00
MohitMaliFtechiz
47055aabbc Fixed: When searching for a page, after opening the searched page it immediately opened the main page of that ZIM file.
* This happened because ZIM file scanning was moved to the IO thread while the WebView was restored on the main thread (a WebView can only be accessed from the main thread) as part of the fix for #710. As a result, the main page sometimes loaded into the current WebView — on some pages it appeared immediately after the searched page. We have now fixed this behavior.
* Previously, the ZIM file was always fetched and loaded in ZimFileReader whenever the reader screen became visible. This was redundant for custom apps, since they only use a single ZIM file. Once the ZIM file is set in the reader, there is no need to fetch and load it again. We have improved this as well: if there is no ZIM file in ZimFileReader, it will fetch it from the assets folder or storage and load it into the reader. If the ZIM file is already loaded, it will simply restore the previous history in the reader. This reduces unnecessary fetching and setting of the ZIM file. Since custom ZIM files can be large, avoiding redundant fetching and loading saves both time and computation.
2025-09-06 15:08:08 +05:30
MohitMaliFtechiz
daf5d51bc2 Fixed: The Tabs history is not restoring in custom apps.
* This happened because we moved the file scanning logic to the IO thread, and inside that, we were also opening the ZIM file in the reader on the IO thread, and then restoring the tabs (which is now done on the Dispatcher’s main thread instead of the UI main thread). Because of this, the WebView was loading freely and saving new history in the database, which cleared the previous history. As a result, the tabs were not restoring.
* Now, we are not saving new WebView history while restoring tabs, which avoids this issue in a multi-threading environment.
* Made `restoreViewStateOnValidWebViewHistory` and `restoreViewStateOnInvalidWebViewHistory` suspend functions so they can run in the same scope from where we are opening and restoring tabs.
2025-09-06 12:12:35 +05:30
MohitMaliFtechiz
68470e44a1 Fixed: The LeftDrawer automatically opens when we rotate the screen.
* In Compose, when the screen rotates and the screen width is above `600dp`, the `drawerState` is automatically set to `open`. Because of this, the issue was happening.
* Now we are storing the `drawerState` and updating the `leftDrawerState` based on the previously saved value when the orientation changes.
* Fixed: `LongMethod` lint error.
2025-09-05 15:58:16 +05:30
MohitMaliFtechiz
88b4d694fd Removed the full-screen mode from our application.
* Refactored all the code related to the full-screen mode.
* Removed unused translations from project which used in this feature.
2025-09-04 16:50:12 +05:30
MohitMaliFtechiz
206469b2d6 Added testZIMFilesShowingOnZimHostScreen UI test case for testing this scenario so that we can avoid this type of errors in future. 2025-09-03 17:02:54 +05:30
MohitMaliFtechiz
76a70bed09 Fixed: Hotspot list of books appearing empty(when reopening the ZimHostScreen).
* The issue occurred when reopening the `ZimHostScreen`. The presenter was detaching the view of the previous `ZimHostScreen`, but since the presenter is a singleton, it also cleared the reference to the view attached to the new `ZimHostScreen`. As a result, the `ZimHostPresenter` could not post books because the view reference was null.
* Updated `BasePresenter` so that it only detaches the view if it matches the one currently attached, preventing accidental clearing of the new screen’s view.
2025-09-03 15:56:48 +05:30
MohitMaliFtechiz
40b8222308 Improved the retrieving of savedStateHandle. 2025-09-02 20:38:57 +05:30
MohitMaliFtechiz
8fa15c12bd Refactored the test cases according to savedStateHandle approach. 2025-09-02 19:04:58 +05:30
MohitMaliFtechiz
00e62eb807 Fixed: testPreviouslyLoadedArticleLoadsAgainWhenSwitchingToAnotherScreen failing in Custom apps.
* The failure was caused by immutable arguments in navBackStackEntry that could not be cleared. To work around this earlier, we replaced the reader fragment with a new one before navigating to another screen so that arguments could be reset. However, this approach had side effects: reopening the same fragment in the background triggered extra computation, since everything in the reader screen renders on the IO thread. As a result, the previously opened page was sometimes only partially rendered, and when the test navigated back, it failed to load correctly.
* To resolve this, we have completely removed the use of navArguments, as they made handling different scenarios more difficult. Instead, we now rely on the savedStateHandle and set arguments directly on the backStackEntry. These can be cleared immediately after use, ensuring they don’t affect other scenarios. This approach not only fixes the failing test but also eliminates redundant fragment rendering, reducing unnecessary work on the IO thread.
2025-09-02 18:29:16 +05:30
MohitMaliFtechiz
6564e5283e Fixed: Some test cases failing on CI. 2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
107c96e5ff Fixed: LocalLibraryTest which was failing on CI. 2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
101404068e Improved the including of modules in variant. 2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
7e71dc44df Fixed: AAPT error in nightly, and standalone APK.
* Improved the including of modules in variant.
2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
1d175b9437 Refactor migration tests by including MigrationModule to ensure migration runs during tests. 2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
71b7083932 Fixed: Dagger was unable to inject sharedPreferenceUtil, kiwixDatabase, etc from core module to migration module.
* Fixed: Circular dependency in app and custom module.
2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
157d572396 Fixed: All compilation errors in dagger.
* Properly included the migration module based on the build variant via dagger.
2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
1d9633c6a4 Removed all ObjectBox code from every variant except the Play Store version. 2025-08-29 17:14:48 +02:00
MohitMaliFtechiz
badd101177 Added pure white theme for light theme.
* Refactored the all UI to support pure white theme.
* Enhanced the `EdgeToEdge` mode for pure white theme.
2025-08-29 17:01:02 +02:00
MohitMaliFtechiz
683c35d5ac Fixed: Wikimedar application crash caused by Input Dispatching Timed Out.
* Moved the file-scanning logic to the IO thread, allowing smooth directory scanning or ZIM file preparation from the asset directory while keeping the main thread free.
* Refactored `CustomFileValidatorTest` to align with this change.
* Corrected the ZIM URL in `testZimFileRendering` test.
* Improved the `manageExternalLaunchAndRestoringViewState` for thread safety.
2025-08-29 15:53:00 +05:30
MohitMaliFtechiz
cfbc880756 Removed the unused code from detekt_baseline. 2025-08-20 16:06:23 +02:00
MohitMaliFtechiz
f990e1cffb Fixed: Online library sometimes automatically loaded more items without user input.
* Removed the code that auto-scrolled the list to show the progress bar. Now, users will see the progress bar only when they scroll down to load more items.
* Improved `isLoadingMoreItem` handling to avoid duplicate `loadMore` calls after appending items
2025-08-20 16:05:35 +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
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
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
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
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
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
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
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
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