2155 Commits

Author SHA1 Message Date
MohitMaliFtechiz
21b34e2b44 Checking permission of fileDescriptor is it has the read access or not. 2023-12-30 20:53:37 +05:30
MohitMaliFtechiz
7c59193bd8 Improved creation of ZimFileReader.
* If current file is same that is previously opened in the `ZimFileReader` then it will not create the reader again.
* Improved the variable naming.
2023-12-27 18:38:19 +05:30
MohitMaliFtechiz
d2505b7ca3 Resolved the application crash occurring when clicking the 'OPEN_NOTE' button in the NotesFragment.
* Now, we primarily utilize the `FileDescriptor` instead of the file in conjunction with the URI for various functionalities. Consequently, we have refactored our note-opening functionality accordingly.
2023-12-27 17:30:44 +05:30
MohitMaliFtechiz
1f8c4e8ad0 Moved takePersistableUriPermission permission for only we have selected via file picker since we can only take this permission for those file that we have selected via file picker.
* exist the previous book, if any open in reader screen when there is some error in opening new file in the reader screen.
2023-12-27 16:36:59 +05:30
MohitMaliFtechiz
8e59d4390e Fixed zim file not opening that is previous loaded, if we close the application or navigate to the other fragments.
* Improved the error logging if due to some condition we are unable to open the assetFileDescriptor.
2023-12-27 15:53:15 +05:30
MohitMaliFtechiz
4da41bc9ec Taking takePersistableUriPermission for uris that user try to open via file picker. Since we need access of this uri to open the same file again, if user tries to open notes, history etc. 2023-12-27 15:22:55 +05:30
MohitMaliFtechiz
ab38adf19c Fixed: Create only one reader and use it everywhere.
* Now we are creating only one reader for both `zimFile`, `assetFileDescriptor` and using for all the features.
2023-12-26 18:19:04 +05:30
translatewiki.net
922d4d2b35 Localisation updates from https://translatewiki.net. 2023-12-25 15:20:01 +01:00
MohitMaliFtechiz
f7e14162fc Fixed: ErrorActivity was not appearing in the non-debug version when the application crashed.
* We are using the `applicationContext` to start the `ErrorActivity`, which is outside the `Activity`. Therefore, to initiate the activity with an external context of the `Activity`, we must include the `FLAG_ACTIVITY_NEW_TASK` flag in the intent. Without this flag, the activity will not start.
2023-12-23 10:25:11 +01:00
MohitMaliFtechiz
3eda149636 Removed unnecessary debouncing code from search functionality.
* Refactored SearchViewModelTest.
2023-12-20 12:30:04 +05:30
Gouri Panda
d0de528dc8 Refactored test 2023-12-20 12:29:52 +05:30
Gouri Panda
5cf726a412 Debouncing mechanism removed 2023-12-20 12:29:43 +05:30
MohitMaliFtechiz
2423b6b683 * Fixed: Made a small improvement to the sidebar entries for "About the app" and "Support app."
* Introduced the 'Support kiwix' option, which is configurable in the navigation for custom apps. If the custom app is set to display the "Support" menu item in navigation, it will be shown; otherwise, it will be hidden from the app.
* Replaced the "kiwix" and "the" prefixes in "Support kiwix" and "About the app" with the app name in the navigation.
2023-12-15 16:44:25 +05:30
translatewiki.net
6bd22da364 Localisation updates from https://translatewiki.net. 2023-12-14 15:15:52 +01:00
MohitMaliFtechiz
ced2182301 Fixed Zimit archives are not displaying correctly.
* The getEntryByPath method was being called twice when retrieving content. Consequently, the initial call returned the content entry URL with additional parameters. Subsequently, when making the second call with the provided URL, it resulted in an "entry not found" exception. This issue prevented the loading of the CSS and content of the Zim file.
* Additionally, the getActualUrl method was primarily implemented to retrieve the redirect entry of the URL provided by the webView. It is unnecessary to invoke this method when obtaining content.
2023-12-14 15:06:29 +01:00
MohitMaliFtechiz
90dc8ec292 Enhanced the visibility of the ZIM file on the help screen for testability.
* Introduced test cases for the new functionality to ensure its expected behavior in both variants, such as Play Store and non-Play Store.
* Updated other test cases to accommodate the testing of this new functionality.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
c20b40e389 Added a button to the startup message dialog to directly open the Kiwix website for downloading the APK. This will make it easier for the user who wants to download the full APK version of the Kiwix app. 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
4d47198b90 Introducing the startup message dialog that shows the restrictions of the Play Store to the user. 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
a736a7bdea Fixed the URL shown in the help option and made it clickable to directly open our official website for downloading the APK. 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
7d276658d4 Fixed Start-up message to inform about the restrictions on the Google Store app to open sideloaded ZIM files.
* Showing play store restriction to the users in the help screen in play store variant.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
25eab4e5fb Introduced the 'About the app' option in the navigation for custom apps.
* If the custom app is configured to display the 'About the app' option in navigation, it will be visible. Clicking on it will redirect the user to the configured URL.
2023-12-14 12:44:05 +05:30
MohitMaliFtechiz
fc6740e4eb Fixed version 3.8.1 from Google Play cannot find zim on SD card that are copied to app-specific directory.
* Scan the app-specific directory as well because we have limitations in scanning all directories on Android 11 and above in the Play Store variant. If a user copies the ZIM file to the app-specific directory on the SD card, the scanning of the app-specific directory on the SD card has not been added, resulting in the copied files not being displayed on the library screen. Therefore, we need to explicitly include the app-specific directory for scanning.
2023-12-14 07:55:52 +01:00
MohitMaliFtechiz
1b6be45826 Fixed LocalLibraryTest that was failing. 2023-12-14 07:51:52 +01:00
MohitMaliFtechiz
736d95285d Fixed unable to open zim files on sd card in version 3.8.1
* If the ManageExternalStorage permission has not been granted, introduce the request, particularly when accessing features that necessitate this permission, such as downloading ZIM files, selecting a ZIM file from storage via the file picker, and refreshing the list of available ZIM files in storage.
2023-12-14 07:51:52 +01:00
MohitMaliFtechiz
a07bb680c3 Introduced a mutex to manage concurrency in the search functionality. This enables proper clearing of the first running job before executing a new one. By implementing this approach, we ensure that access to the libzim search results occurs one at a time, resolving the crashing issue caused by multiple attempts to access libzim resources.
* Replaced the `cancel` function for the Job with `cancelAndJoin`, ensuring that it thoroughly cancels the first job before initiating the new task.
2023-12-12 15:31:53 +05:30
MohitMaliFtechiz
6d5e50d0ef Fixed the SearchStateTest was failing due to improvements in the search loading functionality. 2023-12-11 19:12:18 +05:30
MohitMaliFtechiz
0bc1392f1b Fixed the app crashes that occurred when deleting letters in a search.
* Removed the unnecessary estimation matches call on `libkiwix`, as we do not need this since `libkiwix` can handle this automatically.
* Cancelled the previously running job if a new searchTerm is in progress; this will avoid unnecessary memory allocation and data load on libkiwix.
2023-12-11 18:04:04 +05:30
Shreyas Patil
1a13516fcd Improved Sidebar icon for Support Kiwix 2023-12-10 02:13:48 +05:30
MohitMaliFtechiz
bbcf8bea8c Added a placeholder for search in custom apps.
* Introduced a search placeholder for custom apps; if any custom app is configured not to show the title in the toolbar, it will display the search placeholder with a border. To implement this change, a layout has been added inside the toolbar.
* To enhance understanding of this change, proper comments have been added to the methods.
2023-12-06 16:00:35 +05:30
MohitMaliFtechiz
88475d8601 The app icon will no longer automatically be replaced with three lines after closing the tabs screen in custom apps when the custom app is configured not to show the title. 2023-12-06 16:00:28 +05:30
MohitMaliFtechiz
2c1c678819 Fixed code formatting issue. 2023-12-06 16:00:22 +05:30
MohitMaliFtechiz
cd7b988fe1 Adjusted the size of the hamburger icon. * To address unexpected behavior, where setting the icon directly to the hamburger resulted in it taking the full width and height of the toolbar, we resized the app icon and applied it to the hamburger icon. 2023-12-06 16:00:15 +05:30
MohitMaliFtechiz
f46f2f324b Introduced the disable title option for custom apps. 2023-12-06 16:00:07 +05:30
MohitMaliFtechiz
952b539fa8 Adjusted the zone for triggering search suggestions.
* We had restricted the toolbar click to the toolbar title. So, if the user clicked on the title, it would initiate the search. Now, we have removed the restriction of clicking only on the title. If the user taps anywhere on the toolbar except the menu items and hamburger, it will initiate the search.
2023-12-06 15:59:59 +05:30
translatewiki.net
e2585529d2 Localisation updates from https://translatewiki.net. 2023-12-01 21:05:15 +01:00
MohitMaliFtechiz
c90c6312f4 Fixed unit test cases.
* Fixed: `Search action is debounced` test.
* Fixed: `SearchState combines sources from inputs` test.
2023-11-29 19:29:20 +05:30
MohitMaliFtechiz
c3da77b596 Added unit test cases to properly test the search functionalities scenario. 2023-11-29 18:48:40 +05:30
MohitMaliFtechiz
a1df0fedfe Implemented debouncing mechanism for the search functionality.
* Implemented a debouncing mechanism to enhance the handling of search functionalities. This approach is employed to prevent unnecessary data loads from libkiwix, addressing the issue of crashes when users rapidly type and search for results.
2023-11-29 14:56:55 +05:30
MohitMaliFtechiz
a9088c0918 Fixed, Sidebar adds unwanted space after closing the full screen mode.
* Previously, when exiting full-screen mode, the `WindowCompat.setDecorFitsSystemWindows` configuration was set to `false`, causing a blank space between the sidebar logo and the Bookmark item.
* This change sets the configuration to `true` when exiting full-screen mode to ensure proper adjustment of the sidebar content, eliminating the undesired blank space.
* The adjustment is necessary to maintain a seamless layout and appearance, particularly after transitioning from full-screen mode.
2023-11-21 21:24:19 +01:00
MohitMaliFtechiz
52fefe7df7 Moved version-related properties from individual build.gradle files to a common configuration file (Config.kt).
* The `Config.kt` now holds the version information we can directly change the versionCode here and it will automatically replace in both gradle files.
* Removed duplicate version configurations from build.gradle files.
2023-11-21 12:44:37 +05:30
MohitMali
65c262e1aa Fixed the lines skip issue in read aloud feature.
* The issue was caused by an unnecessary increment of the 'currentPiece' index in the onDone callback of the TextToSpeech engine. This double increment led to the skipping of lines. The redundant increment at the end of the method has been removed, ensuring that each line is read correctly.
2023-11-20 18:39:28 +01:00
MohitMali
baf2429fa3 Fixed, Using TTS on Wikivoyage 2023-06 (Android 13) reads code aloud. 2023-11-20 18:39:28 +01:00
Emmanuel Engelhart
45c12e7272
Bump-up version to 3.8.0 2023-11-20 16:34:15 +01:00
MohitMali
c4f5b3f978 Fixed, the search is not working in dwds app.
* We now utilize `AssetFileDescriptor` to open the ZIM file for custom apps. For the search functionality, we are creating a reader with a file object, but we need to create a reader with the `AssetFileDescriptor` instead of a file for custom apps.
2023-11-17 21:01:50 +05:30
MohitMali
4a9682427f Added comments on CoreReaderFragment method that are implemented in CustomReaderFragment. 2023-11-16 19:10:34 +05:30
MohitMali
748f0c4d5f Moved openSearchItem, findInPage functionality to our CoreReaderFragment as we were using same code twice for these methods in app and custom module. 2023-11-16 19:10:02 +05:30
MohitMali
f6b01a4f28 Fixed, I can't open Zim from an external download.
* We are now using fileDescriptor to open the zim files with uris when someone tries to open the zim file directly from storage.
* As now we are using the assetFileDescriptor instead of direct files, we have refactored the functionality of saving (note, history, bookmark) so that we can open the same pages on the same zimFile.
2023-11-16 18:10:53 +05:30
MohitMali
8b1cb8bc7e We are temporary hiding the kiwixServer feature from Custom Apps.
* Since we are now using fd (FileDescriptor) to read the zim file from the asset folder. Currently, 'KiwixServer' is unable to host zim files via fd. This feature is temporarily hidden for custom apps. We will re-enable it for custom apps once the issue is resolved.
2023-11-12 18:06:05 +01:00
MohitMali
bdb00d7aae Fixed the issue where the Zim File was not displaying in the ZimHostFragment for custom apps.
* In `ZimHostFragment`, we show Zim files that are saved in the database. These files are typically saved when downloading Zim files. In a custom app, where Zim files are already included within the app and not downloaded separately that's why they are not showing on the `ZimHostFragment`, we have addressed this issue by saving the Zim files in the database to ensure they appear in the `ZimHostFragment`.
* Regarding the `FileDescriptor`, there are no file objects available because we read Zim files using `FileDescriptor`. To address this, we have created a `demo.zim` file to save it in the database so that it will be displayed in the `ZimHostFragment`. We handle this file within the `KiwixServer`. When the current Zim file is `demo.zim`, we create an `Archive` object with the `FileDescriptor` to host the Zim file on the `KiwixServer`.
2023-11-12 18:06:05 +01:00
MohitMali
845f19eab6 Fixed #3519.
* The problem was that we were saving the note name combined with `zimFileTitle` and `articleTitle`. When opening the saved note from `NotesFragment`, it retrieved the `noteTitle` from the database, which already contained the combined name. Subsequently, when saving the note again, it redundantly combined the name. To resolve this issue, we now extract the `articleName` when updating notes in `NotesFragment`, ensuring that it updates existing notes instead of creating new ones.
2023-11-12 18:06:05 +01:00