2144 Commits

Author SHA1 Message Date
MohitMali
8178bbd98f Fixed, unit coverage failure. 2023-10-31 13:29:36 +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
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
a8b41f5b15 Introduce 'MaterialShowCase' feature to provide user education on the file transfer functionality. 2023-10-21 22:03:56 +02:00
MohitMali
ec3095e484 Improved code to show proper error message to the user why the server is failed to start.
* if we run 2 servers at once (if in `app` server is already running then we can not run the server on the `custom` module since we can not run 2 servers on the same IP.) So for this, we have improved our code to show the proper error message so the user will know why the server is not running.
2023-10-14 09:59:39 +02:00
MohitMali
cb73c90bfc Fixed, the book is always unselected on the hosted books screen in custom apps. 2023-10-14 09:59:39 +02:00
MohitMali
8dda3678fb Fixed custom app not displaying Zim information on the Server screen 2023-10-14 09:59:39 +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
Gouri Panda
717d593ad3 Fixed the bug that was happening in the ci 2023-10-07 20:05:50 +05:30
MohitMali
3332421c60 Remove Authentication from URL before downloading.
* We have remove the authentication the url to make it normal url because we are adding authentication in headers so does not need to add in url.
* Enhanced getting secret function, if url is encoded then it will fail to get the secret from it so now we are properly decoding the url before extracting the secret key from it.
* To properly test these two functions we have added test cases for it.
2023-10-06 19:08:52 +05:30
Amir E. Aharoni
d210cc7ad2 Improve punctuation in a recently-added message 2023-10-05 10:04:54 -04:00
MohitMali
51c3ce3d51 Fixed unit coverage 2023-10-05 14:08:24 +05:30
Emmanuel Engelhart
cb20f85915
Fix URL template detection 2023-10-04 20:15:36 +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
MohitMali
97eaa1a4c7 Review changes done.
* We have removed the dwds dependent code, now we are using `Regex` expression to match if it is authentication url then we are adding `Authorization` in header.
* To ensure this methods works perfectly in every scenario we have added test cases for it.
2023-10-04 19:17:12 +02:00
MohitMali
3136b00e1d Removed hardcoded secret name.
* We have removed the hardcoded secret name from the code, now we are extracting secret name from the url.
* Now we are getting userName and password from single secret.
2023-10-04 19:17:12 +02:00
MohitMali
7e9aee96fa We have fixed the issue of downloading not working in the custom app for the DWDS application. We had added the BasicAuthInterceptor to the NetworkModule, but it is responsible for resolving the URLs. However, for downloading the ZIM files, we need this BasicAuthInterceptor in the OkHttp client of the DownloaderModule which is responsible for downloading zim files. 2023-10-04 19:17:12 +02:00
Gouri Panda
7fc249f709 Authentication created for DWDS app 2023-10-04 19:17:12 +02:00
MohitMali
59834f112f Fixed Zimit-generated zim files were partially failing to open.
* The issue was that we were not properly uninitialized the service worker, which was sometimes causing problems and preventing us from reading the `Zimit-generated` zim files. Therefore, we have now implemented the proper uninitialization of the service worker before loading the URLs for new zim files.
2023-09-20 17:42:41 +05:30
MohitMali
9ff91bac57 Remove the unnecessary SearchState object since we no longer need it in the SearchFragment. We are now directly obtaining additional search data from the SearchViewModel, which already contains the SearchState. 2023-09-18 19:13:20 +02:00
MohitMali
ec007e4399 Moved the load more data logic to SearchViewModel class to manage separate concerns. 2023-09-18 19:13:20 +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
MohitMali
f1889ee1d2 Fixed bugs and enhanced search functionality.
* A bug was introduced after enhancing the search functionality to align with the new `java-libkiwix` wrapper. Initially, when searching for any article in the ZIM file, the loading progress bar was not being displayed. This commit resolves this issue.
* While searching within large ZIM files, the application used to freeze momentarily due to fetching data from the `libkiwix` on the UI thread. We have improved this functionality to provide a seamless user experience.
2023-09-18 19:13:20 +02:00
MohitMali
609e9e268f Improved 'Search' Functionality:
* Added a loading progress bar at the end of the RecyclerView when loading more search results as the user scrolls to the bottom. This indicator informs users that additional results are being loaded. The progress bar appears if there are more results available for the search term, providing users with visibility into ongoing loading.
* Enhanced the search loading process for larger ZIM files by introducing coroutines. This background threading approach prevents the UI thread from being impacted and ensures a smooth scrolling experience for users.
2023-09-18 19:13:20 +02:00
MohitMali
51ef8af68d Use SuggestionSearch instead of Search for better search functionality.
* Since `Search` is not compatible with those zim files which does not have Xapian index but `SuggestionSearch` have this functionality to search inside those zim files so we have used this.
* Update test cases for test new search functionality.
2023-09-18 19:13:20 +02:00
MohitMali
f29be04eac Improved article loading.
* We are previously checking `hasEntryByPath`, `hasEntryByTitle`, `mainEntry.isRedirect` which are internally calling the same function as we are calling after checking this condition so it would be better to directly use those function to avoid calling same function twice see more details https://github.com/kiwix/java-libkiwix/pull/60.
2023-09-18 19:13:20 +02:00
MohitMali
ac78a67cf4 Improved the code, removed unnecessary parentheses 2023-09-18 19:13:20 +02:00
MohitMali
376776c099 Imrpvoed pagination search, avoid loading unnecessary data when user at the end of list and there is no data available to show 2023-09-18 19:13:20 +02:00
MohitMali
dd1ae68b4f Fixed duplicate searched items are showing 2023-09-18 19:13:20 +02:00
MohitMali
3edfd88cfb Updated test cases to accommodate the new search functionality.
* Due to linking errors with libkiwix/libzim functions, direct usage in testing was not possible. To address this, helper classes were created, similar to those in `java-libkiwix`, for testing the search functionality.
2023-09-18 19:13:20 +02:00
MohitMali
adea940f72 Introduced an endless suggestion list in search.
* With the integration of libkiwix12, we now receive full results based on the search term. Previously, we were loading the entire list, but we have now implemented pagination to enhance the search functionality.
* The libkiwix provides us with a Search object, which enables us to obtain the suggestion list using start and end indices. Consequently, we have modified our `ZimSearchResultGenerator` code to return the `Search` object instead of a list.
* To accommodate the changes, we have updated the return type of `SearchResultGenerator` to a nullable Search. This change is necessary because we initialize the `SearchState` when the search is initialized in `SearchViewModel`, and initially, we do not have the Search object available. The nullable return type allows us to pass the Search object when it becomes available.
2023-09-18 19:13:20 +02:00
MohitMali
632bb4a528 Refactored code to remove lint errors
* Now our minimum SDK version is 24 and we are using some conditions placed on behalf of this api level which are unused now, so we have removed those conditions.
* Removed `CompatV21` file as now it is unused.
* Renamed `CompatV23` to `CompatV24` and refactored the code to support our new minimum api level.
* Refactored `NetworkUtilsTest` to support api level 24.
2023-09-18 19:13:20 +02:00
MohitMali
f7517a2272 Minimum SDK version changed to 24: The NDK version in kiwix-build has been upgraded (as mentioned in https://github.com/kiwix/kiwix-build/issues/544). However, to make this upgrade compatible, the minimum SDK version had to be updated to 24 since the NDK version is not compatible with Android API levels below 24. The README.md file has been updated to reflect the new minimum Android support version, which is now Android 7, due to the change in the minimum SDK version. Since the project's minimum SDK version is now 24, some conditions related to Android 23 and 24 have become unused. These unused conditions have been removed, and along with that, the drawable-night-23 and drawable-23 launch_screen.xml files, which were no longer in use, have also been removed. 2023-09-18 19:13:20 +02:00
MohitMali
d188a8262a Improved search functionality
* Fixed search unit test cases.
* Improved the search functionality to perform the unit test case for search.
2023-09-18 19:13:20 +02:00
MohitMali
e363889eaf Fixed search functionality crash if any FT Xapian index not found in any zim file 2023-09-18 19:13:20 +02:00
MohitMali
6e0336ebf7 Using newly published 'libkiwix 1.0.0' from maven 2023-09-18 19:13:20 +02:00
MohitMali
bbd23d1693 Fixed loading content which contains a query params, mostly this fix is for newly created zim files 2023-09-18 19:13:20 +02:00
MohitMali
75fab0635e Refactored search functionality according to the new wrapper 2023-09-18 19:13:20 +02:00
MohitMaliFtechiz
e69499fa03 Removed the relinker dependency from the project, since now we are loading the .so files on the libkiwix side. Enabled the loadICUData method, since now it is fixed on the libkiwix side. Search and server is now starting successfully, but need some refactoring, for that see next commit. 2023-09-18 19:13:20 +02:00
MohitMali
384bacc877 Refactored code to safely get the metadata of zim files 2023-09-18 19:13:20 +02:00
MohitMali
161337a818 Start using libkiwix 11.0.0 from maven, loading wrappers .so files for fixing the jni crash which we have missed loading in libkiwix 2023-09-18 19:13:20 +02:00
MohitMali
a1ee8bec25 Fixed zim file size issue in library section 2023-09-18 19:13:20 +02:00
MohitMali
3e59e97af1 Refactoring the search functionality to support the latest wrapper 2023-09-18 19:13:20 +02:00
MohitMali
64f26202c5 Changes to support libkiwix 11.0.0 wrapper * Get correct zim file title from libkiwix. * Refactor code to get zim file tags from libkiwix * Decode the URL if it is encoded because libkiwix does not return the path for encoded paths. 2023-09-18 19:13:20 +02:00
MohitMali
d62d43957e Refactored the code to support the java-libkiwix 11.0.0 2023-09-18 19:13:20 +02:00
translatewiki.net
f29c206729 Localisation updates from https://translatewiki.net. 2023-09-18 13:08:06 +02:00