2940 Commits

Author SHA1 Message Date
MohitMaliFtechiz
7a0ab97b01 Improved ObjectBoxToLibkiwixMigratorTest for clearing the previous saved bookmarks.
* Refresh the data before checking the loaded data in DownloadTest.
* Increasing the Retry count for loading data and downloading start to properly work with low internet connection.
2024-03-20 01:16:55 +05:30
MohitMaliFtechiz
a0ef56205b Improved the deleting of zim files in localibrary, since we already pause for a second to check if the delete dialog is displayed or not, and again we are waiting before clicking on it. The same issue for while clicking on the PlayStoreRestrictionDialogTest where we are first waiting for the dialog to visible and then waiting for clicking on it. So we have removed the second wait since this dialog is displaying in both test cases.
* Improved the TopLevelDestinationTest. Because we were testing the drawer options fragments (Settings, Bookmarks etc) from the download screen and when we pressed the back button it came to the download screen and refreshed its data due to this our next functionality had to wait to finish this. Now we are testing all the navigation screens from the LocalLibraryScreen which makes this test case faster.
2024-03-20 01:16:44 +05:30
MohitMaliFtechiz
b680b1afce Fixed: ZIM file is not deleting from LocalLibraryFragment if we do not have the storage permission in non-playstore variant, which is fine but it should ask permission.
* Added permission check when selecting the ZIM file to delete or share, which fixes this problem.
2024-03-14 07:23:25 +01:00
MohitMaliFtechiz
8828a8b917 Fixed: Lint Issue - Unconditional Logging.
* Re-enabled the `LogConditional` lint check.
* Introduced a `Log` class that exclusively handles logging operations in the debug variant.
* Removed unnecessary `if (BuildConfig.DEBUG)` conditions from the project.
2024-03-11 11:46:17 +05:30
MohitMaliFtechiz
10e1022865 Improved the LibkiwixBookmarkTest, we are now opening the Bookmark screen via the navigation drawer instead of long clicking on the bottom_toolbar_bookmark button because sometimes the screen scrolls down and this button hides and our test case fails on API level 33.
* Improved the NoteFragmentTest. Sometimes it didn't find the `overFlowOptionMenu` since we immediately clicked on that menu while opening the readerFragment, and sometimes this menu was not shown, because it was preparing its data to show.
2024-03-09 19:39:13 +05:30
MohitMaliFtechiz
9fb5adb37a Added an condition for checking if any system dialog is visible method to handle all the dialog shown by the system. 2024-03-09 19:39:05 +05:30
MohitMaliFtechiz
606bea4405 Improved our instrumentation.sh bash script, if our test fails then after restarting the emulator if our application is installed we clear its cache data so that test cases will perform properly. We have made this change to fix a scenario that comes locally after testing so many times where downloading is stuck due to lag of emulator.
* * Improved the LibkiwixBookmarkTest. In this, before performing the test case we are removing the existing bookmarks if any so that the saved bookmark will not go outside the screen(We faced an occurrence of this type locally).
* Improved the ZIM file path in many scenarios so that the created ZIM file will show in the LocalLibraryScreen and we can delete it so that we can free up the memory.
2024-03-09 19:38:58 +05:30
MohitMaliFtechiz
d5305b6856 Improved the SearchFragmentTest that are sometimes failing on API level 30. 2024-03-09 19:38:51 +05:30
MohitMaliFtechiz
afaf1a487a Improved DownloadTest, InitialDownloadTest and ZimHostFragmentTest.
* Remove all the ZIM files showing in the LocalLibrary screen before performing the test operation, this will free up the memory and unwanted behaviour like if the any other ZIM file already contains in this screen then it can affect our these test cases.
2024-03-09 19:38:44 +05:30
MohitMaliFtechiz
291a063747 Fixed: Test cases are frequently failing on API level 33.
* Refreshed the ZIM files list before deleting/checking for downloaded ZIM files in `DownloadTest` and `InitialDownloadTest` because sometimes data doesn't show on the `LocalLibraryScreen` after downloading the ZIM file, leading to test failures.
* Hiding the `Storage Restriction` dialog in `LibkiwixBookTest` and `MimeTypeTest` to not show this dialog in these test cases.
* Improved the temporary ZIM file path in `NoteFragmentTest` to properly display the ZIM file in the LocalLibrary screen so that it can be deleted in our test case.
* Enhanced the loading of ZIM files in `LocalLibraryTest`.
2024-03-09 19:38:35 +05:30
translatewiki.net
4f5d66dbd7 Localisation updates from https://translatewiki.net. 2024-03-07 13:07:14 +01:00
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
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
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
MohitMaliFtechiz
7671a3be7b Added necessary comments and removed unnecessary logs. 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
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
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
translatewiki.net
ebdc5443fe Localisation updates from https://translatewiki.net. 2024-02-22 19:04:26 +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
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
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
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
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
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
MohitMaliFtechiz
81994805b7 Upgraded java-libkiwix to 2.0.0
* Re-enabled test case for migrating bookmarks more then 512 to test it properly on API level 24.
2024-02-07 11:44:56 +05:30
MohitMaliFtechiz
1460e0d4e5 Fixed Migration test was failing on the API level 24. 2024-02-07 11:44:28 +05:30
MohitMaliFtechiz
ed2a9e0ec9 Fixed the failing LibkiwixBookmarkTest on Android 33 and 30. 2024-02-07 11:44:16 +05:30
MohitMaliFtechiz
50f92beeb1 Fixed the failing LibkiwixBookmarkTest.
* Enhanced the process of adding books to the library to prevent unnecessary data loading from libkiwix.
* Released the memory occupied by bookmarks and archives to resolve potential issues when running migrations on lower-end devices.
2024-02-07 11:44:08 +05:30
MohitMaliFtechiz
99cf75bf59 Improved the large data migration.
* Refined test cases to thoroughly assess the migration process.
* Enhanced the migration logic to effectively manage large datasets during migration.
* Optimized the Bookmark functionality to minimize unnecessary data loading on libkiwix. Retrieving data from libkiwix is now performed only when there is a change in the bookmark, reducing redundant data fetches. Otherwise, the previously loaded data is returned to minimize unnecessary resource access.
2024-02-07 11:44:00 +05:30
MohitMaliFtechiz
efd8caf244 Enhanced the migration process to handle exceptions more effectively. 2024-02-07 11:43:47 +05:30
MohitMaliFtechiz
f45e321655 Refactored the test cases.
* Improved the instrumentation test cases.
* Improved the migration test case.
2024-02-07 11:43:37 +05:30
MohitMali
a78c4562f2 Removed the unnecessary wrapper classes of libkiwix from the codebase since we don't need these classes as saving/deleting functionality will be tested in java-libkiwix.
* Added instrumentation test case for testing the UI part with libkiwix bookmark functionality.
2024-02-07 11:34:33 +05:30
MohitMaliFtechiz
94a529cdf9 Introducing the writeFile method of the Library class allows us to save the library, which contains information about books, their file paths, and favicons, into a file.
* We now save this library information into a file named `library.txt` and subsequently read from it to retrieve file paths and favicons.
* The test cases have been refactored to accommodate this new functionality.
* The `ObjectBoxToLibkiwiMigrator` code has also been enhanced. With this change, we now save books in the library for their favicon and zimFilePath, resulting in a refactor and improvement of this class's functionality and its associated test cases.
* The process of writing bookmarks and library data to file has been enhanced. Now, this is performed asynchronously in a background thread to mitigate potential data loss.
* Additionally, several other improvements have been made throughout the codebase.
2024-02-07 11:34:21 +05:30
MohitMali
07e40ee3ac Improved LibkiwixBookTest and added new ObjectBoxToLibkiwixMigratorTest cases 2024-02-07 11:33:34 +05:30
translatewiki.net
d733ee8812 Localisation updates from https://translatewiki.net. 2024-02-06 18:44:03 +01:00
MohitMaliFtechiz
3cb5d8acf5 Fixed minor UI issue. 2024-02-05 21:00:05 +01:00
MohitMaliFtechiz
b86e87ffd5 Increase height of progress bar to properly show to the user. 2024-02-05 21:00:05 +01:00
MohitMaliFtechiz
57800a8da7 Fixed FileSearchTest, StorageObserverTest, and ZimManageViewModelTest test that are failing after this change. 2024-02-05 21:00:05 +01:00
MohitMaliFtechiz
13b0ab0519 Displaying the scanning progress to the user:
* We have enhanced our scanning process to provide real-time progress updates, allowing users to track how much time is required to complete the operation.
2024-02-05 21:00:05 +01:00
MohitMaliFtechiz
153765491a Removed the default scanning behavior upon launching the LocalLibraryFragment.
* Now, scanning the storage only occurs when the user explicitly requests it. When the user attempts to refresh the list, the storage is scanned to identify ZIM files. This approach prevents unnecessary scanning when users frequently navigate to other screens.
2024-02-05 21:00:05 +01:00
MohitMaliFtechiz
894a8e559e Added test cases for notes.
* We identified an issue where opening notes crashes the application if the particular ZIM file does not exist. To test this scenario, we have added corresponding test cases.
* These test cases cover both scenarios – when the ZIM file is deleted and when it is present.
2024-02-03 14:17:35 +01:00
Sagar
cb7d27e1c0 #3675 Download notification opens the reader 2024-01-30 19:13:10 +01:00
Sagar
9475b6625e #3675 Download notification opens the reader 2024-01-30 19:13:10 +01:00