From 1afcf3482905d900cfe35c5d1925eaeb4fc5848b Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 23 Feb 2020 14:48:53 -0500 Subject: [PATCH] Set webtoon page padding on page bind --- .../ui/reader/viewer/webtoon/WebtoonPageHolder.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 1414ccf46..15ccd8a67 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 @@ -113,10 +113,7 @@ class WebtoonPageHolder( private var readImageHeaderSubscription: Subscription? = null init { - frame.layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT) - if (viewer.config.padPagesVert) { - frame.setPadding(0, 0, 0, 15.dpToPx) - } + refreshLayoutParams() } /** @@ -125,6 +122,15 @@ class WebtoonPageHolder( fun bind(page: ReaderPage) { this.page = page observeStatus() + refreshLayoutParams() + } + + private fun refreshLayoutParams() { + frame.layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT).apply { + if (viewer.config.padPagesVert) { + bottomMargin = 15.dpToPx + } + } } /**