Fix crash with gif covers in manga details + more pading for category headers

This commit is contained in:
Jay 2020-04-03 15:17:21 -04:00
parent c13b6cbe91
commit 19c1192233
3 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ class LibraryHeaderItem(private val categoryF: (Int) -> Category, val catId: Int
fun bind(category: Category) { fun bind(category: Category) {
sectionText.updateLayoutParams<ConstraintLayout.LayoutParams> { sectionText.updateLayoutParams<ConstraintLayout.LayoutParams> {
topMargin = (if (category.isFirst == true) 2 else 32).dpToPx topMargin = (if (category.isFirst == true) 2 else 44).dpToPx
} }
if (category.isFirst == true && category.isLast == true) sectionText.text = "" if (category.isFirst == true && category.isLast == true) sectionText.text = ""

View File

@ -446,7 +446,7 @@ LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
view?.rootWindowInsets?.systemWindowInsetTop ?: 0 view?.rootWindowInsets?.systemWindowInsetTop ?: 0
) ?: 0f).roundToInt() + 30.dpToPx ) ?: 0f).roundToInt() + 30.dpToPx
(recycler.layoutManager as LinearLayoutManager).scrollToPositionWithOffset( (recycler.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(
headerPosition, (if (headerPosition == 0) 0 else (-28).dpToPx) + appbarOffset headerPosition, (if (headerPosition == 0) 0 else (-40).dpToPx) + appbarOffset
) )
/*val headerItem = adapter.getItem(headerPosition) as? LibraryHeaderItem /*val headerItem = adapter.getItem(headerPosition) as? LibraryHeaderItem

View File

@ -338,8 +338,8 @@ class MangaDetailsController : BaseController,
transition: Transition<in Drawable>? transition: Transition<in Drawable>?
) { ) {
coverDrawable = resource coverDrawable = resource
Palette.from( val bitmapCover = resource as? BitmapDrawable ?: return
(resource as BitmapDrawable).bitmap).generate { Palette.from(bitmapCover.bitmap).generate {
if (recycler == null) return@generate if (recycler == null) return@generate
val currentNightMode = val currentNightMode =
recycler.resources!!.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK recycler.resources!!.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK