Commit Graph

756 Commits

Author SHA1 Message Date
Ivan Iskandar
740e370465
Bump compile SDK version 34 (#9625) 2023-06-22 14:20:12 -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
arkon
841f80f935 Add share menu item in reader
Closes #9510
2023-06-09 22:52:49 -04:00
Ivan Iskandar
39e4568460
ReaderProgressIndicator: Convert to Compose (#9574) 2023-06-03 13:11:41 -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
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
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
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
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
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
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
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
arkon
be54b8862e Refactor away some unnecessary lambda expressions 2023-03-26 13:27:31 -04:00
arkon
1986042277 Skip POST_NOTIFICATIONS permission check for now
Fixes #9265
2023-03-26 12:34:32 -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
bebd4be43d Move more things to domain/data modules 2023-03-07 22:38:02 -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
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
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
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
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
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
arkon
23432e4405 Prioritize finding selected chapter when deduping reader chapters
Fixes #9054
2023-02-08 21:47:57 -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
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
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
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
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
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
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
a2ee4e63ae Minor cleanup 2023-01-12 22:53:28 -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
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
Two-Ai
920ca405a2
Use MainScope for coroutines in ui package classes (#8845) 2023-01-07 10:07:09 -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
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
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
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
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
arkon
99a717f849 Hide webtoon reader scrollbars
Fixes #8676
2022-12-04 18:09:37 -05:00
arkon
696dc59ea5 More domain model migrations 2022-12-03 22:54:18 -05:00
arkon
beda99bbe0 Replace RxJava in ReaderChapter and reader transitions 2022-12-02 23:36:33 -05:00
arkon
bb1e7816e1 Replace some usages of RxJava in reader 2022-12-02 23:11:42 -05:00
Ivan Iskandar
3d66eaea83
Merge Voyager screens (#8656)
* Merge Voyager screens

* cleanups
2022-12-02 22:35:30 -05:00
arkon
5313a5d5d2 Remove unnecessary base Nucleus classes
The reader still uses it, but we just move stuff to there.
2022-12-02 13:23:26 -05:00
AntsyLich
ba91b483a0
Delayed Tracking Update related fix (#8642)
* Delayed Tracking Update related fix

* Lint
2022-12-01 23:01:24 -05:00
arkon
3480b45098 Minor cleanup 2022-11-27 17:12:45 -05:00
arkon
4f2a794fba Remove dead code 2022-11-27 15:09:37 -05:00
arkon
7e74949d38 Explicitly add READ_APP_SPECIFIC_LOCALES permission
Some devices are throwing a SecurityException (calling getApplicationLocales) for some reason.
2022-11-25 23:03:42 -05:00
arkon
2c850d0e33 Fix invert tapping dropdown not updating checked state in reader
Fixes #8566
Should ideally just Compose-ify it all some day.
2022-11-20 15:12:51 -05:00
AntsyLich
ba2a528886
Fix related to cancelling queued chapters (#8528)
Tachi removes the downloaded chapter (if it exists) when you just cancelled a download from queue.

PR fixes that

Also removes redundant return
2022-11-18 22:27:39 -05:00
arkon
c6c4c1c393 Migrate to more domain model usages 2022-11-10 22:42:44 -05:00
arkon
8749be518f Adjust read next history logic
Closes #8454
2022-11-05 10:37:32 -04:00
arkon
642b392d44 Fix crash in ReaderReadingModeSettings when reverse portrait orientation is set 2022-10-30 23:10:59 -04:00
arkon
fc184f1cfa Clean up download ahead logic
- Remove redundant chapter sorting logic when fetching next chapter(s)
- Remove redundant download queue checks (it'll handle already queued or downloaded items)
- Trigger download ahead when read >= 25% of chapter rather than 20%
- Rely on download cache when checking if next chapter is downloaded to avoid jank (fixes #8328)
2022-10-30 16:59:33 -04:00
stevenyomi
4b60138d41
Clean up strings and icons (#8326)
* Clean up strings and icons

* fix incorrect usages of label_more

* restore strings and reduce usage of android.R

* removing icon desc of FABs anyway as app's not for visual impaired users
2022-10-29 11:43:51 -04:00
d-najd
37b7efbc87
WebView for chapter link (#8281)
* backup

* doing logic

* cleanup

* applying suggestion

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>

* requested changes

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
2022-10-28 11:41:51 -04:00
arkon
6e04822f5e Only enable ACRA crash logging in preview and stable release builds 2022-10-22 15:47:09 -04:00
arkon
7e40680af0 Perform download cache renewal async
Don't block on cache renewals, but notify library on updates so that the badges show up when ready.

We skip the cache when checking if a chapter is downloaded for the reader assuming that it's a
relatively low cost to check for a single chapter.

(Probably) fixes #8254 / fixes #7847
2022-10-21 15:00:41 -04:00
arkon
b04807e53a Proper DI instantiation for some more download related classes 2022-10-21 14:29:44 -04:00