6961 Commits

Author SHA1 Message Date
Matthieu Gautier
708330c013 Fix crashing of server.
We have to keep the library alive to let the server working on it.
2023-08-11 16:02:56 +02:00
MohitMali
acf45a0f60 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-08-10 18:32:20 +05:30
MohitMali
734885a527 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-08-09 18:45:35 +05:30
MohitMali
a1b5f36c59 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-08-08 18:11:05 +05:30
MohitMali
c4dbe478b8 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-08-08 16:15:14 +05:30
MohitMali
6235ba612a Keep everything in libkiwix/libzim in release variant.
* Updated proguard file to keep the `libkiwix/libzim` classes in release variant.
2023-08-07 17:33:37 +05:30
MohitMali
5fec01c695 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-08-07 17:32:07 +05:30
MohitMali
bfdc00a009 Improved the code, removed unnecessary parentheses 2023-08-07 17:31:55 +05:30
MohitMali
7e0bf3442d Imrpvoed pagination search, avoid loading unnecessary data when user at the end of list and there is no data available to show 2023-08-07 17:31:34 +05:30
MohitMali
9cfe35a95e Fixed duplicate searched items are showing 2023-08-07 17:30:30 +05:30
MohitMali
90e7e8d7f7 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-08-07 17:30:05 +05:30
MohitMali
f03830c62f 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-08-07 17:29:56 +05:30
MohitMali
a99a988a98 Fixed ZimMangeViewModelTest 2023-08-07 17:29:46 +05:30
MohitMali
c83fc0dae9 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-08-07 17:29:32 +05:30
MohitMali
6655ad6c69 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-08-07 17:28:49 +05:30
MohitMali
0e6300f20c 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-07-27 18:08:27 +05:30
MohitMali
ca285abab6 Improved search functionality
* Fixed search unit test cases.
* Improved the search functionality to perform the unit test case for search.
2023-07-27 18:07:07 +05:30
MohitMali
731b0a5843 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-07-27 18:06:57 +05:30
MohitMali
32807aa71b Fixed search functionality crash if any FT Xapian index not found in any zim file 2023-07-27 18:06:48 +05:30
MohitMali
824d40680f Fix the instrumentation test cases 2023-07-27 18:06:40 +05:30
MohitMali
f079a1ef88 Using newly published 'libkiwix 1.0.0' from maven 2023-07-27 18:06:33 +05:30
MohitMali
be57a6968e Fixed loading content which contains a query params, mostly this fix is for newly created zim files 2023-07-27 18:06:24 +05:30
MohitMali
75adf8185a Refactored search functionality according to the new wrapper 2023-07-27 18:06:14 +05:30
MohitMaliFtechiz
7a6447c5da 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-07-27 18:06:04 +05:30
MohitMali
26ee7fbf1a Refactored code to safely get the metadata of zim files 2023-07-27 18:05:57 +05:30
MohitMali
02f2600270 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-07-27 18:05:48 +05:30
MohitMali
db195f8d3d Fixed zim file size issue in library section 2023-07-27 18:05:33 +05:30
MohitMali
c34c0c201e Refactoring the search functionality to support the latest wrapper 2023-07-27 18:05:21 +05:30
MohitMali
a3ae9e942b 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-07-27 18:05:13 +05:30
MohitMali
1476452085 Refactored the code to support the java-libkiwix 11.0.0 2023-07-27 18:05:05 +05:30
Kelson
8469e18e23
Merge pull request #3439 from kiwix/Fixes#3370
Improved the permission asking scenario for custom apps
2023-07-26 07:44:55 +02:00
MohitMaliFtechiz
b1eb76e49b Improved the permission asking scenario for custom apps 2023-07-26 07:44:21 +02:00
Kelson
06c9dbc9ca
Merge pull request #3451 from kiwix/Issue#3441
Fixes of Zim file does not download / pending forever
2023-07-26 07:43:43 +02:00
MohitMali
842a7ee737 Fixed downloading pending forever if we canceled it from notification 2023-07-19 14:08:11 +05:30
Kelson
8a105ae296
Merge pull request #3440 from kiwix/Issue#3409
Introducing deprecated code check in CI
2023-07-19 08:09:43 +02:00
MohitMali
9d49bbbf31 Removed unnecessary classes from the custom rule and suppressed the Compat21 file because we are handling the deprecated code within it. Therefore, we don't want Detekt to check this file for deprecations. 2023-07-19 08:09:31 +02:00
MohitMali
ae5b3a5074 Added RuleSetProvider file to define our custom rules 2023-07-19 08:09:31 +02:00
MohitMali
8e6c74abe8 Introduced custom rule for detekt to exclude the deprecated imports 2023-07-19 08:09:31 +02:00
MohitMali
af23cf56b7 Detecting deprecated code via detekt and fixed detekt detection for the issues in project, and refactored deprecated rules of detekt 2023-07-19 08:09:31 +02:00
Kelson
73fe388514
Merge pull request #3449 from kiwix/Issue#3448
Fixes of View Notes from all books Switch is always enabled
2023-07-19 07:00:45 +02:00
MohitMali
38d6335860 Fixes of View Notes from all books Switch is always enabled 2023-07-19 07:00:35 +02:00
Kelson
c49d8d8ac3
Merge pull request #3447 from kiwix/Issue#3446
Fixes of `UnsafeCallOnNullableType` and `UnnecessaryAbstractClass` issues found by detekt
2023-07-19 06:57:36 +02:00
MohitMali
6e195fc42f Fixed the UnsafeCallOnNullableType detekt issue in the project. 2023-07-18 22:42:54 +02:00
MohitMali
7493b842b7 Fixed UnnecessaryAbstractClass issue of detekt 2023-07-18 22:42:54 +02:00
Kelson
1806495674
Merge pull request #3450 from kiwix/Issue#3395
Fixes of Refactor the Toolbar functionality
2023-07-18 22:41:38 +02:00
MohitMali
eeaceabf0a Fixed test failure 2023-07-18 22:41:12 +02:00
MohitMali
f8594b0183 Moved the common toolbar functionality to the BaseFragment 2023-07-18 22:41:12 +02:00
Kelson
79e43d8735
Merge pull request #3444 from kiwix/Issue#3443
Fixes of Some deprecation warnings are showing in the logs but they are already fixed
2023-07-18 22:40:45 +02:00
MohitMali
7445da9bfc Replaced deprecated onOptionsItemSelected and onCreateOptionsMenu methods with new MenuProvider API. 2023-07-05 18:06:39 +05:30
MohitMali
f2d130c547 Fixes of Some deprecation warnings are showing in the logs but they are already fixed 2023-07-03 18:44:33 +05:30