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) {
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 = ""

View File

@ -446,7 +446,7 @@ LibraryListController(bundle: Bundle? = null) : LibraryController(bundle),
view?.rootWindowInsets?.systemWindowInsetTop ?: 0
) ?: 0f).roundToInt() + 30.dpToPx
(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

View File

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