8300 Commits

Author SHA1 Message Date
MohitMaliFtechiz
49e7116781 Updated the ZIM file url for downloading the ZIM file.
* Refactored the search test according to this new ZIM file.
2024-03-05 13:47:04 +01:00
MohitMaliFtechiz
63acf5768a Added test cases for the search functionality.
* In this updated test case, we have addressed scenarios involving fast typing/deleting for search queries. Additionally, we implemented a test case where the user types with both short and long delays to ensure the following:
 1. Short delay: Properly tests the cancellation of the previously searching task.
 2. Long delay: Properly executes the search query letter by letter and ensures that there is no crash during the search.
* We are downloading the "stack exchange" ZIM file in our test case because this ZIM file yields many search results. Therefore, we download and perform all search operations on this file to simulate a real-world scenario, as our test ZIM file only contains three search results.
* The temporary ZIM file is deleted after performing the test to free up device storage.
2024-03-05 13:47:04 +01:00
Kelson
a1eae97278
Merge pull request #3729 from kiwix/Fix#3728
Fixed: The WiFi hotspot no longer starts automatically after granting notification permission in Android 13 and above.
2024-03-05 13:46:30 +01:00
MohitMaliFtechiz
b5c99ca583 Fixed: The WiFi hotspot no longer starts automatically after granting notification permission in Android 13 and above.
* We implemented the `registerForActivityResult` method to handle notification permission, ensuring the hotspot starts seamlessly upon permission grant.
* Improved the permission-asking scenario. Before it ask once for notification permission and at the second time it shows the custom dialog that shows why we need this permission. But we can ask permission twice in our application so we have improved the asking of permission. If the user denies this permission then we show the custom dialog with message why we need this permission.
2024-03-05 08:24:57 +01:00
Kelson
f483ff1392
Merge pull request #3725 from kiwix/Fix#2795
Fixed: [Bug] Pop-up Function does not work correctly (fails to automatically “detect” headword and show results).
2024-03-05 08:20:00 +01:00
MohitMaliFtechiz
0a8735cbb1 Fixed: [Bug] Pop-up Function does not work correctly (fails to automatically “detect” headword and show results).
* Fixed the scenario where "Search kiwix" on any text does not show the expected result. Because we were passing the activity's intent instead of the actual intent we are getting to open the search, which leads to unexpected results. So now we are passing the actual intent to process the request that fixes this issue.
*  Fixed one more scenario that occurred after placing this fix, where one more instance is created of the search screen because the activity has the intent with this type, and we are processing this intent in our `onViewCreated` for the scenario where our application launched(it is not running in the background). So when we close the search screen for then our `onViewCreated` method is called, and the activity has the intent so it creates one more search instance. So to fix this issue we are setting both intents as null after using them.
2024-03-05 08:19:28 +01:00
Kelson
a53e86e027
Merge pull request #3731 from kiwix/Fix#3730
Upgraded many dependencies of our project.
2024-03-05 08:18:01 +01:00
MohitMaliFtechiz
f2e44e02c4 Upgraded many dependencies of our project.
* Upgraded test cases and project dependencies.
* Refactor test cases and project code according to the new changes in dependencies.
2024-03-04 21:18:04 +05:30
Kelson
98671f17d4
Merge pull request #3711 from kiwix/Fix#3710
Add test cases for getLocalFilePathByUri() method.
2024-03-01 07:07:38 +01:00
MohitMaliFtechiz
7671a3be7b Added necessary comments and removed unnecessary logs. 2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
58b423b06d Fixed code formatting issue. 2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
a64e58ea16 Added test cases for extractDocumentId and documentProviderContentQuery to comprehensively test all scenarios for URIs.
* Implemented `DocumentResolverWrapper` to facilitate mocking of values for `DocumentsContract` and `ContentResolver` methods, considering the inability to directly mock these methods in our test class.
* Included test cases covering various types of download URIs utilized in our `documentProviderContentQuery` method.
* Removed `getAssetFileDescriptorFromUri` method from FileUtils class as now it is unused.
* Removed the `getAssetFileDescriptorFromUri` method from FileUtils class as now it is unused.
2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
abdd966c1d Added code to handle the exception when the provided download URI is invalid, as we encountered this issue in the test case for API level 24. 2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
c830e1acf0 Added Test cases for getLocalFilePathByUri method that we are using for getting the filePath from the given uri.
* This test ensure that every uri will return the expected filePath. e.g. for download uri, older device compatibility, internal/external/USB-STICK uri, and if a invalid uri is given then it will return the null.
2024-03-01 07:07:15 +01:00
MohitMaliFtechiz
57f9e664ca * Enhanced the queryForActualPath() method to retrieve the actual path for a URI. Users faced a java.lang.UnsupportedOperationException: Unknown URI exception when querying the contentResolver with an invalid URI. A check has been added to prevent such errors.
* On older devices, the download URI contains the full file path, causing the `documentProviderContentQuery` to fail in retrieving the path, leading to unexpected behavior (failure to open the ZIM file). The code has been improved to handle this scenario.
* In certain devices, the content URI prefix may differ, and using only `public_downloads` to obtain the actual path from the URI might not work if the device has a different URI prefix. The code has been enhanced to consider every possible content prefix when retrieving the actual path.
2024-03-01 07:07:15 +01:00
Kelson
0107eddf54
Merge pull request #3727 from kiwix/Fix#3726
Fixed: Content is not displaying after opening the ZIM file from Chrome.
2024-03-01 07:00:52 +01:00
MohitMaliFtechiz
c3f6e50377 Fixed: Content is not displaying after opening the ZIM file from Chrome.
* Although the ZIM file is loaded, it does not appear in the reader because the "Open Library" button is already visible, and the content view is hidden at this point. To address this, we utilized our `reopenBook()` method when loading the ZIM file in reader, which manages the visibility of these views.
2024-02-29 18:17:36 +05:30
Kelson
a68e37fee9
Merge pull request #3714 from kiwix/Fix#3708
Fixed: Security and trust issue reported by the playStore.
2024-02-26 11:00:39 +01:00
MohitMaliFtechiz
5d483f555e Fixed: we can't discover the peers for sending/receiving ZIM files if we disallow the location/nearby or storage permission twice.
* Improved the message shown in `NearbyWifiPermission` dialog.
* Removed the unused and extra translation from project.
2024-02-26 12:05:43 +05:30
MohitMaliFtechiz
e6b10c03d4 Resolved the issue where discovering peers did not automatically start after granting the NEARBY_WIFI_DEVICES permission on Android 13 like it starts after giving the ACCESS_FINE_LOCATION on below Android 13. 2024-02-26 11:42:28 +05:30
MohitMaliFtechiz
1083a86f42 Fixed: Security and trust issue reported by the playStore.
* Removed the `ACCESS_COARSE_LOCATION` from the application as it is unnecessary in project. Since this permission was used in the ZimHostFragment to host the ZIM files on server, but this permission is not required for this feature. Hence, we have removed this permission from project.
* Removed this permission from test cases.
* Removed the unused code from project related to this permission.
2024-02-26 11:42:19 +05:30
Kelson
16dacff430
Merge pull request #3716 from kiwix/Fix#3715
Fixed: Selected files count is not showing initially in LocalLibrary screen.
2024-02-25 21:00:51 +01:00
MohitMaliFtechiz
69392506bf Fixed: Selected files count is not showing initially in LocalLibrary screen.
* Initially `ActionMode` is null when we are selecting ZIM files that's why it is not showing the selected book count in the ActionMode title. So to fix this we are setting the value when the actionMode is created.
2024-02-25 21:00:35 +01:00
Kelson
6512ef483f
Merge pull request #3719 from kiwix/Fix#3718
Fixed: Bookmark screen title is set as "Kiwix" if we open the Bookmarks screen from Widget
2024-02-25 21:00:10 +01:00
MohitMaliFtechiz
a8c543965d Fixed: Bookmark screen title is set as "Kiwix" if we open the Bookmarks screen from Widget
* The encountered issue stemmed from setting the title directly on the toolbar. When navigating from the widget, the sequence involved opening the CoreReaderFragment followed by the immediate launch of the bookmark screen. During this rapid transition, the toolbar was continuously receiving updates, but these updates were not occurring in a synchronized manner. As a consequence, the title set on the toolbar was not being reflected accurately. To address this timing inconsistency, we opted to set the title on the actionBar instead of directly on the toolbar. By doing so, we are leveraging the actionBar as a higher-level component, which internally manages the presentation of the title on the toolbar. This approach ensures a more synchronized update of the title, particularly crucial in scenarios involving swift fragment transitions, such as opening the bookmark screen from the widget. Consequently, the change to actionBar.title provides a more reliable and synchronized mechanism for managing the title, resolving the issue encountered during rapid navigation.
* Removed the unnecessary `UnspecifiedImmutableFlag` lint suppression from CoreSearchWidget.
2024-02-23 18:36:58 +05:30
Kelson
5fa7bdbf26
Merge pull request #3697 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2024-02-22 19:04:46 +01:00
translatewiki.net
ebdc5443fe Localisation updates from https://translatewiki.net. 2024-02-22 19:04:26 +01:00
Kelson
f49433ffdb
Merge pull request #3717 from amire80/patch-1
Fix "go to" spelling
2024-02-22 19:03:50 +01:00
Amir E. Aharoni
30c9e7b5b9
Fix "go to" spelling
"Goto" is used in some programming languages,
but not in English :)
2024-02-22 09:58:45 -05:00
Kelson
c4d235fdda
Merge pull request #3706 from kiwix/Fix#3701
Fixed: Addressed the touch target size issue reported by the Play Store.
2024-02-21 11:35:16 +01:00
MohitMaliFtechiz
211056c4ff Fixed the close tab icon size issue.
* Created an extension function to set up the SearchView. It now configures the toolTipText and width for the close icon of the SearchView.
* With this extension function, we have applied these properties to every SearchView used in the application, such as in LanguageFragment, SearchFragment, (History/Bookmark/Notes), and OnlineLibraryFragment.
2024-02-21 13:13:43 +05:30
MohitMaliFtechiz
e860cf9aa0 Fixed: Addressed the touch target size issue reported by the Play Store.
* Increased the height and width of the views to align with Play Store policies, while ensuring no impact on the UI (as illustrated in the images below).
2024-02-21 13:05:59 +05:30
Kelson
c79e942fbb
Merge pull request #3705 from kiwix/Fix#3702
Fixed: The Play Store has reported some implementation issues.
2024-02-21 07:45:35 +01:00
MohitMaliFtechiz
959d4f56f1 Fixed: The Play Store has reported some implementation issues.
* Increase the clickable area of the tab switcher to align with the ideal menu item size, ensuring users can easily interact with it.
2024-02-21 11:42:16 +05:30
Kelson
f130269195
Merge pull request #3709 from kiwix/Fix#3703
Fixed: `Low contrast` issue reported by the PlayStore.
2024-02-21 07:01:10 +01:00
MohitMaliFtechiz
31cefdc1a9 Fixed: Low contrast issue reported by the PlayStore.
* Enhanced the contrast of the `mine_shaft_gray600` color to comply with Play Store's recommendation of `4.50.1`. This color is utilized in the book's itemView.
* Implemented the updated color in `IntroScreens` subHeading to resolve the low contrast issue.
* To rectify the contrast issue in the `LanguageFragment`, we increased the opacity of views to align with the recommended contrast.
2024-02-21 07:00:39 +01:00
Kelson
746dd60e5f
Merge pull request #3707 from kiwix/Fix#3700
Fixed: Content labeling issue reported by the playstore.
2024-02-21 06:59:49 +01:00
MohitMaliFtechiz
046f10f465 Added contentDescription for all backButtons/closeButtons of toolbar.
* Added `contentDescription` for "+" button in TabSwitcher.
2024-02-21 06:59:01 +01:00
MohitMaliFtechiz
1a671e53e9 Utilize the toolTip extension function instead of employing TooltipCompat.setTooltipText throughout the code to eliminate redundancy. Additionally, removed comments related to the usage of this method, as the information is already provided in our extension function's comment. 2024-02-21 06:59:01 +01:00
MohitMaliFtechiz
0b7756cf57 Fixed: Content labeling issue reported by the playstore.
* Added content descriptions for all views reported by the Play Store, including RecyclerView, dialog's itemView, pause/resume/stop buttons, and many more.
* Created an extension function to handle both setting the content description to address Play Store accessibility issues and displaying hints to the user using ToolTipText. This function consolidates these tasks in one place, eliminating code duplication.
2024-02-21 06:59:01 +01:00
Kelson
ad09b4c3fa
Merge pull request #3704 from kiwix/Fix#2896
Fixed: Added the ability to press Enter to skip the search.
2024-02-21 06:58:20 +01:00
MohitMaliFtechiz
da897a104e Fixed: Added the ability to press Enter to expedite the search.
* If the search/enter button is pressed and an article is found with the same query, it will directly open that article. Otherwise, it will proceed with the regular search operation as before.
2024-02-16 08:28:12 +01:00
Kelson
f85d6013c2
Merge pull request #3689 from Sagar0-0/develop
#3668 Ripple in Tabs Icon
2024-02-15 12:38:05 +01:00
Sagar
b924daab57 #3668 Comments added for ToolTip uses 2024-02-15 10:23:42 +05:30
Sagar
0411a98c49 #3668 setToolTip method fix 2024-02-15 10:23:42 +05:30
Sagar
a907fa3f42 #3668 Added setToolTip function 2024-02-15 10:23:42 +05:30
Sagar
4b9a309fb1 #3668 ToolTip in tab icons 2024-02-15 10:23:42 +05:30
Sagar
6e4b8dcba8 #3668 Ripple in Tabs Icon 2024-02-15 10:23:42 +05:30
Kelson
f65787b182
Merge pull request #3649 from kiwix/Fix#3643
Fixed: Version `3.9.1` was experiencing occasional crashes when setting the `SuggestionSearcher`.
2024-02-14 07:24:33 +01:00
MohitMaliFtechiz
287503746e Fixed: Version 3.9.1 experienced occasional crashes when setting the SuggestionSearcher.
* The crashes occurred in the Play Store version due to insufficient permissions for opening a file via `fileDescriptor`. To address this issue, we have modified the implementation to use the `file` instead of `fileDescriptor`. This adjustment ensures smooth operation in the non-Play Store version where we have permission to open a file via its path. In the Play Store version, it will display a proper error message to the user, preventing errors thrown by libkiwix.
2024-02-07 11:29:50 +01:00