From dd59748bf082b2c2a236061d1cf9357b95791493 Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 7 Apr 2020 22:44:37 -0400 Subject: [PATCH] Minor cleanup --- .../eu/kanade/tachiyomi/data/track/TrackManager.kt | 2 +- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 2 +- .../kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt | 3 ++- .../ui/reader/viewer/webtoon/WebtoonPageHolder.kt | 2 +- .../ui/reader/viewer/webtoon/WebtoonViewer.kt | 2 +- app/src/main/res/layout/reader_settings_sheet.xml | 10 +--------- app/src/main/res/values/strings.xml | 1 - 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt index 2a044a3b46..173a6ffd6f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/TrackManager.kt @@ -7,7 +7,7 @@ import eu.kanade.tachiyomi.data.track.kitsu.Kitsu import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList import eu.kanade.tachiyomi.data.track.shikimori.Shikimori -class TrackManager(private val context: Context) { +class TrackManager(context: Context) { companion object { const val MYANIMELIST = 1 diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index b66db4f8d8..39aaa69096 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -389,7 +389,7 @@ class ReaderActivity : BaseRxActivity() { RIGHT_TO_LEFT -> R2LPagerViewer(this) VERTICAL -> VerticalPagerViewer(this) WEBTOON -> WebtoonViewer(this) - VERTICAL_PLUS -> WebtoonViewer(this, true) + VERTICAL_PLUS -> WebtoonViewer(this, isContinuous = false) else -> L2RPagerViewer(this) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index 932784f79b..3978015bbb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -72,7 +72,8 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia viewer.onItemSelectedListener = IgnoreFirstSpinnerListener { position -> activity.presenter.setMangaViewer(position) - if (activity.presenter.getMangaViewer() == ReaderActivity.WEBTOON || activity.presenter.getMangaViewer() == ReaderActivity.VERTICAL_PLUS) { + val mangaViewer = activity.presenter.getMangaViewer() + if (mangaViewer == ReaderActivity.WEBTOON || mangaViewer == ReaderActivity.VERTICAL_PLUS) { initWebtoonPreferences() } else { initPagerPreferences() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index fc3a5650cf..766ebb2cf0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -125,7 +125,7 @@ class WebtoonPageHolder( private fun refreshLayoutParams() { frame.layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT).apply { - if (viewer.isVerticalPlus) { + if (!viewer.isContinuous) { bottomMargin = 15.dpToPx } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt index ee3750d037..b7c90ccc0c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonViewer.kt @@ -22,7 +22,7 @@ import timber.log.Timber /** * Implementation of a [BaseViewer] to display pages with a [RecyclerView]. */ -class WebtoonViewer(val activity: ReaderActivity, val isVerticalPlus: Boolean = false) : BaseViewer { +class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = true) : BaseViewer { /** * Recycler view used by this viewer. diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index 860a735149..e3cdde96ae 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -256,14 +256,6 @@ android:textColor="?android:attr/textColorSecondary" app:layout_constraintTop_toBottomOf="@id/webtoon_prefs" /> - - + app:constraint_referenced_ids="webtoon_prefs,crop_borders_webtoon" /> Show page number 32-bit color Crop borders - Vertical padding between pages Use custom brightness Use custom color filter Color filter blend mode