2940 Commits

Author SHA1 Message Date
Sagar
893bd9cf4d #3675 Notification Navigation to KiwixReaderFragment 2024-01-30 19:13:10 +01:00
MohitMaliFtechiz
87632c5f6a Fixed ZimHostFragment which is failing on API level 33.
* Improved the permission.
* Enabled wifi programmatically in emulator.
* Improved test case for showing "Wifi connection dialog".
2024-01-14 19:08:31 +05:30
MohitMaliFtechiz
24e10caf19 Fixed: Application crashing below API level 29 when we select the external storage.
* The issue was with the `FileObserver` class constructor we used, which is introduced in SDK 29. As a result, it is not available for older versions, leading to a `NoSuchMethodError` when attempting to access it. This caused the application to crash below API level 29 when selecting external storage.
2024-01-12 08:11:48 +01:00
MohitMaliFtechiz
17068b540e Fixed: When we select any ZIM file using the file picker, it is not being added to the library screen. 2024-01-05 14:11:26 +01:00
translatewiki.net
2b01dec0f0 Localisation updates from https://translatewiki.net. 2024-01-05 14:10:48 +01:00
MohitMaliFtechiz
9b148682f4 Fixed HelpFragmentTest that is failing on API level 30,33. 2023-12-29 09:44:21 +01:00
MohitMaliFtechiz
aeca8d2e1a Fixed: Extracted the website link from the string file for the Play Store restriction dialog.
* Removed the link from `zim_files_not_showing_description`.
* Modified the dialog for displaying the link in `PlayStoreRestrictionPopup`.
* Refactored the `rawTitleDescriptionMap`() method in `HelpFragment` to accommodate both strings and arrays for showing links inside the HelpFragment.
2023-12-29 09:44:21 +01:00
MohitMaliFtechiz
0e61bdd7d8 Removed the lint suppression for "NewApi". 2023-12-23 10:25:54 +01:00
MohitMaliFtechiz
cc744b2b74 Fixed: 3.9.0 Welcome screen does not run, and Kiwix does not prompt for permissions.
* This commit addresses the scenario where, for any reason, shared preferences and the database are retained on the device, and the list of ZIM files is visible in the library. However, the `MANAGE_EXTERNAL_PERMISSION` is not found, and when a user attempts to open a file, the application lacks the necessary permission. To improve this scenario, we now prompt the user for permission if it is not available when opening ZIM files from the library.
* Additionally, enhanced the behavior of the swipe refresh layout if the user clicks on the "NO" button in the permission dialog.
2023-12-23 10:25:54 +01:00
MohitMaliFtechiz
dcc8a40751 Increased timeout for waiting the views in ZimHostFragmentTest since on Android 13 it takes time to find the views. 2023-12-15 19:09:22 +05:30
MohitMaliFtechiz
b572d02e6c Fixed HelpFragmentTest and PlayStoreRestrictionTest on api level 24 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
90dc8ec292 Enhanced the visibility of the ZIM file on the help screen for testability.
* Introduced test cases for the new functionality to ensure its expected behavior in both variants, such as Play Store and non-Play Store.
* Updated other test cases to accommodate the testing of this new functionality.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
c20b40e389 Added a button to the startup message dialog to directly open the Kiwix website for downloading the APK. This will make it easier for the user who wants to download the full APK version of the Kiwix app. 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
c3a6a52255 Added play store restriction dialog 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
7d276658d4 Fixed Start-up message to inform about the restrictions on the Google Store app to open sideloaded ZIM files.
* Showing play store restriction to the users in the help screen in play store variant.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
1b6be45826 Fixed LocalLibraryTest that was failing. 2023-12-14 07:51:52 +01:00
MohitMaliFtechiz
736d95285d Fixed unable to open zim files on sd card in version 3.8.1
* If the ManageExternalStorage permission has not been granted, introduce the request, particularly when accessing features that necessitate this permission, such as downloading ZIM files, selecting a ZIM file from storage via the file picker, and refreshing the list of available ZIM files in storage.
2023-12-14 07:51:52 +01:00
translatewiki.net
e2585529d2 Localisation updates from https://translatewiki.net. 2023-12-01 21:05:15 +01:00
MohitMaliFtechiz
04868ecfdd Fixed: Numerous issues with links were reported by the Play Store.
* The Play Store highlighted the need to add "/" to the beginning of the `android:pathPattern`. As a result, we have now included "/" at the beginning of all `android:pathPattern` instances to ensure compatibility with the Play Store.
* Additionally, the `android:autoVerify="true"` attribute has been added to intent filters to verify domain ownership. This was identified as an issue by both the Play Store and the App Links Assistant tool in Android Studio.
2023-11-25 10:14:53 +01:00
MohitMaliFtechiz
46b51bb710 Fixed, Bookmark toggle is not on when opening bookmarks for existing opened book.
* Fixed the issue by correctly setting up the bookmark disposable for the current ZIM file when opening bookmarks for the currently opened book.
2023-11-22 11:30:42 +05:30
MohitMaliFtechiz
52fefe7df7 Moved version-related properties from individual build.gradle files to a common configuration file (Config.kt).
* The `Config.kt` now holds the version information we can directly change the versionCode here and it will automatically replace in both gradle files.
* Removed duplicate version configurations from build.gradle files.
2023-11-21 12:44:37 +05:30
MohitMali
748f0c4d5f Moved openSearchItem, findInPage functionality to our CoreReaderFragment as we were using same code twice for these methods in app and custom module. 2023-11-16 19:10:02 +05:30
MohitMali
088f28d1d6 Fixed MimeTypeTest. 2023-11-16 18:16:35 +05:30
MohitMali
f6b01a4f28 Fixed, I can't open Zim from an external download.
* We are now using fileDescriptor to open the zim files with uris when someone tries to open the zim file directly from storage.
* As now we are using the assetFileDescriptor instead of direct files, we have refactored the functionality of saving (note, history, bookmark) so that we can open the same pages on the same zimFile.
2023-11-16 18:10:53 +05:30
MohitMali
ae0893095c Fixed MimeTypeTest compilation error 2023-11-12 18:06:05 +01:00
MohitMali
4baff853fa Fixed, can not open ZIM files from phone storage via the file picker in Android 13.
* Improved the permission request scenario for 'MANAGE_EXTERNAL_STORAGE' in Android 13. In the non-play store variant, we were not prompting users to grant this permission, and they were unaware that it was necessary to access the ZIM files in their storage. To resolve this issue, we now request this permission.
2023-11-12 18:01:28 +01:00
MohitMali
969ad0d4b1 Increase timeout to check views are displayed or not. 2023-11-11 08:48:22 +01:00
MohitMali
a7b5a7730f Fixed test failure on API level 33.
* In the `ZimHostFragment`, there were occasional test failures due to specific conditions. When reattempting the test, it failed to detect the 'WiFi connection detected' dialog because the server was already running. To resolve this issue, we have improved our test case. Now, we first check if the server is already running. If it is, we close the server before running the test case.
* In previous test failures within the `ZimHostFragment`, there were instances where the zim file was unselected, causing our test case to fail to locate the required views. To mitigate this, we now check whether the zim file is selected. If it's not selected, we first select the zim file before running the test case.
* n the `LocalLibraryFragment` test, there were cases where it was unable to locate the 'file_management_no_files' view due to variations in the order of test cases. This occurred because a zim file was sometimes present in the `LocalLibrary`. To address this, we now check for the presence of any zim files in the `LocalLibrary` and delete them before running our test case.
2023-11-11 08:48:22 +01:00
MohitMali
96b1b195d5 Fixed ZimHostFragment failing on API level 33 (Android 13) because it has the SYSTEM_ALERT_WINDOW permission which is not grantable through code on Android 13, so we have removed this permission from our ZimHostFragment test as well as from our other test cases since we had added this to fix the test cases because without this permission test cases were not launching on API level 21, and now our minimum SDK version is 24 so this permission is no longer needed. 2023-11-11 08:48:22 +01:00
MohitMali
8a4056592e Improved ZimHostFragmentTest.
* We have made improvements to `ZimHostFragmentTest`. We added the `ACCESS_FINE_LOCATION` permission, which is required for running this test case on real devices. Additionally, we have enhanced the permission array and removed unnecessary permissions from the test case.
2023-11-11 08:48:22 +01:00
MohitMali
3432b32431 Improved ZimHostFragmentTest to properly test the server functionality.
* Created a new class to match the how many checkbox is checked in the recyclerview, it will also help to test this type of functionality in future.
2023-11-11 08:48:22 +01:00
MohitMali
d660d806a2 Added test cases for ZimHostFragment 2023-11-11 08:48:22 +01:00
MohitMali
0b59d9c586 Fixed, the DWDS app is very slow when opening a search result.
* Now, `libkiwix` provides the `pageUrl` along with the `pageTitle` (searchTitle). Previously, we were not using this `pageUrl` provided by `libkiwix`. Instead, we were making another request for the `pageUrl` based on the `pageTitle`, which was slowing down the process. We have now started directly using the `pageUrl` provided by `libkiwix` during the search. This change has made the process much more efficient and faster.
* To ensure the previously saved searches still work as expected, we have implemented a condition.
* We have added a new column in RecentSearchEntity for saving the `pageUrl` that we will use when user clicks on the recentSearchHistory.
2023-10-31 13:29:36 +01:00
translatewiki.net
bf089fdea0 Localisation updates from https://translatewiki.net. 2023-10-30 13:09:52 +01:00
MohitMali
bfc0b4af11 Fixing Test Case Failures on API Level 33.
* Resolved the issue where `testShowCase` sometimes hung and failed. The test was failing because it only allowed showcasing a feature once. We improved the test case by clearing the previously shown `ShowCaseView` from its preferences when the test runs.
* Fixed failures in `LanguageFragmentTest` caused by a race condition where the test checked for saved language data immediately, sometimes failing to save the data quickly enough. We added a delay before checking the saved data to address this issue.
* Addressed failures in `DownloadTest` and `InitialDownloadTest` due to issues with previously running downloads. If a download task failed in a previous run, the test couldn't find the download button. In the case of `InitialDownloadTest`, the StorageConfigureDialog was not displayed. We now check for any ongoing downloads before performing new operations and cancel them if necessary, ensuring that the tests run as expected.
2023-10-21 22:03:56 +02:00
MohitMali
350c3ba9b8 Improved testShowCaseFeature which are sometimes failing on the API level 33.
* Increased waiting for checking views are visible or not, on API level 33 sometimes it is taking long to show the views.
2023-10-21 22:03:56 +02:00
MohitMali
2ff2387876 Fixed the memory leak in LocalFileTransferFragment.
* The issue is inside the library, they forgotten to detach the view after its successful use, means when the showCase is shown they are not detaching the view from window which causing the memory leak. They have not mentioned this step into their documentation to address the memory leak.
2023-10-21 22:03:56 +02:00
MohitMali
5e2c314f74 Added test cases to comprehensively assess the ShowCaseView functionality.
* Ensured that the showcase view is displayed in full only once, and subsequent displays are prevented.
* Improved variable naming for clarity.
* Fixed TopLevelDestinationTest.
2023-10-21 22:03:56 +02:00
MohitMali
76b6f5c7c6 Fixed TopLevelDestinationTest 2023-10-21 22:03:56 +02:00
MohitMali
a8b41f5b15 Introduce 'MaterialShowCase' feature to provide user education on the file transfer functionality. 2023-10-21 22:03:56 +02:00
MohitMali
c81ae5d730 Fixed Refactor LocalFileTransfer UI.
* Reduced the `view_device_list_boundary` height to match the one below it, resulting in a more consistent appearance.
* Enhanced the permission request scenario; previously, permissions were requested one by one when the user clicked on the search button. Now, we request all necessary permissions at once to improve the user experience.
2023-10-21 22:03:56 +02:00
MohitMali
41be43d292 Fixed ZimHostFragment Open Issue for Both App and Custom Modules.
* We moved our server functionality to the core module to enable its use in both our app and custom modules. However, this change posed a challenge. We had a functionality that, when the user clicks on a notification, it takes them to the hosted book screen. By moving this functionality to the core module, we lost direct access to the navigation graph and `KiwixMainActivity` or `CustomMainActivity`.
* To address this issue, we introduced some abstract variables, such as navGraphId and mainActivity, which we set from both `KiwixMainActivity` and `CustomMainActivity`. This allows us to retrieve the navigation graph ID and the main activity.
* Additionally, we implemented a new function in `CoreApp` to set the currently running `CoreMainActivity`, which we use to obtain the navigation graph ID and main activity to perform the user click on notification.
2023-10-14 09:59:39 +02:00
MohitMali
94d592f545 Reintroduce wifi hotspot feature in custom apps.
* Moved wifi hotspot related files to core module to use hotspot functionality in both app and custom module.
* Moved permission in core manifest to access them in both modules.
* Removed some unnecessary files which is now no longer in use.
2023-10-14 09:59:39 +02:00
MohitMali
5e9f183f6a Fixed, unable to open the support link with default browser.
* Fixed, pdf are not opening with default pdf viewer.
* Fixed, sending email are failed with default email service.
* Fixed, opening support link, external urls with default browser.
2023-10-13 18:45:12 +05:30
MohitMali
530faa46bb added a test case to evaluate the functionality of LocalFileTransferFragment.
* This test case is designed to verify that the functionality works correctly, especially addressing the issue where `LocalFileTransferFragment` would shut down when attempting to search nearby devices for connection.
2023-10-05 08:14:04 +02:00
MohitMali
e4d27e19a1 Improved code for android 13. 2023-10-05 08:14:04 +02:00
MohitMali
57a95f15d1 Fixed, The File transfer feature does not work in android 12, android 13.
* In Android 13, we previously used `intent.getParcelableArrayExtra` to retrieve the status of `P2P_DEVICE_CHANGED`. However, this method returned null because it's not actually an array. To resolve this issue, we have updated it to use `intent.getParcelableExtra`.
* For Android 12, we used to check the network state through `ConnectivityManager` every time the `WIFI_P2P_CONNECTION_CHANGED_ACTION` action was triggered. However, this approach wasn't reliable, as the action being triggered didn't guarantee a change in the network state. Instead, it sends an intent that we should now check for network changes. As a result, we have modified our code to utilize this intent within the `KiwixWifiP2pBroadcastReceiver`.
2023-10-05 08:14:04 +02:00
MohitMali
e4624b238b Handled download on the first run when no ZIM file is found.
* We are showing a custom error message to the user for this type authentication urls because we does not have any authentication values in our application so it will always fail to download the zim file, so we are showing a error message where we inform to user to reinstall application from the playstore. Since play store application have the zim file in it.
2023-10-04 19:17:12 +02:00
MohitMaliFtechiz
221f84b2bf Improved the "load more" functionality for search and introduced several other enhancements:
* Added logging for cases where the `ZimFileReader` failed to find an entry, failed to load an asset, and more.
* Significantly improved the "load more" functionality: Now, if the user is near the end of the list, we start loading new search results. This enhancement enhances the user experience by reducing wait times for new search results.
* Added references in the `KiwixServer` class to help developers understand why we are keeping the library object.
* Implemented test cases to thoroughly test the `getMimeTypeFromUrl()` function in the ZimFileReader class.
* Enhanced the search functionality by consolidating the use of a single viewModelScope instead of multiple coroutines, reducing the potential for future issues.
2023-09-18 19:13:20 +02:00
MohitMali
1281c0c795 Improved test cases and fixed memory leak in application.
* Previously our test cases were launching the `KiwixMainActivity` twice (firstly it sets the values in preference and then relaunch the activity) before running the test case which was the cause of slow testing and sometimes it caused to memory leak in some api levels so we have refactored our test cases to launch `KiwixMainTest` once per test case.
* `IntroFragmentTest` is failing on api level 24 due to a memory leak because after clicking on getStarted button is going to the LocalLibrary page but somehow `onStart` and `onStop` methods are calling of the `CoreReaderFragment` which stablish the `serviceConnection` but it was happening very quickly so before attaching the binder to `readAloudService` unbindService method called but at this point service was not created but creating was in progress so after going to library screen it allocate memory to `readAloudService` but `ReaderFragment` is no more visible to the user that's why memory leak happened. We have fixed it by unbinding the service in `onDestroyView` method.
2023-09-18 19:13:20 +02:00