From caaddda04093bd3d332e5a0cdb9ba710e19cbd00 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 26 Apr 2020 19:11:00 -0400 Subject: [PATCH] Manhua no longer switches to LTR reader if the default reader is webtoon --- .../eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index 22e36af075..63eea1037b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -414,14 +414,16 @@ class ReaderPresenter( * Returns the viewer position used by this manga or the default one. */ fun getMangaViewer(): Int { - val manga = manga ?: return preferences.defaultViewer() + val default = preferences.defaultViewer() + val manga = manga ?: return default val readerType = manga.defaultReaderType() - if (manga.viewer == -1 || - (readerType == ReaderActivity.WEBTOON && readerType != manga.viewer)) { - manga.viewer = readerType + if (manga.viewer == -1 || (readerType == ReaderActivity.WEBTOON && readerType != manga.viewer)) { + val cantSwitchToLTR = + (readerType == ReaderActivity.LEFT_TO_RIGHT && default != ReaderActivity.RIGHT_TO_LEFT) + manga.viewer = if (cantSwitchToLTR) 0 else readerType db.updateMangaViewer(manga).asRxObservable().subscribe() } - return if (manga.viewer == 0) preferences.defaultViewer() else manga.viewer + return if (manga.viewer == 0) default else manga.viewer } /**