2838 Commits

Author SHA1 Message Date
MohitMaliFtechiz
8370f72d35 Migrated on-disk BookStores/ZimStores from ObjectBox to libkiwix. 2025-06-10 00:28:45 +05:30
translatewiki.net
f2942d71b9 Localisation updates from https://translatewiki.net. 2025-06-07 20:35:34 +02:00
MohitMaliFtechiz
40edd03396 Fixed: Bookmarks were not showing for newly added books from the OPDS stream.
* Removed books from `library.xml` if they no longer have any associated bookmarks, as keeping them is unnecessary and wastes resources and memory, while also increasing the time needed to load the library from storage.
* Fixed: The downloading online library progress was showing incorrect.
* Refactored the all unit test cases according to the new changes.
2025-06-07 00:02:09 +05:30
MohitMaliFtechiz
ebbe1b9889 Fixed: Downloading was not working.
* Fixed: `Online Books` were showing incorrect book sizes. The OPDS stream now provides sizes in bytes instead of kilobytes, so the code has been updated accordingly.
* Added the `io.coil-kt.coil3:coil-compose` library to load favicons for online books, as OPDS now returns favicon URLs instead of Base64-encoded strings.
* Since favicons are no longer provided in Base64 format when downloading ZIM files, we now extract the favicon from the Archive using libkiwix after the download completes. This allows us to display it locally on various screens such as the library, Wi-Fi hotspot, notes, history, and more.
* Cached the `LibkiwixBook` instance to avoid recreating it multiple times when adding or removing bookmarks.
2025-06-05 23:49:02 +05:30
MohitMaliFtechiz
7a10528d19 Added the com.squareup.retrofit2:converter-scalars converter to Retrofit to parse OPDS network responses.
* Created `LibkiwixBook` to wrap the `Book` class from `libkiwix`, allowing us to set custom values from the database and manage books received from the `OPDS` stream. This wrapper is necessary because the original Book class does not provide setters. We'll use `LibkiwixBook` throughout the codebase.
* Refactored the codebase to replace `LibraryNetworkEntity.Book` with `LibkiwixBook`.
2025-06-04 22:16:09 +05:30
MohitMaliFtechiz
20722fe15b Introduced support of OPDS catalog. * Created the OnlineLibraryManager class to manage the OPDS stream with libkiwix. * Refactored the ZimManageViewModel, and KiwixService code according to OPDS catalog. 2025-06-03 18:42:51 +05:30
MohitMaliFtechiz
81b4a0be34 Fixed: Cancel button in language dialog was hidden due to oversized content. 2025-06-02 17:08:07 +05:30
MohitMaliFtechiz
5ab5529acf Refactored all UI test cases to align with the new settings Compose UI. 2025-06-02 16:50:08 +05:30
MohitMaliFtechiz
ba476058fe Fixed: The Text Zoom slider did not correctly display the previously set position after restarting the application.
* Removed the BaseDelegateAdapter and its subclasses, as RecyclerView is no longer used in the codebase.
* Fixed: CustomApps was crashing when opening the settings screen.
* Fixed: StorageList was not appearing on the settings screen.
* Fixed: Dark Mode and Language dialogs to match the theme design.
* Created KiwixBasicDialogFrame, a reusable Compose UI component to standardize the design of alert dialogs.
* Removed unused code from the project.
2025-05-30 17:55:02 +05:30
MohitMaliFtechiz
164e38b113 Refactored the remaining functionality to use Jetpack Compose UI.
* Improved the design of the `Settings` screen to match the previous XML layout.
* Updated the ViewModel to handle user interactions following the MVVM pattern.
* Introduced `SettingScreenState` to manage the state of the settings screen.
* Removed `KiwixPrefsFragment`, `CustomPrefsFragment`, and `CorePrefsFragment` as they are no longer needed.
* Cleaned up unused code from the project.
2025-05-29 19:04:40 +05:30
MohitMaliFtechiz
5aac7e4815 Migrated the Settings screen to Jetpack Compose.
* Created the `SettingsScreen` using Jetpack Compose UI components.
* Implemented `SettingsViewModel` to manage and update preferences reactively, supporting the Compose architecture.
* Refactored existing functionality to align with the Compose-based UI.
2025-05-29 19:04:40 +05:30
MohitMaliFtechiz
6cae44821e Refactored RxJava to coroutines in ConnectivityBroadcastReceiver.
* Simplified the `combineToLanguageList` method and removed warnings.
* Refactored `ZimManageViewModelTest` to align with the changes.
* Removed unused `RxJava` code from the project.
* Removed all `RxJava` dependencies from the project.
* Updated the `README` file to reflect that `RxJava` is no longer used.
* Updated `credit.html` accordingly, similar to the `README`.
2025-05-27 17:48:28 +05:30
MohitMaliFtechiz
3ee0977534 Removed debug logs. 2025-05-26 22:41:41 +05:30
MohitMaliFtechiz
0099f4dcf4 Fixed: CodeFactor issue. 2025-05-26 22:37:37 +05:30
MohitMaliFtechiz
31cc84664c Improved the KiwixSearchView to handle the keyboard onDone button press. Now, when the user presses the Done button on the keyboard, it triggers the search and opens the first matching item, if available.
* Fixed: The `FIND_IN_PAGE` button was appearing when the search was opened from `FromTabView`.
* Fixed: The `FIND_IN_PAGE` button was not displaying properly (only half was visible).
* Improved: The `NavigationIcon` to better support test cases.
* Fixed: `VoiceSearch` was not working when launched from the `SearchWidget`.
* Refactored: `SearchFragmentTest` and `SearchFragmentTestForCustomApp` to align with the Compose UI.
* Removed: Additional unused code from the project.
2025-05-26 22:31:25 +05:30
MohitMaliFtechiz
a3b1b95181 Migrated SearchFragment to jetpack compose.
* Improved the `KiwixAppBar` to show the textButton in actionMenu. Since we need to show the `FIND_IN_PAGE` textView button in actionMenu.
* Created the `SearchScreen` and migrated the all UI to compose from XML.
* Refactored the functionalities of `SearchFragment` according to compose UI.
* Removed the unused code from project.
2025-05-26 14:07:33 +05:30
MohitMaliFtechiz
f5d55d2c8a Fixed compilation and lint issues.
* Fixed: Selected language filter was not being applied to the online library.
* Fixed: Unnecessary UI recomposition.
* Improved code readability and resolved related lint errors.
* Fixed: "Allow downloading content via mobile network?" dialog was not displaying correctly.
* Fixed: SwipeRefreshing was not working when the "Swipe Down for Library" message was shown.
* Improved: Previously, the online library would re-download every time the fragment was launched or brought to the foreground (e.g., when navigating back from another screen). This behavior has been changed to use coroutines. The library now downloads only once initially, and subsequent downloads only occur when the user manually refreshes the library. This helps reduce unnecessary data usage and network calls.
2025-05-20 17:05:09 +05:30
MohitMaliFtechiz
701fffb758 Refactored RxJava to coroutines in OnlineLibrary 2025-05-20 08:46:39 +05:30
translatewiki.net
5303d1b997 Localisation updates from https://translatewiki.net. 2025-05-17 12:33:42 +02:00
MohitMaliFtechiz
913068505d Refactored the all unit, and UI test cases.
* Removed the some unused code from project.
2025-05-16 16:08:51 +02:00
MohitMaliFtechiz
03f771bef1 Refactored the RxJava to coroutines in PageViewModel.
* Refactored the child viewModels (BookmarkViewModel, HistoryViewModel, and NotesViewModel) to use coroutines.
* Refactored all DAO classes to use coroutines instead of RxJava.
* Refactored all related code to align with coroutines.
2025-05-16 16:08:51 +02:00
MohitMaliFtechiz
0c91e329d4 Fixed: CI sometimes crashes on testBookmarks.
* The issue was caused by using `CoroutineScope(Dispatchers.Main)` while our flow directly accessed the `uuid` of the ZIM file from the `ZimFileReader` object. When the fragment was switched to another screen, the `ZimFileReader` object got disposed. However, the `webViewProgressChanged` method would still trigger, initiating the flow to check if the current page was bookmarked. Since the `ZimFileReader` was already disposed, this resulted in a crash.
* We fixed this by using the viewLifecycleOwner.lifecycleScope so that the job is automatically cancelled when the fragment is destroyed. Additionally, we now retrieve the uuid once at the beginning and reuse it in the flow, avoiding repeated access to the disposed ZimFileReader.
* Improved the `testBookmarks` test case. Sometimes this test failed to find the "OPEN" button of the `Snackbar` because the `Snackbar` was automatically dismissed before `Espresso` could validate the view. This timing issue occasionally caused the test to fail. We've improved the test to properly verify whether the bookmark is saved, avoiding such situations.
* Improved the `DownloadTest`, which sometimes failed on CI.
2025-05-16 11:54:36 +05:30
MohitMaliFtechiz
8e2b3c821c Refactored RxJava to coroutines in Fat32Checker, and SharedPreferenceUtil.
* Refactored all `RxJava` code in `SharedPreferenceUtil` to coroutines.
* Refactored `RxJava` code to coroutines in `Fat32Checker`.
* Refactored `RxJava` code to coroutines in `DarkModeConfig`.
* Refactored all related code of these classes accordingly.
* Updated unit test cases to work with coroutines.
2025-05-16 06:08:07 +02:00
MohitMaliFtechiz
163dfd3844 Refactored RxJava to Coroutines in LanguageViewModel.
* Removed duplicate method in `DownloadRoomDao` for fetching all downloads.
* Refactored `DownloadManagerMonitor` to use `Coroutines` instead of `RxJava`.
* Improved coroutine usage in `DownloadMonitorService`.
* Updated `LanguageViewModel` to use `Coroutine Flows` instead of `RxJava`.
* Refactored `NewLanguagesDao` to expose Coroutine Flows instead of `RxJava` observables.
* Updated `SaveLanguagesAndFinish` to use coroutines instead of `RxJava`.
* Created a `FlowExtension` utility class to add custom flow-related extensions. In this PR, added the `collectSideEffectWithActivity` extension function, which allows collecting `SideEffects` and handling them with the current Activity in a Compose UI. This also moved the `SideEffect` collection from the Fragment layer to the Compose screen, improving separation of concerns.
* Refactored the unit test cases according to this change.
2025-05-14 19:34:13 +05:30
MohitMaliFtechiz
4f426e73ca Refactored RxJava to use Kotlin Coroutines in NewBookDao.
* Created an `asFlow` extension function to convert ObjectBox queries into coroutine Flow, enabling easier migration to coroutine-based flows in future tasks.
* Refactored all related code to use coroutine Flow.
* Updated all test cases to align with the new coroutine-based implementation.
2025-05-13 19:24:43 +05:30
MohitMaliFtechiz
d62800b7b1 Refactored RxJava to coroutines in ZimFileReader.
* Migrated ZIM content loading logic from RxJava to Kotlin coroutines.
* The previous implementation used `RxJava` to stream content on the IO thread, but it was not lifecycle-aware. This caused the task to continue running even when the WebView navigated away or stopped rendering.
* Updated the implementation to use coroutines, ensuring that the task is lifecycle-aware and automatically cancels when the page changes or the user navigates away.
* This improves resource efficiency and prevents unnecessary background work during page transitions.
2025-05-13 13:34:10 +02:00
MohitMaliFtechiz
3e92cda80f Refactored the code to use coroutines instead of rxJava for saving/retrieving the bookmarks from libkiwix.
* Refactored the all unit and UI test cases according to it.
2025-05-13 12:34:29 +05:30
MohitMaliFtechiz
2f06598006 Refactored the RxJava to coroutines in saving/retrieving the webView history.
* Refactored the code to use the coroutine flow instead of `RxJava` flowable.
2025-05-12 12:41:20 +05:30
translatewiki.net
10aac7acae Localisation updates from https://translatewiki.net. 2025-05-10 08:21:56 +02:00
MohitMaliFtechiz
4af14d8c98 Introduced the turbine library for efficiently testing the coroutine flows.
* Removed the `TestObserver` since it was sometimes stucks on the execution.
* Refactored the test cases according to turbine library.
2025-05-09 21:39:47 +05:30
MohitMaliFtechiz
2f9439391a Fixed: the unit test cases which were failing on CI. 2025-05-09 18:41:21 +05:30
MohitMaliFtechiz
bfb209acd5 Improved the scanning of ZIM files from storage.
* Improved the `TestObserver` to properly to receive the test values.
2025-05-09 16:12:30 +05:30
MohitMaliFtechiz
a6ed6ccc1d Created the TestObserver class for efficiently testing the coroutine flows.
* Fixed: FileSearchTest.
* Fixed: `SearchViewModelTest`.
* Fixed: `ZimManageViewModelTest`.
* Fixed: `StorageObserverTest`.
* Fixed: `FileSearchTest`.
* Fixed: `CustomDownloadViewModelTest`.
* Fixed: ZimFile was not opening when downloading via fallback system for custom app.
* Fixed: `CustomDownloadViewModelTest`.
2025-05-08 18:53:31 +05:30
MohitMaliFtechiz
5ee1fcdd2b Fixed all compilation errors in the project.
* Refactored `StartMultiSelection` to use coroutines instead of RxJava.
* Refactored `fileSelectActions` to use coroutines instead of RxJava.
* Refactored the `updateBookItems` to use coroutines instead of `rxJava`.
* Refactored `LocalLibraryFragment` to use coroutine flows instead of RxJava code.
* Improved the test code to validate coroutine flows.
* Refactored the `NewRecentSearchDaoTest` according to new flow test code.
* Refactored the `StorageObserverTest`.
* Refactored the `SearchViewModelTest`.
* Refactored the `FileSearchTest`.
2025-05-08 08:56:01 +05:30
MohitMaliFtechiz
8769d83e92 Refactored RxJava to coroutines in FileSearching 2025-05-08 08:56:01 +05:30
MohitMaliFtechiz
c9b94f50a8 Migrated the copy_move_progress_bar to Jetpack Compose.
* Improved `AlertDialogShower` to support bottom padding for customView, allowing design customization from the caller side.
* Removed unused code from the project.
* Refactored the UI, and unit test cases.
2025-05-06 16:41:16 +05:30
MohitMaliFtechiz
747e78b1e5 Changed the Snackbar button text from "Storage device selector" to "Change" when there isn't enough storage available on the device for downloading the ZIM file.
* Fixed: The online library download progress bar was not initially visible when the fragment was created.
* Refactored all UI test cases to align with the new Compose UI.
* Created an extension function for composeTestRule to wait for a specified duration until the UI becomes visible. This is similar to BaristaSleepInteractions. Since Compose does not provide a built-in wait mechanism, this custom implementation helps stabilize UI test cases.
2025-05-05 21:55:30 +05:30
MohitMaliFtechiz
90db76bad1 Created a ModifierExtension class to add custom extension functions for Modifier.
* Added `hideKeyboardOnLazyColumnScroll` extension function to hide the keyboard when scrolling a `LazyColumn`.
* Fixed: "Downloading library" message was not centered properly.
* Fixed: Unnecessary top margin appeared when the search view was active.
* Fixed: Search view did not display the entered text.
* Fixed: Search view did not restore the previously searched books when the device woke from sleep.
* Fixed: Search view did not close on back button press, causing previous search results to remain visible.
* Fixed: Various minor UI issues found while testing.
* Removed the unused code from project.
2025-05-04 20:17:58 +05:30
MohitMaliFtechiz
57a2942e21 Refactored the all functionality of OnlineLibraryFragment according to compose UI.
* Created `MutableStateExtensions` for state management.
2025-05-02 20:05:00 +05:30
MohitMaliFtechiz
9976f9249a Migrated the OnlineLibraryFragment to Jetpack Compose.
* Created `OnlineLibraryScreenState` to manage the UI state.
* Enhanced `ContentLoadingProgressBar` to allow setting the width of the circular progress bar from the calling site, enabling more flexible styling based on design requirements.
* Added `DownloadBookItem` composable for displaying download progress.
* Refactored `BookItem` by splitting the code into smaller, reusable composables, as several UI elements are shared across downloading, online, and downloaded books.
* Created OnlineBookItem for displaying online books.
2025-05-01 23:55:54 +05:30
MohitMaliFtechiz
ecd053e8b1 Removed unused PageAdapter. 2025-04-29 18:52:37 +05:30
MohitMaliFtechiz
9de216beec Migrated the NavigationHistoryDialog to Jetpack Compose.
* Created the `NavigationHistoryDialogScreen` using our app theme.
* Refactored the code according to comose UI.
* Refactored the UI test cases according to compose UI.
* Removed the unused code from project.
2025-04-29 18:52:37 +05:30
MohitMaliFtechiz
3eb1a05a6a Removed StorageAdapter. 2025-04-29 14:01:33 +02:00
MohitMaliFtechiz
dba5d81bae Migrated the StorageSelectionDialog to Jetpack Compose,
* Created a reusable `StorageDeviceItem` composable, which will also be used on the settings screen.
* Refactored the code to use the new Compose-based UI.
* Updated the UI test cases to align with the Compose implementation.
* Removed unused code from the project.
2025-04-29 14:01:33 +02:00
MohitMaliFtechiz
7e62aa2c2c Refactored IntroFragmentTest to align with the Compose UI.
* Fixed: `IntroFragmentTest`, `KiwixSettingsFragmentTest`, and `KiwixSplashActivityTest`.
* Resolved memory leaks in `IntroFragment` and `LanguageFragment`.
* Improved the `IntroScreen` code to fix lint errors.
2025-04-28 13:40:13 +05:30
jaskaran
0fbd54b6d1 Feat: Migrate intro fragment to compose
- added colors to colors class for headings text
2025-04-28 13:40:13 +05:30
jaskaran
89a0a4a902 Feat: Migrate intro fragment to compose
- Removed redundant xml code from fragment
- added support for compose
- migrated intro screen to jetpack compose
2025-04-28 13:40:13 +05:30
MohitMaliFtechiz
5e47526cae Fixed: The alert dialog was not taking appropriate width for alert dialog.
* Improved the dialog's button styling.
2025-04-24 23:20:02 +05:30
MohitMaliFtechiz
8bc7bcead4 Fixed the NoteFragmentTest, and some other test cases which were previously failing.
* Resolved the remaining accessibility issues.
* Fixed the issue where UnsupportedMimeTypeHandler and RateDialog were not showing.
* Added support for loading adaptive icons (from the mipmap folder) in the IconItem class.
2025-04-24 17:56:28 +05:30
MohitMaliFtechiz
cb05ffceee Refactored the UI test cases according to compose UI.
* Fixed: some accessibility issues reported by the test cases.
* Fixed: The dialog was not showing when a ZIM file was opened via deepLink.
2025-04-23 18:42:04 +05:30