3191 Commits

Author SHA1 Message Date
MohitMaliFtechiz
415076665a Fixed: ZimFileRendering test was failing.
* This was due to a new `climate_change_mini` ZIM file being uploaded yesterday. Our URL was now downloading this new ZIM file instead of the previous one, while our test case was written for the old ZIM file to check its rendering.
* To fix this, we have provided the direct URL of our ZIM file so that it works correctly.
2025-03-07 11:12:04 +05:30
translatewiki.net
b36e96e2ab
Localisation updates from https://translatewiki.net. 2025-03-06 13:05:53 +01:00
MohitMaliFtechiz
37609ae0b1 Removed the unused code from project. 2025-02-24 17:39:49 +05:30
MohitMaliFtechiz
f9496ddfd4 Fixed: RedundantHigherOrderMapUsage detekt issue to reduce the memory usages 2025-02-24 17:35:20 +05:30
MohitMaliFtechiz
66874849e2 Fixed: UnsafeCallOnNullableType detekt issue 2025-02-24 17:30:23 +05:30
MohitMaliFtechiz
6e804384a9 Fixed: Remaining InjectDispatcher detekt issues. 2025-02-24 17:20:47 +05:30
MohitMaliFtechiz
10446b27b2 Simplified some other conditions which is reported by the detekt. 2025-02-24 16:36:38 +05:30
MohitMaliFtechiz
422e93c6c5 Refactored the unnecessary code. 2025-02-24 14:31:56 +05:30
MohitMaliFtechiz
8527e2070d Improved the naming of constant variables to "SCREAMING_SNAKE_CASE," which is our default naming convention for constants.
* Fixed some other ktlint issues.
2025-02-24 12:42:31 +05:30
MohitMaliFtechiz
6721be1764 Upgraded detekt and ktlint libraries to latest version. 2025-02-21 19:05:43 +05:30
translatewiki.net
262e327f20 Localisation updates from https://translatewiki.net. 2025-02-13 14:41:40 +01:00
MohitMaliFtechiz
4735933fd5 Refactored the FileUtilsInstrumentationTest. 2025-02-13 10:26:37 +01:00
MohitMaliFtechiz
d974822481 Refactored the deprecated method used in our test cases. 2025-02-13 10:26:37 +01:00
MohitMaliFtechiz
6cdc8f23d4 Improved USB and External Hard Drive Path Retrieval for Android 10 and Above.
* The getExternalFilesDirs method only returns the USB path for devices running Android 9 (API 28) and below.
* On Android 10 (API 29) and above, this method returns null when accessing external storage like USB sticks.
* To work around this limitation, we previously appended the /mnt/media_rw/ path manually. While this worked in most cases, it was unreliable across different devices, as the mounted path could vary.
* To ensure accurate retrieval of external storage paths, we have switched to the StorageService API.
* This API, introduced in Android 11 (API 30), directly provides the actual mount paths for all external storage devices, including SD cards, USB sticks, and external hard drives.
* For Android 9 and below, getExternalFilesDirs continues to work as expected, so we use it where applicable.
* This improvement ensures that USB and SD card paths are retrieved correctly on modern Android devices.
* Added debugging logs to capture errors when opening a file in the reader.
* These logs will help us diagnose issues when users share a diagnostic report.
2025-02-13 10:26:37 +01:00
MohitMaliFtechiz
e6f378e165 Fixed: notifyFileOperationSuccess should handle invalid ZIM file unit test case. 2025-02-13 10:26:37 +01:00
MohitMaliFtechiz
ae8974d682 Fixed: Kiwix cannot import ZIM files from the filesystem.
* Displaying a proper error message with the full ZIM path when there is an issue opening the ZIM file or if the selected file is not a valid ZIM file.
* Refactored `CopyMoveFileHandlerTest` to align with this change.
* Updated the documentation to help translators understand this update.
* To resolve the lint error, all string files have been updated. These files will be automatically updated in the latest TranslateWiki PR.
2025-02-13 10:26:37 +01:00
MohitMaliFtechiz
cd67d4060e Added OnlineLibraryFragmentTest instrumentation (UI) test case to test this new functionality. 2025-02-11 17:44:34 +05:30
MohitMaliFtechiz
ec132e6d7f Fixed: When devices went to sleep mode, the search filter was reset of the online library.
* Preserved search query across lifecycle changes to restore it when the fragment becomes visible again.
* Previously, when the device went to sleep, `viewLifecycleOwner` closed the search view due to lifecycle events, resetting the search.
* Now, the query is stored in `ViewModel` (which is lifecycle-aware) and restored when the online library screen is reopened.
* Search is reset only when the user explicitly clears it.
2025-02-11 15:32:57 +05:30
translatewiki.net
f1e1ccf716 Localisation updates from https://translatewiki.net. 2025-02-08 09:18:41 +01:00
MohitMaliFtechiz
fe3597aa7b Fixed: Application crashes at first launch. 2025-02-07 13:50:59 +05:30
MohitMaliFtechiz
67111ef848 Fixed: Searched item was not opening in custom apps. 2025-02-07 13:34:04 +05:30
MohitMaliFtechiz
2fb1896cea Fixed: Restore web view history in Kiwix app.
* Improved restoration of web view history after opening a searched article.
* Refactored `restoreViewStateOnValidJSON` and `restoreViewStateOnInvalidJSON` methods to save and retrieve web view history from the Room database.
* Added detailed comments to methods for better understanding, including guidance for developers to check subclass implementations before making modifications.
* Fixed the `static analysis` errors.
2025-02-07 13:29:01 +05:30
MohitMaliFtechiz
ee50417154 Implemented new approach to save and retrieve the webView history. 2025-02-07 13:28:33 +05:30
MohitMaliFtechiz
08f7751be6 Fixed: The DownloadTest was failing. 2025-02-06 12:48:38 +05:30
MohitMaliFtechiz
a3341fc280 Refactored the ZimManageViewModelTest according to this new change. 2025-02-06 11:54:41 +05:30
MohitMaliFtechiz
7c969fe31d Keeping the downloading books always at the top.
* Added a new "Downloading:" section in `OnlineFragment` to display currently downloading books at the top.
* The language, and search filter will not affect this meaning if a user selects another language and searches any ZIM file via the search feature, the "Downloading:" section always shows on the top and the filter will be applied to the remaining books.
2025-02-06 11:54:41 +05:30
translatewiki.net
376c4d694d Localisation updates from https://translatewiki.net. 2025-02-01 12:10:30 +01:00
MohitMaliFtechiz
6604875bde Refactored the deprecated method used in app module test cases. 2025-02-01 12:07:02 +01:00
MohitMaliFtechiz
b573fe4040 Fixed: The bottom bar disappears when reopening the app from the background.
* The issue was that we were setting the bottom margin to `0` when the fragment was moved to the background (i.e., when switching fragments) to prevent the bottom margin from affecting other screens. This was applied to the `NavHostContainer`, which hosts the reader fragment. Enabling the bottom margin when the fragment view is created worked in most cases. However, on Android 15, the system saves the fragment state and does not recreate the view, which means our margin-setting logic was not executed. As a result, the `bottomAppBar` appeared to disappear, but in reality, it was rendering behind the `BottomNavigationView` (the three options at the bottom).
* To fix this, we now set the bottom margin in the `onResume` method so that whenever the reader screen becomes visible, the bottom margin is automatically adjusted.
2025-01-31 15:33:28 +01:00
MohitMaliFtechiz
561af8f735 Added UI test cases for testing these both scenarios. 2025-01-31 12:49:59 +01:00
translatewiki.net
732b83ac6c Localisation updates from https://translatewiki.net. 2025-01-27 14:24:17 +01:00
MohitMaliFtechiz
0d18419f7a Fixed: Links not working in restored tabs after closing all tabs and restoring them.
* Improved the tab closing and restoring process. Previously, when the user closed all tabs, the `ZimFileReader` was set to null. If the user restored the tabs, a new `ZimFileReader` was created, which was a resource-intensive operation, especially for large ZIM files.
* Now, the `ZimFileReader` is not set to null while the "restore tab" snackbar is visible, allowing users to restore tabs without recreating the ZimFileReader.
* Once the snackbar is dismissed, the `ZimFileReader` is set to null to free up resources since it is no longer required.
2025-01-27 12:13:52 +05:30
MohitMaliFtechiz
22a3b4d9d2 Fixed: Navigation drawer showing while reading a book in fullscreen mode.
* Disabled the right drawer when the user is reading a book in fullscreen mode to ensure uninterrupted reading.
* Also disabled the drawer while a video is playing in fullscreen mode to avoid interruptions during video playback.
2025-01-26 21:07:51 +01:00
MohitMaliFtechiz
65d00fe616 Fixed the scenario where, if the application does not have the MANAGE_EXTERNAL_STORAGE permission and the user tries to open a ZIM file from the file manager, the app now prompts for the required permission instead of showing an error. 2025-01-26 19:19:09 +01:00
MohitMaliFtechiz
daeec25ffd Fixed: If storage permission is permanently denied on Android 11 or below, the selected file via the file picker does not open.
* The storage permission dialog is now shown when the user clicks the "File Picker" button, prompting them to grant the permission first before selecting a ZIM file via the file picker.
* If storage permission is denied or not granted, and the user opens a ZIM file by clicking on it in the file manager, the app will first prompt for permission. Once the permission is granted, the ZIM file will open in the reader. If the permission is not granted, the operation is canceled, and the selected ZIM file will not open.
2025-01-26 19:19:09 +01:00
MohitMaliFtechiz
93b6448362 Refactored the NoteFragmentTest according to this new change. 2025-01-26 17:10:56 +01:00
MohitMaliFtechiz
08e004a819 Fixed: Application crash while adding application shortcuts.
* Using the `ShortcutManagerCompat` class to add dynamic shortcuts instead of directly using the `ShortcutManager` class, as it provides better handling for adding shortcuts.
* The issue occurred because these shortcuts were defined in the manifest, which treated them as immutable and unable to be updated. We removed them from the manifest and added them as dynamic shortcuts. On some devices (e.g., Honor devices), it takes time to remove these shortcuts from the static shortcut list after the user updates the app, causing them to be treated as immutable and unable to be updated. This led to the crash. To fix this, we updated our shortcut IDs so that when the previous static shortcuts are removed by the OS, it will not affect the creation of the new dynamic shortcuts.
* For previously added dynamic shortcuts on other devices, we implemented a removeOutdatedIdShortcuts() method, which removes the old dynamic shortcuts.
2025-01-19 17:06:09 +01:00
MohitMaliFtechiz
4fe022c6a2 Improved the message of Warning dialog to show user where they can verify the ZIM chunks are copied/moved properly. 2025-01-19 16:19:49 +01:00
MohitMaliFtechiz
4e16102bc4 Improved the copying/moving of ZIM chunks.
* Now all the ZIM chunks are copying/moving correctly.
* Improved the warning message to inform user what should they do after copying/moving all the ZIM chunks.
* Implement a feature to directly view the copied/moved ZIM chunks by clicking on the button in warning dialog.
2025-01-19 16:19:49 +01:00
MohitMaliFtechiz
be81ca5405 Showing a warning dialog when copying/moving the ZIM chunks in PS version. 2025-01-19 16:19:49 +01:00
MohitMaliFtechiz
8195194f48 Refactored the IntroFragmentTest to test this new screen. 2025-01-18 15:05:03 +05:30
MohitMaliFtechiz
75b63c069c Added a third intro screen to inform users about changing the storage location for downloading ZIM files. 2025-01-18 14:49:10 +05:30
translatewiki.net
6e09c1a353 Localisation updates from https://translatewiki.net. 2025-01-07 11:35:15 +05:30
MohitMaliFtechiz
7f6f0d4347 Fixed: Application crash caused by "Input dispatching timed out" while retrieving storageDeviceList information in the online library.
* Moved the storage device retrieval to the IO thread.
* Updated the StorageDeviceUtils.getWritableStorage method to a suspend function to ensure execution on the IO thread.
* Refactored CopyMoveFileHandler, OnlineLibraryFragment, KiwixPrefsFragment, and LocalLibraryFragment to adapt to this change.
* Optimized storage device retrieval by caching it in the main activity and reusing it across fragments to enhance performance, especially with large SD cards.
* Refactored the CopyMoveFileHandlerTest.
* Improved the showing of storage device list.
2025-01-06 21:39:34 +05:30
MohitMaliFtechiz
93f4a51013 Fixed the testOpeningFromFileManager was failing on Android 15. 2025-01-03 17:06:48 +01:00
MohitMaliFtechiz
3b24308c92 Fixed: ZimManageViewModelTest, NewRecentSearchDaoTest, and SearchViewModelTest, etc, which were failing. 2025-01-03 17:06:48 +01:00
MohitMaliFtechiz
77f67d4c8f Improved the edge to edge mode in landscape mode.
* It was showing the content behind the display cutout in landscape mode.
* Removed the unnecessary code from BaseFragment.
* Enhanced the applying edge to edge mode for lower devices(Before Android 10).
2025-01-03 17:06:48 +01:00
MohitMaliFtechiz
84807a1930 Fixed: ErrorActivity buttons overlapping in navigation buttons. 2025-01-03 17:06:48 +01:00
MohitMaliFtechiz
82ba9f3299 Fixed: The navigationView and rightDrawerView was overlapping on statusBar. 2025-01-03 17:06:48 +01:00
MohitMaliFtechiz
4157903682 Fixed: The recyclerview content was going in the statusBar. 2025-01-03 17:06:48 +01:00