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.
* 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.
* 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.
* We already handled the deprecation of `fromHtml`, we have a string's extension function to handle the this so we are now using that function.
* Since `Toast.getView()` is no longer supported after Android 11 (it always returns null on Android 11 and above devices), we no longer need to show the toast on the ZIM file that is clicked by the user for UI enhancement. Therefore, we have removed this function and are now using the context class extension function to display the toast message.
We have introduced a new method, configureCommonExtension, in the AllProjectConfigurer.kt file since Lint is only available in CommonExtension. This allows us to configure Lint in one place for every module. Previously, we couldn't directly use Lint in the android-library project, but with this approach, we can now configure Lint for the android-library project as well.
This commit introduces changes to the tab preview functionality in order to improve performance and memory usage. The previous approach of creating and storing bitmaps for tab previews has been replaced with a more efficient method utilizing WebView.
Changes Made:
- Modified the onBindViewHolder method in TabsAdapter to utilize WebView for tab previews.
- Removed the ImageUtils.kt class as it is no longer needed for bitmap storage.
Impact:
- Improved performance and reduced memory usage by directly displaying the WebView for tab previews.
- Eliminated the need for bitmap creation and storage, resulting in a more efficient implementation.
This commit introduces changes to refactor the usage of the deprecated `onBackPressed` method. The `onBackPressedDispatcher` API is now used instead.
Here's a summary of the changes made:
- Updated `AddNoteDialog.kt` and `NavigationHistoryDialog.kt` to handle the back button press on the navigation bar using the `onBackPressedDispatcher`.
- Modified `CoreMainActivity.kt` to handle all back button press operations in the application using the `onBackPressedDispatcher`.
- Updated `HelpFragment.kt` and `PageFragment.kt` to handle the back button press when the user clicks on the back arrow button in the toolbar.
- Refactored the `onBackPressed` method in `SaveLanguagesAndFinish.kt` to use the updated API, and updated the corresponding test cases accordingly.
These changes ensure that the `onBackPressed` functionality is updated to use the latest API, improving the readability and maintainability of the codebase.
* Updated the permission request for write storage permission, which is required for saving notes.
* Updated the permission request for read/write storage, necessary for scanning the file system in the LocalLibraryFragment.
* Fixed an issue where the permission layout would be displayed alongside the library list if the user swiped down to refresh.
* Suppress the deprecation warning for as `onRequestPermissionsResult` method is deprecated and we are using this for posting the result in all child fragments.
This commit refactors the deprecated methods of the ConnectivityManager class to ensure compatibility with different Android versions. The changes include:
* Introducing a new CompatV23 class to handle the deprecation of NetworkInfo and utilize the new NetworkCapabilities APIs available from Android 23 onwards.
* Retaining the existing methods for Android versions below 23 to maintain backward compatibility.
* Updating the test cases to cover both the new and old APIs.
These updates address the deprecation warnings and ensure that the code functions correctly on different Android versions.
We have used deprecated method for selecting folder for SD card in OnlineLibraryFragment.kt, CorePrefsFragment.kt, now we are using `registerForActivityResult` method instead of deprecated method in both places.
* FileObserver(File(path), Int) constructor is supported starting from Android 24. In versions prior to Android 24, this new constructor is not supported by the Android OS.