2144 Commits

Author SHA1 Message Date
MohitMali
efc3dbffba Fixed Bookmark toggle is not ON for saved bookmarks 2023-08-31 19:18:44 +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
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
translatewiki.net
64a2bba45d Localisation updates from https://translatewiki.net. 2023-08-24 13:10:10 +02:00
MohitMali
9e0541b54a Fixed Keyboard repeatedly disappearing and reappearing in search when any article is loading in the background.
* 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.
2023-08-18 18:49:27 +05:30
MohitMali
b624f1cbb5 Hide storage selection dialog from OnlineLibraryFragment if user already configured the storage in settings 2023-08-17 11:13:27 +08:00
MohitMali
5b3aa73d53 Enabled pause/resume functionality in downloading notification 2023-07-31 13:50:31 +05:30
MohitMali
0a2cff92b5 Introduced pause/resume functionality.
* Added pause/resume button beside the stop button to perform pause/resume action on the downloading zim file.
* Handling pause/resume via fetch library.
2023-07-31 13:50:23 +05:30
MohitMali
524c469d78 Refactored the code to fix the issue, if we canceled downloading from the notification 2023-07-31 13:50:09 +05:30
MohitMali
ba4031258e Fixes of Zim file does not download / pending forever 2023-07-31 13:50:00 +05:30
MohitMaliFtechiz
b1eb76e49b Improved the permission asking scenario for custom apps 2023-07-26 07:44:21 +02:00
MohitMali
842a7ee737 Fixed downloading pending forever if we canceled it from notification 2023-07-19 14:08:11 +05:30
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
38d6335860 Fixes of View Notes from all books Switch is always enabled 2023-07-19 07:00:35 +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
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
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
MohitMaliFtechiz
7d3756af4e Fixes of PreferenceManager.getDefaultSharedPreferences() is deprecated 2023-06-30 16:58:52 +02:00
MohitMaliFtechiz
36803af9e2 Fixed Toast.getView() and Html.fromHtml() is deprecated
* 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.
2023-06-28 18:29:02 +02:00
MohitMaliFtechiz
8791a824b6 Fixes of Fragment's onActivityCreated is deprecated 2023-06-27 17:23:57 +02:00
MohitMaliFtechiz
a3de2a25c7 Fixed extra space on the webview top if the webview is not atteched to any view 2023-06-27 17:22:10 +02:00
MohitMaliFtechiz
17cbcf082d Refactor tab preview to use WebView instead of creating a bitmap
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.
2023-06-27 17:22:10 +02:00
MohitMaliFtechiz
03ee22eb8a Removing the bitmap dependency to show the preview image 2023-06-27 17:22:10 +02:00
MohitMaliFtechiz
790de4e98e Fixes of if we open tab in background then a blank preview is showing 2023-06-27 17:22:10 +02:00
MohitMaliFtechiz
802f130bb8 Fixes of isDrawingCacheEnabled and drawingCache of View class is deprecated 2023-06-27 17:22:10 +02:00
MohitMaliFtechiz
663afd3eeb Fixes of windowManager.defaultDisplay.getMetrics(this) is deprecated 2023-06-27 17:20:54 +02:00
MohitMaliFtechiz
d2662c1aa4 Removed the deprecated FLAG_FULLSCREEN, FLAG_FORCE_NOT_FULLSCREEN.
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.
2023-06-27 13:00:33 +05:30
MohitMaliFtechiz
35ff151e9b Updated SaveHandler to use Bundle.get() instead of deprecated msg.data['url']` 2023-06-27 13:00:33 +05:30
MohitMaliFtechiz
97a17eac3a Fixes of shouldOverrideUrlLoading and onReceivedError deprecated method of WebViewClient 2023-06-27 13:00:33 +05:30
MohitMaliFtechiz
bb0a49902e Fixed supportInvalidateOptionsMenu() deprecated method used in KiwixWebChromeClient 2023-06-27 13:00:33 +05:30
MohitMaliFtechiz
2ff07a7606 Fixes of WebView.HitTestResult.IMAGE_ANCHOR_TYPE is deprecated 2023-06-27 13:00:33 +05:30
MohitMaliFtechiz
543d336d4c Changes after review 2023-06-23 07:02:17 +02:00
MohitMaliFtechiz
e081c856cd Fixes of ProgressDialog is deprecated 2023-06-23 07:02:17 +02:00
CYBWEBALI
6f825f6277 Fixes of Snackbar buttons 2023-06-22 14:10:00 +05:30
MohitMaliFtechiz
8408cbc0e9 Enhanced the TTS feature.
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.
2023-06-20 11:20:23 +05:30
MohitMaliFtechiz
3d837f1430 Fixes of Text to Speech init failed on android 13 2023-06-20 11:14:27 +05:30
MohitMaliFtechiz
75c4e9278d Clearing focus from the Notes EditText to improve UI performance 2023-06-20 05:46:47 +02:00
MohitMaliFtechiz
f5ba5f4cf0 Fixes of toggleSoftInput(Int, Int) method of InputMethodManager is deprecated 2023-06-20 05:46:47 +02:00
MohitMaliFtechiz
a4625d0a23 Fixed test failure 2023-06-20 05:46:01 +02:00
MohitMaliFtechiz
529bd1bde1 Refactored onBackPressed method with updated API
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.
2023-06-20 05:46:01 +02:00
MohitMaliFtechiz
7a5ff07180 Changed the requestPermission method of the fragment to utilize the new permission API registerForActivityResult.
* 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.
2023-06-20 01:38:45 +05:30
MohitMaliFtechiz
9b1186d555 Refactored deprecated methods of ConnectivityManager class.
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.
2023-06-19 11:53:03 +05:30
MohitMaliFtechiz
9e79f11253 Refactored deprecated ConnectivityManager's method in NetworkUtils class 2023-06-19 11:35:36 +05:30
MohitMaliFtechiz
fb90c934aa Fixed tts broken feature if we run tts twice 2023-06-16 15:25:39 +02:00
MohitMaliFtechiz
8481b4d70d Fixes of KiwixTextToSpeech uses some deprecated methods 2023-06-16 15:25:39 +02:00
MohitMaliFtechiz
9f0c793ce7 Fixed deprecated getPackageInfo() method of PackageManager 2023-06-16 14:29:58 +02:00
MohitMaliFtechiz
04dbbfd48e Removed deprecated requireFragmentManager() method 2023-06-16 13:48:19 +02:00