Commit Graph

2856 Commits

Author SHA1 Message Date
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
arkon
29aee68ec7 Revert "Show no pinned sources message when attempting to migrate/search"
This reverts commit 6bb3070c57.

This doesn't quite work correctly, so reverting for now.
We'll have to have more robust states or something to deal with this in the
future.
2023-02-05 10:20:19 -05:00
stevenyomi
589bdba0b1
Show exception class in snackbar message (#9006)
* Show exception class in snackbar message

* omit IOException too
2023-01-31 22:36:53 -05:00
Andreas
b00f00730d
Set InsertPage status to Ready (#9001)
Fixes insert page just loading
2023-01-29 09:03:12 -05:00
arkon
f2c48480b6 Move some interactors to domain module 2023-01-27 22:37:17 -05:00
arkon
1730dd6af1 Move more things around 2023-01-27 22:31:12 -05:00
Andreas
2501fef9e4
Split UpdatesGridGlanceWidget into smaller bits (#8991)
- Renamed Composables
- Moved Constants to core module
2023-01-27 14:49:57 -05:00
Two-Ai
b4b3a4d286
Fixup HttpPageLoader _loadPage (#8984)
Fixup for e4bc8990 (#8955)

HttpSource.fetchImage() uses Call.asObservableSuccess(), which
cancels the call on unsubscribe. This causes the call to be cancelled
before it is used, leading to a "java.net.SocketException: Socket is
closed" when trying to use the response in putImageToCache().

To fix this, use Call.awaitSuccess() via a new HttpSource.getImage()
suspending function. This addition to source-api is only intended for
app use, so it will not be added to the extensions-api stubs.
2023-01-25 18:18:12 -05:00
Two-Ai
2ef1f07aae
Replace PageLoader.getPage() with PageLoader.loadPage() (#8976)
* Follow page status via StateFlow

Keep getPage subscription since it's needed to load the pages

* Replace PageLoader.getPage with PageLoader.loadPage
2023-01-23 17:10:44 -05:00
stevenyomi
1a319601de
Fix extension search query cursor and debounce (#8972)
* Fix extension search query cursor

* debounce

* extract debounce constant
2023-01-22 16:19:46 -05:00
Andreas
cdf242e8c8
Move more to data and domain modules (#8973) 2023-01-22 16:19:22 -05:00
arkon
d45fc1e245 Move more models to domain module 2023-01-22 11:04:50 -05:00
arkon
14500ba4f8 Move more repositories to domain module 2023-01-22 10:59:52 -05:00
arkon
345e9c2a9a Move more models to domain module 2023-01-22 10:54:28 -05:00
arkon
b53e24e0db Move more models to domain module 2023-01-22 10:37:13 -05:00
Andreas
d3a73fc228
Move Category model and repository to domain and data layer (#8967)
To keep the commit from being 100+ files the interactors wasn't moved.

The domain module like the data module uses `tachiyomi` instead of `eu.kanade.tachiyomi` for package names
2023-01-22 10:12:29 -05:00
arkon
2ebc8d9ae5 Save current page state on configuration change
Fixes #8881

The actual issue is that the ViewModel migration actually differs between what the current `init` block
and previous `onSave` methods did; where the `init` block does not get triggered on saving the
instance on config changes.

Not entirely sure why onSaveInstanceState was explicitly avoided for config changes before, but we
just do it all the time now and end up updating the requestedPage with the current page.
2023-01-21 20:18:12 -05:00
zbue
e28b015580
MangaScreenModel: Make download function follow reader preference (#8920)
* Make download function more clearer in manga screen

Maybe resolves #8879

* Minor cleanup

* Minor cleanup 2
2023-01-21 16:47:22 -05:00
Two-Ai
e4bc8990fb
Replace RxJava in HttpPageLoader downloader (#8955)
* Convert downloader Observable to flow

Uses `runInterruptible` to turn the blocking call to `queue.take()`
into a cancellable call.

Flow collection is ended by cancelling the scope in `recycle`. This
means the `HttpPageLoader` can't be reused after calling `recycle`,
but this was true with the `Observable` as well.)

* Convert load Observables to suspending function

Inlining the Observables allows for some simplification of the error
handling. Behavior should be otherwise identical.

* Convert cleanup Completable to coroutine

Uses global `launchIO`, not ideal but similar to previous behavior.
Can't be scheduled on the local `scope` as this runs after `scope` is
cancelled.
2023-01-21 16:46:16 -05:00
arkon
7a972dfdb7 Don't use platform attributes for white/black reader backgrounds
Probably fixes #8946
2023-01-18 22:49:28 -05:00
arkon
1a4dad72a9 Hide WebView menu item in reader if local
Closes #8932
2023-01-16 22:40:36 -05:00
arkon
5b5eb92184 Fix checking downloads banner showing up incorrectly 2023-01-14 20:04:36 -05:00
Two-Ai
58ebf14691
Convert PageLoader.getPages to suspending function (#8917) 2023-01-14 19:45:15 -05:00
Verzaukeks
992bab4f79
Prevent scrolling outside bounds in webtoon/vertical reading mode (#8821) 2023-01-14 18:38:52 -05:00
zbue
f301dc64f0
Allow partially read chapters to be marked as unread in updates screen (#8884)
* Allow partially read chapters to be marked as unread in updates screen

* Review changes

* Review changes 2
2023-01-14 18:26:40 -05:00
zbue
33a2219716
Enable confirmButton only when needed to respond to user input (#8848)
* Enable `confirmButton` when appropriate

* Show error in dialog instead

* Follow M3 guidelines
2023-01-14 18:24:57 -05:00
Two-Ai
62480f090b
Replace RxJava in ChapterLoader and ReaderViewModel (#8915)
* Replace RxJava in ChapterLoader

* Don't swallow CancellationException

* Simplify loadChapter behavior

* Add error handling to loadAdjacent
2023-01-14 18:22:27 -05:00
zbue
287489d7d0
Show chapter scanlator on reader transition (#8910)
Closes #7131
2023-01-14 17:00:04 -05:00
arkon
2df0236669 Show loading indicator during migration
Closes #8862
2023-01-13 23:01:52 -05:00
Two-Ai
8c494f314c
Fix DownloadPageLoader resource leak (#8905)
The underlying ZipFile is leaking. To fix, store a reference to the
ZipPageLoader and recycle it on recycle.
2023-01-13 22:30:47 -05:00
arkon
b6468c7e31 Only how indexing downloads banner the first time
Closes #8903
2023-01-13 18:40:59 -05:00
arkon
91004ad514 Parallelize global search properly
Fixes #8906
2023-01-13 17:58:00 -05:00
arkon
a2ee4e63ae Minor cleanup 2023-01-12 22:53:28 -05:00
Alessandro Jean
7329f03bc5
Show proper Exception message in MangaScreen (#8900)
Show proper Exception message in MangaScreen.
2023-01-12 17:45:38 -05:00
arkon
82ea643c7d Don't prompt to add to library multiple times
Fixes #8842
2023-01-11 20:00:50 -05:00
arkon
34bb90f3c2 Update library sheet filter tab on open
Fixes #8885
2023-01-11 19:14:37 -05:00
arkon
75b23c99ec Refactor how extensions list is modelled
To better enable changing the UI in the future based on sections.
2023-01-10 23:18:34 -05:00
arkon
6bb3070c57 Show no pinned sources message when attempting to migrate/search 2023-01-10 22:39:19 -05:00
arkon
7df10b076c Show the tracker name when showing error toast 2023-01-09 23:27:11 -05:00
Two-Ai
2245658363
Replace RxJava in DownloadQueueScreenModel (#8872) 2023-01-09 23:08:04 -05:00
arkon
46774771ec Fix double tapping History not working consistently
Fixes #8875
2023-01-09 22:50:11 -05:00
arkon
60456fe0e9 Fix crash in categories screen on config change
Fixes #8861
2023-01-08 22:12:53 -05:00
arkon
a0f47d3f1b Don't exclude same source when checking for duplicate entries
Closes #8870
2023-01-08 22:06:42 -05:00
arkon
6efcb8ccfa Use Voyager for WebView in non-reader places 2023-01-08 16:37:43 -05:00
arkon
0067d474c8 Use theme padding values in more places 2023-01-08 15:41:06 -05:00
MCAxiaz
cf393b217b
Add Reader Setting to Skip Dupe Chapters (#8831)
Add reader setting to filter dupe chapters with same scanlator priority.
2023-01-08 15:40:23 -05:00
arkon
e265b929a1 Avoid crashes when fetching assist content URL in ReaderActivity 2023-01-08 15:23:06 -05:00
arkon
425e48bec6 Avoid crashes when opening WebView from reader
Also ensure WebViewActivity has an Assistant URL when it first opens with a URL.
2023-01-08 10:17:54 -05:00
stevenyomi
2a3c3d8d6a
Fix reader settings sheet's mode section not updated (#8857) 2023-01-07 15:13:08 -05:00
stevenyomi
7b026cec8d
Fix floating-point error in navigate pan (#8856) 2023-01-07 15:09:10 -05:00
arkon
68345e636e Remove ability to hide unread chapter badges in library 2023-01-07 14:25:35 -05:00
stevenyomi
0861c5618c
Fix reader settings sheet not updated (#8854)
* Revert "Recreate reader settings when opening sheet (#8054)"

This reverts commit acb8ab15b2.

* Revert "Fix stacking of Settings menu in the reader on multiple taps (#8002)"

This reverts commit 30ac94181b.

* Fix reader settings sheet not updated
2023-01-07 14:25:30 -05:00
arkon
1e65313fa7 Open entry when long pressing during migration in source search
This matches the behavior from 0.13.6

Fixes #8176
2023-01-07 11:51:00 -05:00
arkon
c4c6e41c46 Fix downloaded badges appearing when filtering by downloaded
Fixes #8850
2023-01-07 10:32:14 -05:00
Two-Ai
920ca405a2
Use MainScope for coroutines in ui package classes (#8845) 2023-01-07 10:07:09 -05:00
arkon
50d46fe7f6 Prioritize "all" ("Multi") lang in extensions lists
Fixes #8811
Fixes #8812
2023-01-05 22:34:24 -05:00
stevenyomi
6a423f0650
Update toolbar query on genre search (#8837) 2023-01-05 17:02:27 -05:00
arkon
01ec26842d Unify layout for new update and crash screens 2022-12-30 23:14:29 -05:00
Ivan Iskandar
94a410f50f
TrackDateRemoverScreen: Fix pop behavior after confirming removal (#8792) 2022-12-23 09:29:01 -05:00
stevenyomi
a8230ad574
Fix browse search query display and keyboard focus (#8781) 2022-12-21 22:14:04 -05:00
stevenyomi
46417fe427
Pass listing query to BrowseSourceScreen (#8763)
* Pass listing query to BrowseSourceScreen

* Don't use referential equality
2022-12-17 17:28:25 -05:00
stevenyomi
63da463e02
Clean up usages of listing UI models (#8762) 2022-12-17 14:51:03 -05:00
stevenyomi
817e144ff6
BrowseSourceScreen: fix navigate up and filter sheet (#8761) 2022-12-17 13:21:12 -05:00
stevenyomi
c44db54d9f
Fix snackbar blocking refreshing state in MangaScreen (#8759) 2022-12-17 12:06:49 -05:00
arkon
0e2bdb7863 Minor cleanup 2022-12-17 12:02:01 -05:00
Two-Ai
593172f891
Track Page progress with StateFlow (#8749)
* Update ReaderProgressIndicator documentation

ReaderProgressIndicator is not always determinate (cc554530, #5605).

* Track Page progress with StateFlow
2022-12-16 22:18:50 -05:00
Ivan Iskandar
e20c66b156
App state banner tweaks (#8746)
* Move download indexing notification to this banner group
* Animate state changes
2022-12-16 22:18:17 -05:00
arkon
bc6a12a4f7 Sort global search source results properly
Fixes #8741
2022-12-14 23:20:51 -05:00
arkon
90db3acefd Don't start at last read page if chapter is completely marked as read
Fixes #8737
2022-12-14 23:04:30 -05:00
arkon
2f2f59279d Fix crash if tapping title when opening reader directly 2022-12-14 22:54:51 -05:00
arkon
4992f87cb1 Better handle status bar light/dark icons based on banner background color 2022-12-14 22:54:34 -05:00
arkon
3749cee28f Add Assistant content URLs
This is surfaced in recents on Pixel devices for example.
Docs: https://developer.android.com/guide/app-actions/assistant-sharing

Co-authored-by: Jays2Kings <Jays2Kings@users.noreply.github.com>
2022-12-10 12:08:39 -05:00
Ivan Iskandar
ca500da4d8
Adjust insets handling in tablet UI (#8711)
* Adds startBar slot in Scaffold to handle nav rail
* Consumes unneeded insets in settings
2022-12-10 10:02:13 -05:00
Ivan Iskandar
820ed6a468
Move system bar color set to the main composable (#8710)
This one doesn't check navbar location before adding a scrim, doesn't really
matter since now no body component is being drawn below the system bar.
2022-12-10 10:01:16 -05:00
Soitora
8937e22ce4
Add back option to hide Updates count (#8709)
Adds back the option to hide the updates count on the Updates tab
2022-12-09 17:25:06 -05:00
Ivan Iskandar
82a3a98a5a
Adjust screen transitions (#8707)
* Fade transition between main navigation tabs
* Shared axis X between screen stacks

Activity transition is using a "close enough" shared axis X xml animation
2022-12-09 17:23:00 -05:00
Ivan Iskandar
d97eab0328
Move app state banner to the very top (#8706)
This moves the banners to the root composable and so eliminates the need to
track the app states in every screen.
2022-12-09 11:20:13 -05:00
zbue
01c6e46a71
Show empty screen when a category is empty (#8690)
* Show empty screen when a category is empty

* Review changes

* Review changes #2

Co-authored-by: arkon <arkon@users.noreply.github.com>
2022-12-08 09:15:10 -05:00
arkon
ed5e013874 Use proper category when getting random item
Fixes #8700
2022-12-08 09:01:37 -05:00
arkon
f8e4153dbf Disable Jetifier 2022-12-07 23:06:25 -05:00
Ivan Iskandar
f7a92cf6ac
Replace reader's Presenter with ViewModel (#8698)
includes:
* Use coroutines in more places
* Use domain Manga data class and effectively changing the state system
* Replace deprecated onBackPress method

Co-authored-by: arkon <arkon@users.noreply.github.com>
2022-12-07 23:00:01 -05:00
Two-Ai
6ca32710be
Cleanup Page status (#8696)
* Cleanup Page statusSubject and statusCallback

* Convert Page status from Int to enum
2022-12-07 18:28:38 -05:00
Ivan Iskandar
f05e251991
GlobalSearchScreen: Add unique key (#8693)
Avoids crash when an old screen is being replaced by a new one
2022-12-07 08:27:54 -05:00
arkon
a3f3f9d562 Avoid some crashes 2022-12-06 22:21:04 -05:00
arkon
b6d6de6b9f Avoid crashing when clearing cookies for invalid source URLs
e.g. Komga sources with no URLs set
2022-12-05 22:18:19 -05:00
arkon
09cebf20f3 Handle intent after navigator is initialized
Fixes crash if opening from widget or notification when activity isn't already launched.
2022-12-05 17:16:16 -05:00
arkon
a8c732d67b Fix opening download notification only going to More tab 2022-12-05 16:09:55 -05:00
arkon
843c9c7e57 Fix migrate options dialog not being selected when tapping text 2022-12-05 15:12:16 -05:00
arkon
c88b79fa17 Minor cleanup 2022-12-05 14:14:50 -05:00
arkon
3f9820ac79 Always show library tabs and counts when searching
Closes #8680
2022-12-05 10:06:41 -05:00
Ivan Iskandar
c288e6b8fa
Fix ANR when opening from notification/widget (#8683) 2022-12-05 09:00:30 -05:00
Ivan Iskandar
8945ef8880
Change source preference theming fix (#8679) 2022-12-05 00:10:11 -05:00
arkon
99a717f849 Hide webtoon reader scrollbars
Fixes #8676
2022-12-04 18:09:37 -05:00
arkon
4f5270cb7d Fix unusable categories when content is filtered out
Fixes #8675
Effectively reverts #8633, which introduces weird edge cases
2022-12-04 13:39:53 -05:00
arkon
719d427956 Truncate long nav bar/rail items
Fixes #8670
2022-12-04 12:58:59 -05:00
Ivan Iskandar
be854b3e90
Fix appbar back button in Settings screen (#8674) 2022-12-04 10:27:14 -05:00
Ivan Iskandar
47f079891f
Track sheet fixes (#8673)
* Fix Track sheet not being disposed properly

* Change insets handling
2022-12-04 10:27:02 -05:00
arkon
696dc59ea5 More domain model migrations 2022-12-03 22:54:18 -05:00
Two-Ai
5f6666a438
Migrate Download to domain model (#8664) 2022-12-03 22:30:30 -05:00
AntsyLich
373463e995
Change Updates icon badge to show new updates count (#8659)
* Change Updates icon badge to show new updates count

* Fix reference

* review changes

* Lint
2022-12-03 14:44:30 -05:00
Ivan Iskandar
7be9b49143
Fix BrowseSourceScreen list/grid unnecessary reloads (#8661) 2022-12-03 14:43:52 -05:00