6995 Commits

Author SHA1 Message Date
JJ
1a58589633
Update README.md
Fixed a very small spelling error.
2023-10-04 01:32:32 -07:00
Kelson
d5e98dc5a4
Merge pull request #3484 from kiwix/Issue#2561
Fixed Zimit-generated zim files were partially failing to open.
2023-09-27 06:24: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
Kelson
27215b0541
Merge pull request #3217 from kiwix/Issue#3216
Adapt latest java-libkiwix wrapper
2023-09-18 19:13:54 +02:00
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
fff9196337 Started using new libkiwix from new maven repo org.kiwix/libkiwix. 2023-09-18 19:13:20 +02:00
Emmanuel Engelhart
644521c722 Add library dependence libkiiwx to the README 2023-09-18 19:13:20 +02:00
MohitMali
ad81bbdcf0 Fixed server crashing issue when we open it on web browser 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
4f2b54e70a Improved SearchFragmentTest:
After addressing the issue documented in https://github.com/kiwix/java-libkiwix/pull/61, we now have the ability to search within zim files that do not have a Xapian index. As a result, we have enhanced our test to utilize pre-existing zim files. This improvement leads to reduced time consumption, improved memory efficiency, and minimized network usage impact.
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
ed237a4d78 Keep everything in libkiwix/libzim in release variant.
* Updated proguard file to keep the `libkiwix/libzim` classes in release variant.
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
69982e9db8 Fixed ZimMangeViewModelTest 2023-09-18 19:13:20 +02:00
MohitMali
3e40c095a4 Refactored ci to support minimum api level 24
* Since our minimum API level is now 24, we have updated our CI configuration to run on API level 24, which aligns with the minimum API level required for our project.
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
46d4aeb505 Refactored SearchFragmentTest
* As we can not search in that zim file which is not contains the FT Xapian index and testzim.zim file is not contain it so we have improved our test case.
* Now we are downloading the `off the grid` zim file and performing the search functionality inside it.
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
02a6d0f83f Fix the instrumentation test cases 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
Kelson
4121f402b3
Merge pull request #3476 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-09-18 19:10:23 +02:00
translatewiki.net
f29c206729 Localisation updates from https://translatewiki.net. 2023-09-18 13:08:06 +02:00
Kelson
4ae2c0d3cb
Merge pull request #3473 from kiwix/Issue#3472
Fixed Bookmark toggle is not ON for saved bookmarks
2023-09-04 17:47:07 +02:00
MohitMali
f029498e84 Added SYSTEM_ALERT_WINDOW permission for api level 21 as by default it is not launching the activity and giving error Could not launch intent Intent this error comes when we have not Display pop-up windows while running in the background permission 2023-08-31 19:18:44 +08:00
MohitMali
efc3dbffba Fixed Bookmark toggle is not ON for saved bookmarks 2023-08-31 19:18:44 +08:00
Kelson
51e2189cc9
Merge pull request #3471 from kiwix/Issue#3462
Fixed USB-OTG not working on android 11 and above devices
2023-08-31 19:08:15 +08:00
MohitMali
c1cbebd64f Enhanced ZIM file support for Android 10 and above devices, including USB-OTG integration.
* Previously we can only open zim files from `USB-OTG` in android 10 and below devices, because `context.getExternalFilesDirs("")` does not provide the USB path in android 10 and above devices for security reasons. There is no direct way to access the USB-OTG on these devices, but USB-OTG are mounted under the `/mnt/media_rw` directory, so now we are directly using this to open zim files from USB drive for android 10 and above devices.
2023-08-29 21:23:15 +07:00
Kelson
6ec78d0ed9
Merge pull request #3477 from kiwix/Issue#2889
Added tmpfs filesystem to `support 4GB filesystem` list and improved the writing test file name
2023-08-29 21:22:19 +07:00
MohitMali
8fee2d119a Enhanced FileSystem Check.
* Added `tmpfs` filesystem to `support 4GB filesystem list` since this type supports writing files over 4GB.
* Updated the name of the writing test result file to `kiwix_4gb_writing_test_result` to enhance readability.
2023-08-29 18:35:15 +05:30
Kelson
a8fdbc8114
Merge pull request #3422 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-08-28 10:57:34 +07:00