* 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.
* 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.
* When any article is loading then we invalidate the `OptionMenu` from `KiwixWebChromeClient` (It does not check whether the fragment is visible or not) which also invalidates the toolbar and the search bar is inside the toolbar that's the reason the keyboard showing and hiding repeatedly.
* Now we are invalidating the `OptionMenu` inside the `CoreReaderFragment` when it is visible to the user since this fragment loads the content in the webview. Hence, it is better to update the UI when it is visible to the user so it would not affect any other UI part.
* Added pause/resume button beside the stop button to perform pause/resume action on the downloading zim file.
* Handling pause/resume via fetch library.
* 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.
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.
We have removed the usage of deprecated flags FLAG_FULLSCREEN and FLAG_FORCE_NOT_FULLSCREEN. Instead, we are now using the updated API `WindowCompat.setDecorFitsSystemWindows` to handle fullscreen mode. This API automatically takes care of handling fullscreen behavior for both older and newer API levels.
Now, during the screen launch, we only set up the TTS service with the WebView. This is necessary to configure the JavaScript interface when the WebView is created. Otherwise, the JavaScript interface is not recognized. We initialize the TTS feature when the user tries to use it for better optimization.
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.