Commit Graph

2856 Commits

Author SHA1 Message Date
arkon
87bdee5990 Move SettingsItems composables to presentation-core 2023-07-10 17:25:52 -04:00
arkon
efabe801be Refactor chapter tracking logic
Could probably call this if we ever make it update tracking on manually
marking chapters as read.
2023-07-10 17:13:58 -04:00
Ivan Iskandar
0759936226
Remove scrollable animation workaround (#9690)
Reverts ba93060e59
Related https://android-review.googlesource.com/c/platform/frameworks/support/+/2239762
2023-07-09 14:08:58 -04:00
arkon
1e3d9a00f2 Handle chapter read status in correct order
Fixes #9687
2023-07-09 09:54:36 -04:00
arkon
226272f686 Refactor reader progress/history logic 2023-07-08 18:05:00 -04:00
arkon
16cbcecd99 Fix download ahead
Fixes #9669
2023-07-08 17:56:15 -04:00
arkon
b008223661 Minor reorganization 2023-07-08 17:47:10 -04:00
arkon
f8cf3db4a4 Allow download ahead even if entry isn't favorited 2023-07-08 17:46:48 -04:00
arkon
8cc42bce5a Tweak chapter swipe directions and icon color 2023-07-08 15:55:53 -04:00
arkon
d32409bd6e Fix up icon direction when RTL 2023-07-07 19:58:53 -04:00
arkon
cf3f2d0380 Adjust manga FAB to only say "Start" if there's no unread chapters in unfiltered list
Closes #9479
2023-07-07 17:57:29 -04:00
arkon
53c6230afe Change auto clear cache to occur on app launch instead
Fixes #9564

Avoids the issue of clearing the cache when the app is backgrounded despite being in the reader.
We could do a job on idle, but we'd still need to be careful around whether the reader is active,
so this is just simpler considering it's a separate activity.
2023-07-07 17:46:39 -04:00
Semen
4882896f4d
Add function to delete downloaded chapters when migrating manga (#9621)
add function to delete downloaded chapters when migrating manga and getFlagsFromPositions fix
2023-07-07 09:57:02 -04:00
arkon
6fe5e6e21b Save reader progress on every page change
Fixes #9668
Could probably refactor this a bit more, but the reader view model stuff is a mess in general anyway.
2023-07-05 18:57:57 -04:00
arkon
bb8f3c63f1 Remove usage of savedInstanceState for storing reader menu visibility state 2023-07-01 12:47:20 -04:00
arkon
44cc6f11c7 Fix crash when tapping reader in long strip mode before RecyclerView is created 2023-07-01 10:36:46 -04:00
arkon
bae391c2c1 Replace deprecated ProgressDialog
Fixes #8223
2023-07-01 10:36:20 -04:00
LagradOst
d99f4697e8
Fixed scrolling on the background using long strip (#9654)
Update WebtoonFrame.kt
2023-06-30 21:56:35 -04:00
stevenyomi
bb3fdef40b
Browse Source: clear search query when changing listing (#9652) 2023-06-29 22:39:43 -04:00
Alessandro Jean
8a5e443ca5
Make source preferences' titles multiline (#9644)
Make source preferences' titles multiline.
2023-06-26 14:05:22 -04:00
Denny Rodrigues do Carmo
ee684cbef5
Fix download ahead while reading functionality (#9640)
Correct condition for downloading next chapter
2023-06-25 14:18:54 -04:00
arkon
fe82cdb9c8 Migrate ReaderColorFilterSettings to Compose
It'll eventually be a tab with the other settings again once the other tabs are also
migrated over so it's just a single Compose sheet.
2023-06-24 12:51:10 -04:00
arkon
f344831d58 Use our own translation for "OK"
I missed this in the PR that it came with, but I guess it'll be useful if we go multiplatform.
2023-06-24 10:38:34 -04:00
arkon
f2b0d74b4c Migrate ReaderPageSheet to Compose 2023-06-23 23:17:47 -04:00
zaghdaneh
b36b3bfcab
Remove manga from trackers (#9535)
* Dialog for service tracker removal added, anilist query prepared

* added API delete requests for Mal and Kitsu

* implement and fix tracker delete for anilist, shikimori, mangaupdates

* implement and test mal delete request

* Update to dialog text to reflect current tracker

* finish kitsu api request and block bangumi tracker removal

* Change delete flag into interface, localise strings, clean up logs

* Add shikimori delete compatibility for already existing entries

* update track delete dialog prompt to include checkbox, update strings

* Update i18n/src/main/res/values/strings.xml

Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>

* Update i18n/src/main/res/values/strings.xml

---------

Co-authored-by: unknown <zaghdane@fireflow.de>
Co-authored-by: arkon <arkon@users.noreply.github.com>
Co-authored-by: stevenyomi <95685115+stevenyomi@users.noreply.github.com>
2023-06-22 22:06:43 -04:00
Ivan Iskandar
b4393ff741
Update core-splashscreen (#9629) 2023-06-22 21:59:17 -04:00
Ivan Iskandar
740e370465
Bump compile SDK version 34 (#9625) 2023-06-22 14:20:12 -04:00
arkon
0871208023 Avoid crash when trying to open random entry but categories are still loading
Fixes #9610
2023-06-15 22:16:31 -04:00
arkon
ee95c1439f Blur manga info header image
Similar to J2K. This only applies on Android 12+.
2023-06-13 20:36:33 -04:00
arkon
e323f3c25a Don't update last page read/read state of chapter if Incognito Mode is enabled
Actually closes #7228, which I forgot was about history more than trackers.
2023-06-13 19:30:02 -04:00
arkon
9766399539 Don't update trackers after reading a chapter if Incognito Mode is enabled
Closes #7228
2023-06-13 18:51:07 -04:00
Simon
dddba7bb6f
Filter out non-downloaded chapters in reader when Downloaded Only is enabled (#9568)
* FIxed Issue #5463 - DownloadedOnly Bug

* Changes according to Feedback

* Changes according to Feedback

---------

Co-authored-by: AlphiGhost <71730726+AlphiGhost@users.noreply.github.com>
2023-06-10 12:48:15 -04:00
Two-Ai
cf777d9893
Cleanup MangaScreenModel successState usage (#9582)
* Refactor updateSuccessState

- Convert to inline function
- Use when for type safety if we add other MangaScreenState types

* Replace equivalent expressions with updateSuccessState

* Replace safe cast in MangaScreen
2023-06-09 23:11:02 -04:00
arkon
841f80f935 Add share menu item in reader
Closes #9510
2023-06-09 22:52:49 -04:00
arkon
34b9c82cd0 Remove General settings section 2023-06-04 17:07:29 -04:00
arkon
405a75438a Remove per-category display mode
There seems to be little value in this feature, and juggling flag masks is annoying.
Per-category sorting is still a thing, but could be refactored away from the flag in the feature.
2023-06-04 16:59:21 -04:00
Ivan Iskandar
39e4568460
ReaderProgressIndicator: Convert to Compose (#9574) 2023-06-03 13:11:41 -04:00
arkon
8f4bc71cf7 Remove confirm exit option
Redundant with predictive back, but also just sort of pointless since it doesn't help
with any sort of app state retention.
2023-05-31 18:51:01 -04:00
Two-Ai
0ac38297f4
Replace RxJava in extension installer (#9556)
* Replace RxJava in extension installer

Replace common downloadsRelay with Map of individual StateFlows

* Drop RxRelay dependency

* Simplify updateAllExtensions

* Simplify addDownloadState/removeDownloadState

Use immutable Map functions instead of converting to MutableMap
2023-05-30 10:25:20 -04:00
arkon
ed5a56be60 Set reader chapter name to marquee if too long
Closes #7159
2023-05-27 19:15:11 -04:00
arkon
46efd4c134 Fix some crashes 2023-05-27 09:53:01 -04:00
arkon
dfd38db7e3 Use primitive state holders 2023-05-27 09:22:31 -04:00
arkon
e3b2720924 Remove redundant inset handling in AdaptiveSheet
The Dialog is handling it anyway, so this doesn't really do anything useful.
We might need to add this back if Dialog actually handles edge-to-edge properly.
2023-05-24 18:10:17 -04:00
arkon
5a9889b562 Upgrade Compose
Co-authored-by: ivaniskandar <ivaniskandar@users.noreply.github.com>
2023-05-21 11:21:32 -04:00
arkon
5ca7c39751 Replace Cascade with our own somewhat janky implementation 2023-05-21 11:02:56 -04:00
arkon
a4d86a2e1e Enable predictive back gesture for Android 13 (behind developer option)/14+ 2023-05-20 16:16:19 -04:00
Ivan Iskandar
6263a52777
Fix navigation backstack (#9497)
Partial revert of dbbf6c5de0
2023-05-13 14:22:02 -04:00
arkon
8fae92034e Fix missing appbar when statistics are loading 2023-05-12 18:13:07 -04:00
arkon
dbbf6c5de0 Switch back to upstream version of Voyager 2023-05-12 18:01:48 -04:00
arkon
6f59c6c6bb Revert attempts to read archives to cache first
Issues:
- Apache implementation relies on methods unavailable on lower Android API levels
- Using input stream implementation doesn't seem to read some files properly, but using
  ZipFile implementation still requires reading the entire thing into memory
2023-05-07 12:03:58 -04:00
Ivan Iskandar
d36cf5ce15
Chapter transition tweaks (#9470)
* Chapter transition tweaks

* Chapter transition cleanups
2023-05-07 10:08:33 -04:00
arkon
b051e37ab7 Address minor build warnings 2023-05-06 23:11:14 -04:00
arkon
1b25290d39 Fix filter FAB not working in migrate screen
I feel like this needs to be aligned with the browse screen/deduped somehow, but that can happen separately.

Fixes #9444
2023-05-06 12:27:44 -04:00
arkon
9a10656bf0 Migrate reader slider and next/prev buttons to Compose 2023-05-03 17:14:11 -04:00
arkon
3c79777e66 Migrate PageIndicatorTextView to Compose
Probably closes #7798
2023-05-03 16:18:25 -04:00
arkon
f5ad95d78a Fix language in source filter list jumping to top incorrectly
Fixes #9068
2023-05-03 15:07:41 -04:00
arkon
14c465d36f Get current track services when composing LibrarySettingsDialog
Fixes #9431
2023-05-03 14:41:08 -04:00
arkon
c623258e8c Try Apache implementation of ZipFile instead
Docs: https://commons.apache.org/proper/commons-compress/
Related StackOverflow post: https://stackoverflow.com/a/54236244/4421500

Related to #9438
2023-05-03 14:00:33 -04:00
Houssein Zaghdane
6ce42dc167
fix to multiple "add to library" toasts bug when adding a new series (#9433)
fix to multiple "add to library" toasts bug (#9177)

Co-authored-by: Houssein Zaghdane <zaghdane@fireflow.de>
2023-05-03 10:40:11 -04:00
Andreas
02864ebd60
Move GitHub Release/App Update logic to data (#9422)
* Move GitHub Release/App Update logic to data

* Add tests for GetApplicationRelease

* Review changes
2023-04-29 22:14:49 -04:00
arkon
9339ea4196 Process chapter duplicates after sorting
Closes #9255, sort of. The example is a bad edge case though, where chapter numbers are repeated across versions,
so realistically only the first 113 will appear but the later 113(s) won't despite being "different". Those realistically
should be in different manga entries, not all mixed together, so this is just a crappy source.
2023-04-28 16:01:14 -04:00
AntsyLich
6bdc1b676e
Avoid potential crash when opening library settings sheet 2.0 (#9419)
Avoid potential crash when opening library settings sheet  2.0

Previous one had issues
2023-04-28 15:15:54 -04:00
arkon
c590f55030 Revert "Avoid potential crash when opening library settings sheet (#9415)"
This reverts commit 2cb08e6bb1.
2023-04-28 10:11:13 -04:00
AntsyLich
2cb08e6bb1
Avoid potential crash when opening library settings sheet (#9415) 2023-04-28 09:08:17 -04:00
arkon
c9805b8612 Consolidate exception message formatting
Closes #9408
2023-04-27 22:45:30 -04:00
arkon
20bec66a9d Handle archives with nested directories properly
Closes #9389
2023-04-25 22:07:34 -04:00
Ken Swenson
3ce9a9ff97
Double tap zoom toggle (#9384)
* Double tap zoom toggle

Implements a toggle that allows users to disable double tap zoom including QuickScaling for webtoons. Partially resolves #4145

* Update i18n/src/main/res/values/strings.xml

---------

Co-authored-by: arkon <arkon@users.noreply.github.com>
2023-04-25 18:06:49 -04:00
d-najd
a8f17a3fab
Add swipe actions for chapters (#9304)
* added chapter swipe

* Rework corner animtion

* Update i18n/src/main/res/values/strings.xml

Co-authored-by: arkon <arkon@users.noreply.github.com>

* Replace LTR/RTL with Start/End layout

* Added label to the animation so the warning will go away

* Getting rid of the swipe threshold setting

* adding disabled option, renaming stuff, other stuff?

* Getting rid of the snackbar

* Getting rid of unecessary strings

* changing enum names as requested

* Renaming Raio to Ratio (I need a better keyboard as well -__-)

* Replacing error with download icon and action

* backup

* minor cleanup

* fixing an nasty edge case

* fixing mistakes in the previous conflict

* space

* fixing bug

fixed bug where the user could dismiss already dismissed item leading to item getting stuck

* fixing lint errors

* fixing lints (hopefully)

* Added "swipe disabled" to the list of actions

* Replacing string value and moving value as requested

* replacing rest of the strings with generic ones

---------

Co-authored-by: arkon <arkon@users.noreply.github.com>
2023-04-25 17:29:39 -04:00
arkon
44619febd3
Load ZIP file contents to cache (#9381)
* Extract downloaded archives to tmp folder when loading for viewing

* Generate sequence of entries from ZipInputStream instead of loading entire ZipFile
2023-04-23 11:59:58 -04:00
arkon
418e6a8b3a Make loader implementation classes internal 2023-04-23 10:11:26 -04:00
arkon
67b4e53a58 Minor cleanup 2023-04-23 10:11:26 -04:00
arkon
e23cc8f83a Hide beta split tall images setting from reader setting sheet for release builds
Closes #9358
2023-04-22 16:33:41 -04:00
arkon
0b125b7106
Use Compose for reader transition chapter info (#9373) 2023-04-22 16:33:36 -04:00
arkon
26f3995595 Consolidate missing chapters functions to domain module and add tests 2023-04-22 11:34:51 -04:00
arkon
add228407f Remove abstract TabeedBottomSheetDialog class 2023-04-19 22:43:36 -04:00
Trace
4816b4b53a
fix: skip duplicate chapters on download ahead if option to skip duplicates is enabled (#9334)
* fix: skip duplicate chapters on download ahead if option is enabled

* fix: Use a function to filter duplicates
2023-04-15 09:34:02 -04:00
Ivan Iskandar
c1e23ec18e
GlobalSearchScreen: Skip result screen when using search intent (#9299) 2023-04-07 22:18:48 -04:00
arkon
b7cd7b8b4e Better handle overflowing content in MigrateDialog actions
Fixes #9207
2023-04-05 22:36:57 -04:00
arkon
776d36caf1 Save current chapter progress when navigating to adjacent chapters
Fixes #9295
2023-04-05 22:29:56 -04:00
RS156
274218cf22
Make center zoom start vertically centered too (#8849)
Update ReaderPageImageView.kt

"true center" Zoom start position #8747.
Changed zoom position to get true center value.
2023-04-01 14:52:15 -04:00
Ivan Iskandar
6f1099b710
AdaptiveSheet: Wrap inside Dialog (#9279)
Because of Compose issue, the style of the sheet surface is adjusted as
a workaround

Ref https://issuetracker.google.com/issues/246909281
2023-03-29 22:34:32 -04:00
arkon
18f9e5ba6b Use IO dispatcher for some screen model work
Not sure if this is an ideal approach. If it is, we could migrate more usages to this.
2023-03-28 22:52:30 -04:00
arkon
d1bf857079 Remove unnecessary withIOContext 2023-03-28 18:16:43 -04:00
arkon
be54b8862e Refactor away some unnecessary lambda expressions 2023-03-26 13:27:31 -04:00
arkon
1a61130f0b Don't attempt to initialize manga details from BrowseSource or Search screens
This was effectively DDoSing sources as it does a request for every entry to get the details (primarily a cover image).
The expectation now is that users have to open individual entries to load the details/cover if needed.
This isn't necessary for most sources, which are able to provide covers as part of the listing normally.
2023-03-26 13:12:32 -04:00
arkon
1986042277 Skip POST_NOTIFICATIONS permission check for now
Fixes #9265
2023-03-26 12:34:32 -04:00
arkon
e932983494 Subscribe to changes to manga in BrowseSourceScreen
Fixes #9235
2023-03-26 12:06:12 -04:00
Two-Ai
35d381144d
Cleanup Preference.asHotFlow() (#9257)
* Drop duplicate initial call in Preference.asHotFlow

Preference.changes() always starts by returning the current value of
the preference, so asHotFlow calls block twice on the initial value.

Possible breaking change: As implemented, asHotFlow ran block(get())
before returning the flow. After this change, the first call to block
will run within the flow collection. This might cause concurrency
issues if the flow collection is late to execute.

* Inline Preference.asHotFlow

The Preference.changes().onEach().launchIn() pattern is used widely,
so the asHotFlow extension method is redundant.
2023-03-26 11:52:54 -04:00
arkon
8d7a7919a9 Add TODO to default to 32-bit color at some point
Originally proposed in #8959
2023-03-24 22:52:18 -04:00
arkon
953720472f Add "Rotate wide pages to fit" setting for paged reader
Originally authored in #7983

Co-authored-by: timothyng-164 <timothyng-164@users.noreply.github.com>
2023-03-24 22:49:35 -04:00
arkon
cb4699a5bb Bump dependencies 2023-03-22 22:58:42 -04:00
arkon
3cca460282 Misc cleanup 2023-03-19 22:38:14 -04:00
arkon
14d1bcacc9 Show proper string in manga detail screen for SourceNotInstalledException 2023-03-19 17:23:51 -04:00
Andreas
dfdb688b43
Migrate things to use newer data models (#9239)
* Remove old database models from Coil

* Remove old database models from TrackInfoDialogHome

* Remove old database models from Backup Manager
2023-03-19 13:11:58 -04:00
Alexandr Kozlinskiy
81af97df77
BrowseSource: do networkToLocal and initializeManga inside flow (#9217)
* do networkToLocal and initializeManga inside flow

* remove BrowseSourceScreenModel.GetManga
2023-03-18 09:42:44 -04:00
arkon
47a2d06682 Refactor tracker status string mappings
Should fix #9195
2023-03-10 23:01:10 -05:00
Ivan Iskandar
c0f94ae8af
Revert "Fix banners-related issues" (#9186)
Revert "Fix banners-related issues (#9143)"

This reverts commit 63048d2f0b.
2023-03-09 22:10:49 -05:00
arkon
09acc53483 Remove download all chapters menu item
Users can still select all the chapters (long press + select all) to download them.
2023-03-07 22:38:27 -05:00
arkon
bebd4be43d Move more things to domain/data modules 2023-03-07 22:38:02 -05:00
arkon
9b77759f24 Use stricter visibility for composables where possible 2023-03-05 18:41:08 -05:00
arkon
ad4912803b Refactor SourceManager/StubSource to domain module 2023-03-05 12:38:31 -05:00
arkon
f96f0c5889 Move some preferences into domain module 2023-03-05 12:11:47 -05:00
arkon
9caa0d147b Show proper message when doing global update
Fixes #9170
2023-03-05 11:07:33 -05:00
Two-Ai
b41565f879
Inline DownloadQueue into Downloader (#9159)
* Move statusFlow and progressFlow to DownloadManager

* Inline DownloadQueue into Downloader

* Move reorderQueue implementation to Downloader
2023-02-28 22:13:13 -05:00
arkon
f03a834136 Add explicit overflow menu options to refresh library category and manga chapters list
Jetpack Compose treats mouse input differently than just mimicking a touch input, so dragging doesn't actually
invoke the pull to refresh. If that changes in the future, we could consider removing these.

Doesn't seem too necessary for the extensions list, so I skipped that.

Closes #8455
2023-02-26 16:58:36 -05:00
arkon
5b2e937d5f Minor refactoring 2023-02-26 16:47:29 -05:00
Andreas
f27dc19b37
Move Local Source to separate module (#9152)
* Move Local Source to separate module

* Review changes
2023-02-26 16:16:49 -05:00
arkon
2368c50ebb Add menu shortcut to source settings in BrowseSourceScreen
Adapted from TachiyomiSY.

Co-authored-by: jobobby04 <jobobby04@users.noreply.github.com>
2023-02-26 10:23:07 -05:00
arkon
4efca04765 Avoid crashing in SourcePreferencesScreen if source can't be loaded 2023-02-25 15:32:46 -05:00
arkon
487622c592 Close source filter dialog when filtering 2023-02-25 15:16:48 -05:00
Ivan Iskandar
63048d2f0b
Fix banners-related issues (#9143)
This is most likely Compose issue so these changes will
be reevaluated when new Compose ver is out.
2023-02-25 14:44:35 -05:00
Two-Ai
ed6809fa28
Simplify filter logic (#9141)
* Remove unnecessary else branch

* Add TriStateFilter applyFilter

* Simplify filterFnTracking filter logic
2023-02-25 11:46:40 -05:00
Two-Ai
86b9262a7e
Make DownloadManager the sole entry point for DownloadService (#9140)
* Rename functions for DownloadService internal use

* Call DownloadService.start via DownloadManager

* Inline DownloadService.stop into pauseDownloads

* Inline DownloadService.stop into clearQueue

NotificationReceiver will now also stop the DownloadService when
receiving ACTION_CLEAR_DOWNLOADS.

* Provide DownloadService.isRunning via DownloadManager
2023-02-24 22:07:30 -05:00
arkon
7ec87e76db Migrate TriState usages to TriStateFilter enum 2023-02-24 16:09:47 -05:00
Ivan Iskandar
ec3ce74af8
TrackDateSelectorScreen: Use M3 date picker (#9138) 2023-02-24 15:22:23 -05:00
arkon
92132c59f5
Migrate source filter sheet to Compose (#9135) 2023-02-23 22:32:40 -05:00
arkon
bd47eafeec Fix per-category sort/display affecting the wrong category 2023-02-23 13:54:08 -05:00
arkon
fd7c993b0b Move CheckboxState to core module 2023-02-21 22:52:36 -05:00
arkon
93523ef50b Remove dependency injection from core module and data module from presentation-widget module
Includes side effects:
- No longer need to restart app for user agent string change to take effect
- parseAs extension function requires a Json instance in the calling context, which doesn't necessarily need to be the default one provided by Injekt
2023-02-20 19:02:38 -05:00
arkon
10d7349506 Move more components to presentation-core module 2023-02-20 10:12:41 -05:00
arkon
ec49411bee Avoid crashes if headers can't be built for usage in WebView 2023-02-19 11:48:26 -05:00
arkon
3f7911235c Use unique keys for all screens to avoid crashes
Fixes #9008
Fixes #9110
2023-02-19 11:09:41 -05:00
arkon
727399611d Migrate library settings sheet to Compose 2023-02-18 20:55:55 -05:00
arkon
07fdb74fbc Minor settings sheet cleanup 2023-02-18 19:00:19 -05:00
arkon
dd71c76a8f Move more components 2023-02-18 17:04:32 -05:00
arkon
58a0add4f6 Move more components to presentation-core module 2023-02-18 16:33:03 -05:00
arkon
bfe143015a Move more components to presentation-core module 2023-02-18 16:03:01 -05:00
arkon
e3cf863230 Start moving some Compose components to presentation-core module 2023-02-18 15:52:52 -05:00
arkon
ee818bc7c5 Move chapter utils to domain module 2023-02-18 15:24:04 -05:00
arkon
f816196df2 Move more things to domain module 2023-02-18 15:14:04 -05:00
arkon
ceaf579cb0 Avoid crashing if getChapterUrl is not implemented
Fixes #9105
2023-02-18 10:16:17 -05:00
Ivan Iskandar
d3dadf71e8
MainActivity: Avoid navigator-related crash when handling onNewIntent (#9104) 2023-02-18 10:08:37 -05:00
Two-Ai
ffa8c8fd07
Remove RxJava in PageHolder (#9103)
Inline readImageHeaderSubscription in PageHolder

Inline readImageHeaderSubscription in PagerPageHolder and
WebtoonPageHolder by converting setImage() into a suspend function.
The image processing runs in the loadPageAndProcessStatus
continuation.

Use suspendCancellableCoroutine as a substitute for doOnUnsubscribe
in WebtoonPageHolder.
Closing openStream after the frame.setImage but before the PageHolder
is recycled causes the page display to fail for reasons that are not
currently understood.

Remove subscription handling from WebtoonViewer/WebtoonBaseHolder as
it is no longer used.
2023-02-18 10:07:27 -05:00
arkon
0ef7650c1a Avoid crashing if opening browse with unavailable source 2023-02-15 22:47:47 -05:00
Two-Ai
4635e58405
Simplify PageHolder load Job (#9086)
Inline statusJob into loadJob, using supervisorScope to load the page
and track status changes in parallel.
- supervisorScope does not complete until both the child loadPage
  coroutine and statusFlow.collectLatest have completed.
- Cancelling supervisorScope cancels the child loadPage coroutine and
  statusFlow.collectLatest.
- Use supervisorScope instead of coroutineScope to let status
  collection continue if loadPage fails.

Inline progressJob into loadJob, using collectLatest's cancellation
to avoid cancelling the progressFlow collection explicitly.
- collectLatest cancels the previous action block when the flow
  emits a new value. This means the DOWNLOAD_IMAGE
  progressFlow.collectLatest gets automatically cancelled when
  statusFlow emits a new state.

Convert launchLoadJob to suspend function, move job launch to caller,
and rename as loadPageAndProcessStatus.
2023-02-15 22:24:55 -05:00
Two-Ai
dc2eaf0788
Fix ID type mismatch in MigrateSearchScreenModel (#9090)
`it.id` is the source ID of the source being sorted.
`state.value.manga!!.id` is the manga ID of the selected manga.
`state.value.manga!!.source` is the source ID of the selected manga.
2023-02-14 11:46:31 -05:00
0x7673
d02b0ca2db
Add copy tags to clipboard feature (#9063) 2023-02-13 22:52:10 -05:00
Ivan Iskandar
be4072c86b
Rework on the wheel picker (#8559)
* Rework the wheel picker

doesn't need for the animation to stop to change the value

* fix

---------

Co-authored-by: arkon <arkon@users.noreply.github.com>
2023-02-12 23:10:47 -05:00
arkon
2970eca9e4 Remove background extensions updates check
Same reasoning as removing app update check. It gets kicked off in the foreground now too.
2023-02-12 23:07:11 -05:00
arkon
6348cbaeb7 Add option to hide entries already in library when browsing sources
Closes #2941
2023-02-12 22:28:12 -05:00
arkon
a7cb33d8c9 Open global search when Browse is tapped twice
Closes #3925
2023-02-12 18:17:46 -05:00
arkon
e052bdef96 Move reader preloading to IO scope
Maybe fixes #8440
2023-02-12 16:14:12 -05:00
arkon
d522d6d545 Avoid preload download check if chapter is already loaded or loading
Maybe fixes #8953, #9060
2023-02-12 16:03:24 -05:00
Two-Ai
7b118eba22
Clean up LibraryItem (#9072)
* Move LibraryItem vars to constructor vals

* Convert LibraryItem to data class

Remove redundant equals and hashCode

* Remove unused LibraryItem.displayMode

* Simplify LibraryItem.matches()

* Align types in LibraryItem and LibraryBadges

* fixup! Simplify LibraryItem.matches()
2023-02-12 15:25:27 -05:00
arkon
f6e6a7ddf1 Replace custom download amount with next 25
Simplifies things and maybe discourages whacky downloading behavior?
Users can still range select in the chapters list to download custom amounts.
2023-02-12 15:25:09 -05:00
arkon
23432e4405 Prioritize finding selected chapter when deduping reader chapters
Fixes #9054
2023-02-08 21:47:57 -05:00
Ivan Iskandar
ad762f8303
Remove FAB extra padding in DownloadQueueScreen (#9053) 2023-02-08 09:37:04 -05:00
Ivan Iskandar
ef9dacde79
Fully utilize WorkManager for library updates (#9007)
No more trampolining, and stuff.

It's pretty much straight copy-paste from the service, with
some changes related to cancellation handling. Manual updates
will also runs with workman job so auto update work
scheduling need some adjustments too.

Bumped version code to re-enqueue auto update job with the
new spec.

Co-authored-by: arkon <arkon@users.noreply.github.com>
2023-02-07 22:37:20 -05:00
Two-Ai
bd2cb97179
Replace RxJava in DownloadQueue (#9016)
* Misc cleanup

- Replace !List.isEmpty with List.isNotEmpty
- Remove redundant case in MoreScreenModel
- Drop no-op StateFlow.catch
  - From lint warning:
> SharedFlow never completes, so this operator typically has not
> effect, it can only catch exceptions from 'onSubscribe' operator

* Convert DownloadQueue queue to MutableStateFlow

Replace delegation to a MutableList with an internal
MutableStateFlow<List>.

In order to avoid modifying every usage of the queue as a list, add
passthrough functions for the currently used list functions. This
should be later refactored, possibly by inlining DownloadQueue
into Downloader.

DownloadQueue.updates was a SharedFlow which updated every time a
change was made to the queue. This is now equivalent to the queue
StateFlow.

Simultaneous assignments to _state.value could cause concurrency
issues. To avoid this, always modify the queue using _state.update.

* Add Download.statusFlow/progressFlow

progressFlow is based on the DownloadQueueScreenModel implementation
rather than the DownloadQueue implementation.

* Reimplement DownloadQueue.statusFlow/progressFlow

Use StateFlow<List<T>>.flatMapLatest() and List<Flow<T>>.merge() to
replicate the effect of PublishSubject.

Use drop(1) to avoid re-emitting the state of each download each time
the merged flow is recreated.

* fixup! Reimplement DownloadQueue.statusFlow/progressFlow
2023-02-07 22:13:19 -05:00
arkon
3c16082636 Don't show SourceNotInstalledException name in error snackbar 2023-02-05 10:23:30 -05:00