Setting webtoon view background to always black

closes #262
This commit is contained in:
Jay 2020-05-04 18:38:27 -04:00
parent 0a1c036cc9
commit 31800027a1
5 changed files with 23 additions and 7 deletions

View File

@ -459,6 +459,14 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
viewer = newViewer
viewer_container.addView(newViewer.getView())
viewer_container.setBackgroundColor(
if (viewer is WebtoonViewer) {
Color.BLACK
} else {
getResourceColor(android.R.attr.colorBackground)
}
)
toolbar.title = manga.title
page_seekbar.isRTL = newViewer is R2LPagerViewer

View File

@ -92,12 +92,8 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
is WebtoonViewer -> initWebtoonPreferences()
}
val bottomEdgeView = when (activity.viewer is PagerViewer) {
true -> page_transitions
false -> webtoon_side_padding
}
setBottomEdge(bottomEdgeView, activity)
setBottomEdge(page_transitions, activity)
setBottomEdge(webtoon_side_padding, activity)
close_button.setOnClickListener {
dismiss()
@ -117,6 +113,13 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) :
private fun initGeneralPreferences() {
viewer.onItemSelectedListener = IgnoreFirstSpinnerListener { position ->
activity.presenter.setMangaViewer(position)
val mangaViewer = activity.presenter.getMangaViewer()
if (mangaViewer == ReaderActivity.WEBTOON || mangaViewer == ReaderActivity.VERTICAL_PLUS) {
initWebtoonPreferences()
} else {
initPagerPreferences()
}
}
viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false)

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.ui.reader.viewer.webtoon
import android.graphics.Color
import android.graphics.Typeface
import android.text.SpannableStringBuilder
import android.text.Spanned
@ -38,6 +39,7 @@ class WebtoonTransitionHolder(
*/
private var textView = TextView(context).apply {
textSize = 17.5F
setTextColor(Color.WHITE)
wrapContent()
}

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.ui.reader.viewer.webtoon
import android.graphics.Color
import android.view.KeyEvent
import android.view.MotionEvent
import android.view.View
@ -64,6 +65,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
val subscriptions = CompositeSubscription()
init {
recycler.setBackgroundColor(Color.BLACK)
recycler.visibility = View.GONE // Don't let the recycler layout yet
recycler.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
recycler.itemAnimator = null

View File

@ -81,6 +81,7 @@
app:layout_constraintTop_toBottomOf="@id/viewer" />
<TextView
android:id="@+id/background_color_label"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/background_color"
@ -272,7 +273,7 @@
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="pager_prefs,scale_type,scale_type_text,
zoom_start_text,zoom_start,crop_borders,page_transitions"
zoom_start_text,zoom_start,crop_borders,page_transitions,background_color,background_color_label"
tools:visibility="visible" />
<androidx.constraintlayout.widget.Group