3254 Commits

Author SHA1 Message Date
MohitMaliFtechiz
6e370a1e74 Fixed: The server was not starting automatically after granting notification/storage permissions, whereas it previously started automatically with the XML-based design.
* Fixed: The link was not clickable and was only displaying as plain text in the TextView.
* Fixed: The TagView UI was not adjusting properly when all tags were displayed.
Fixed: The TagView was not positioned at the bottom and had an unintended bottom margin.
* Fixed: The fonts and sizes of the date, article size, and description were not aligned with our current XML design.
* Fixed: The ZIM files list was not updating on the UI when selecting/deselecting items.
* Removed the `activity_zim_host.xml` file from project since it is unused now.
2025-03-15 13:56:54 +05:30
MohitMaliFtechiz
436a001eb9 Refined the TagView to align with our current night/day theme.
* Adjusted the position of ZimFilesLanguageHeader to match the XML-based layout.
Improved the BookItem design by refining the width and height of the ZIM favicon and adjusting its position. Additionally, fixed an issue where icons were being converted to black and white instead of displaying the original favicon.
* Added a new color (surfaceContainer) to our theme, which will be used for all cards in the application. This ensures that card colors automatically adapt to the current night/day theme.
2025-03-13 19:17:08 +05:30
MohitMaliFtechiz
29d0215984 Refactored the ZimHostFragment to use the ZimHostScreen instead of XML layout. 2025-03-13 15:41:15 +05:30
MohitMaliFtechiz
b608b838a3 Created the TagsView for showing the books tags. 2025-03-13 15:40:03 +05:30
MohitMaliFtechiz
674ff5b24c Refined the BookItem for better readability and maintainability.
* Created `ZimFileLanguageHeader` for showing the languages of ZIM files.
2025-03-13 15:39:05 +05:30
MohitMaliFtechiz
817ec20ad9 Created ZimHostScreen compose screen.
* Created BookItem, and LanguageHeader compose screens which we are showing on the ZimHostScreen.
2025-03-12 17:51:22 +05:30
MohitMaliFtechiz
b309032241 Fixed: testNoteEntryIsRemovedFromDatabaseWhenDeletedInAddNoteDialog failing on API level 25. 2025-03-11 19:21:22 +05:30
MohitMaliFtechiz
58b32b5350 Fixed: The NoteFragmentTest was failing.
* Improved the setting of text in noteTextField for better maintainability.
2025-03-11 12:44:40 +05:30
MohitMaliFtechiz
4444a6f236 Refactored the NoteFragmentTest to test with compose UI.
* Added testing tags to our compose UI components which help us to test the compose UI.
2025-03-10 18:35:28 +05:30
MohitMaliFtechiz
5dfb9ed6b5 Refactored the ZimFileRendering test to align with the new ZIM file, as the content of the mainPage in wikipedia_fr_climate_change_mini has changed. 2025-03-10 14:37:38 +05:30
MohitMaliFtechiz
1a166d70f5 Fixed: The ErrorActivityTest. 2025-03-07 23:04:07 +01:00
MohitMaliFtechiz
5ea7e86277 Refined the Compose dependencies.
* Refactored the dependencies to be included only in the modules where they are required.
* Removed unnecessary dependencies from the project.
2025-03-07 23:04:07 +01:00
MohitMaliFtechiz
1743d7b231 Added ErrorActivity UI test case for testing the compose UI.
* Removed the unused code from project.
2025-03-07 23:04:07 +01:00
MohitMaliFtechiz
c5cc0cdd4c Migrated the deprecated detekt rules to new rules.
* Refactored the code according to the new rules of detekt.
2025-03-07 22:57:34 +01:00
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