8455 Commits

Author SHA1 Message Date
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
Kelson
952f039345
Merge pull request #4183 from kiwix/Fixes#4180
Removed the unnecessary creation of ZimFileReader when opening notes on the Notes screen.
2025-01-26 19:18:34 +01:00
MohitMaliFtechiz
93b6448362 Refactored the NoteFragmentTest according to this new change. 2025-01-26 17:10:56 +01:00
MohitMaliFtechiz
7acbbb54c0 Removed the testing log. 2025-01-26 17:10:56 +01:00
MohitMaliFtechiz
6387c5ceae Removed the unnecessary creation of ZimFileReader when opening notes on the Notes screen.
* Refactored `AddNoteDialog` to use database values for performing note-related operations (e.g., view, edit, delete notes) instead of setting and using `ZimFileReader`.
2025-01-26 17:10:56 +01:00
Kelson
86ddd87076
Merge pull request #4178 from jackq97/main
Updated detekt configuration to support compose:
2025-01-26 17:10:02 +01:00
Jaskq
c11f8561db Updated detekt configuration:
- Removed 'Preview' from `ignoreAnnotatedFunctions` in Complexity rule set.
'not supported in this version'
- Updated `constantPattern` to `[A-Z][_A-Z0-9]*` for TopLevelPropertyNaming rule.
- Added 'Preview' to `ignoreAnnotated` in UnusedPrivateMember rule set.
2025-01-22 15:20:33 +05:30
Jaskq
29fdbc1913 Updated detekt configuration:
*   Increased the `functionThreshold` for `LongParameterList` from 6 to 8.
*   Enabled `ignoreDefaultParameters` for `LongParameterList`.
*   Updated `functionPattern` to allow uppercase letters at the beginning.
* Add  `ignoreAnnotatedFunctions` to `['Preview']`
* Add `ignoreAnnotated` to `['Composable']`
* Updated `constantPattern` to accept uppercase letters followed by alphanumeric characters.
* Enabled `ignorePropertyDeclaration` for `MagicNumber`.
2025-01-22 15:20:33 +05:30
Kelson
62722191a7
Merge pull request #4162 from kiwix/Fixes#4161
Fixed: Application crashes when opening the random article.
2025-01-19 17:17:24 +01:00
MohitMaliFtechiz
85427c4551 Improved the behavior of enabling menu buttons.
* Previously, when a ZIM file was in the process of opening, the reopenBook method was used to hide the "Open Library" button if it was visible. However, this method also enabled the menu buttons. If an error occurred while loading the ZIM file, the controls remained enabled, which was not desirable. Now, the "Open Library" button is hidden, and the menu buttons are shown only after the ZIM file has successfully loaded. If an error occurs during loading, an error message is displayed (as it was previously), and the UI is updated accordingly.
2025-01-19 17:07:56 +01:00
MohitMaliFtechiz
c60ea98b73 Fixed the issue where opening a random article caused the application to crash.
* The issue occurred in the Play Store variant, specifically with the copy/move functionality for ZIM files. After copying or moving a ZIM file, the application attempts to open it in the reader. However, if the application tries to open a split ZIM file with only one chunk, it throws an error indicating that the file is not a valid ZIM file (which is expected, as not all ZIM chunks have been copied/moved). When this error occurs, the menu buttons remain enabled, allowing the user to interact with them. If the user then attempts to open a random article, the application enters an infinite loop and crashes. To resolve this, we now disable the menu controls whenever an error occurs while opening a ZIM file, preventing the user from using them in such scenarios.
2025-01-19 17:07:56 +01:00
MohitMaliFtechiz
1791911f13 Fixed: infinite loop and improve error handling for fetching random article.
* Fixed an issue where the app would enter an infinite loop when the zimFileReader was null, causing a crash.
* Improved the condition to check if zimFileReader is null and show a proper error message to the user without retrying.
* Added a retry mechanism to attempt fetching the random article twice in case of an internal error in libzim.
* After two failed attempts, an error message is displayed to the user if the random article is not found.
2025-01-19 17:07:56 +01:00
Kelson
ef1239fa4a
Merge pull request #4167 from kiwix/Fixes#4166
Fixed: Application crash while adding application shortcuts.
2025-01-19 17:07:05 +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
Kelson
bcc6ac88ce
Merge pull request #4168 from kiwix/Fixes#4128
Changed the website, and Nightly APKs name.
2025-01-19 17:05:16 +01:00
MohitMaliFtechiz
12c0e17197 Changed the website, and Nightly APKs name.
* Before the name was `kiwix-3.13.0.apk` for the release APK(with app id org.kiwix.kiwixmobile app id) we were uploading on the website. But now, we are uploading the standalone APK on the website(with org.kiwix.kiwixmobile.standalone app id) it is a breaking change, and users are not aware of it. So we are changing the APK name so that users can understand this change.
* Renamed the nightly APK since there also we are uploading the standalone APK.
2025-01-19 16:20:53 +01:00
Kelson
1949d29973
Merge pull request #4170 from kiwix/Fixes#4045
Showing a warning dialog when copying/moving the ZIM chunks in PS version.
2025-01-19 16:20:29 +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
c69efb1523 Improved the showing of the warning dialog so that all the instructions are clear to the user. 2025-01-19 16:19:49 +01:00
MohitMaliFtechiz
10734ec75f Improved the warning message we are showing to the user after copying/moving the ZIm chunks. 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
Kelson
1ec8f2cd00
Merge pull request #4172 from kiwix/Fixes#4146
Added a section in the README file to showcase the two variants of our application.
2025-01-19 16:19:23 +01:00
Emmanuel Engelhart
aedfb8dae8
Light simplification 2025-01-19 16:18:59 +01:00
MohitMaliFtechiz
1f322aa1f9 Added a section in the README file to showcase the two variants of our application.
* It explains why we introduced two variants, highlights the differences between them, and provides guidance on how users can transfer their content from the previous app to the new app.
2025-01-19 15:52:31 +01:00
Kelson
6933feb9e1
Merge pull request #4179 from kiwix/Fixes#3531
Added a third intro screen to inform users about changing the storage location for downloading ZIM files.
2025-01-18 12:02:17 +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
Kelson
c069a129e8
Merge pull request #4177 from kiwix/improvement_in_showing_download_notification
Improved handling of completed and canceled download notifications(When app is in background or closed).
2025-01-18 08:15:45 +01:00
MohitMaliFtechiz
eb0f247ff0 Improved handling of completed and canceled download notifications.
* Fixed an issue where the notification for a completed download would disappear when the same notification ID was used for the foreground service.
* Enhanced the cancellation logic to immediately remove the ongoing download notification when the user cancels a download and no other downloads are active. This resolves the delay (2-3 seconds) that occurred when the notification was set as the foreground notification.
* Added the necessary comments in methods to understand this fix.
2025-01-16 18:08:27 +05:30
Kelson
bff8a97055
Merge pull request #4176 from kiwix/Fixes#4175
Fixed: The ZIM file was displayed on the library screen but failed to open (the ZIM file was located in the SD card's trash folder).
2025-01-16 10:10:58 +01:00
MohitMaliFtechiz
8ded3d350a Fixed: Failing unit test case.
* Added a new unit test to verify that books located in the trash folder do not appear on the library screen.
2025-01-16 11:41:06 +05:30
MohitMaliFtechiz
6c1b82da3d Fixed: The ZIM file was displayed on the library screen but failed to open (the ZIM file was located in the SD card's trash folder).
* Improved the scanning process for ZIM files to reduce scan time by excluding hidden folders, which are unnecessary and caused delays in scanning.
* Updated MediaStore to exclude ZIM files located in the SD card's trash folder, addressing the issue.
* Refactored the NewBookDao to remove any ZIM files from the library screen if they are located in the trash folder.
2025-01-15 20:46:23 +05:30
Kelson
283d845a6d
Merge pull request #4144 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2025-01-07 07:45:25 +01:00
MohitMaliFtechiz
16ea590c8c Updated the documentation for pref_free_storage. 2025-01-07 11:36:02 +05:30
translatewiki.net
6e09c1a353 Localisation updates from https://translatewiki.net. 2025-01-07 11:35:15 +05:30
Kelson
1e5bc58f15
Merge pull request #4164 from kiwix/Fixes#4163
Fixed: Application crash caused by "Input dispatching timed out" while retrieving storageDeviceList information in the online library.
2025-01-06 20:38:00 +01:00
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
Kelson
3c4614e3d7
Merge pull request #4156 from kiwix/Fixes#4120
Added functionality to generate APK for a specified date.
2025-01-06 13:26:19 +01:00
MohitMaliFtechiz
0ec90f06b0 Added logs to check whether the environment variable is set, for debugging purposes.
* Improved the ID of the "Retrieve date from git revision" job.
* Removed unnecessary conditions from the workflow.
2025-01-06 13:17:16 +05:30
MohitMaliFtechiz
befd7d389a The testing_release job is skipped, if the application is being uploaded with the same version as the previously uploaded one, and Play Store gives the error for same version code. This prevents the CD pipeline from failing due to this error, while for all other errors, the workflow will fail as expected. 2025-01-04 16:24:47 +05:30
MohitMaliFtechiz
66f3d4d7cd Refactored all CD pipelines to generate APKs and app bundles based on the relevant git revision.
* The date is extracted from the specified git revision and set in the `KIWIX_ANDROID_RELEASE_DATE` environment variable, and the version code is generated for that date.
* This feature has been added to the Release section in the README file.
2025-01-04 12:24:26 +05:30
MohitMaliFtechiz
ce830093f9 Made the LAST_DATE const so that it can not be changed. 2025-01-04 10:02:29 +05:30
MohitMaliFtechiz
40285a7cfd Documented this new feature in the README.md file so that this feature can be easily used. 2025-01-04 10:02:19 +05:30
MohitMaliFtechiz
a371ae6d67 We refactored our dummy_bundle.yml workflow to generate the dummy bundle and APKs based on a specified date, using a new tag format dummy_bundle_and_apk_v*, where * is replaced by the date in YYYY_MM_DD. This date is extracted and set as an environment variable to generate the app bundle and APK for that date, defaulting to the current date if no date is provided.
* Now, our `dummy_bundle.yml` will generate both the app bundle and APKs, so if we need the APK for a specified date, we can easily retrieve it.
* Added comments in both workflows to understand the flow of the workflows.
2025-01-04 10:02:05 +05:30
MohitMaliFtechiz
ae7988f112 Refactored testing_release CD workflow to generate and publish the application on the Play Store based on a specified date, using a new tag format internal_testing_v* where * is replaced by the date, which is extracted and set as an environment variable to generate the app bundle for that date, defaulting to the current date if no date is provided, and uploading the generated app bundle to the Play Store. 2025-01-04 10:01:55 +05:30
MohitMaliFtechiz
caa45c5f51 Renamed the environment variable to KIWIX_ANDROID_RELEASE_DATE.
* Made `LAST_DATE` and `BASE_VERSION_CODE` constants, as these values are crucial for our app and should not be changed. We have marked them as constants and added comments to ensure they remain unchanged.
2025-01-04 10:01:40 +05:30
MohitMaliFtechiz
29616b1cf7 Fixed: Reproducible Builds.
* To generate the APK for a specific date, set the "RELEASE_DATE" environment variable in the format `YYYY-MM-DD`. The APK will be generated for the specified date. If the variable is not set, the APK will be generated for the current date.
2025-01-04 10:01:32 +05:30
Kelson
359a1fc4bc
Merge pull request #4147 from kiwix/Fixes#3990
Added support for Android 15.
2025-01-03 17:07:24 +01:00