Always expose the front view a little bit even when backdrop is too tall

Also hide the filter sheet when expanding backdrop
Also also ignore the filter sheet when it comes to the layout of the backdrop
This commit is contained in:
Jay 2020-05-18 20:25:51 -04:00
parent 75d4d274f6
commit 5790380fcd
2 changed files with 9 additions and 6 deletions

View file

@ -757,6 +757,7 @@ class LibraryController(
activity?.appbar?.y = 0f
elevateFunc(false)
activity?.dropdown?.setImageResource(R.drawable.ic_arrow_drop_up_24dp)
filter_bottom_sheet?.sheetBehavior?.hide()
} else {
val notAtTop = recycler.canScrollVertically(-1)
if (notAtTop != elevate) elevateFunc(notAtTop)

View file

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.library.category
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -11,7 +12,6 @@ import com.mikepenz.fastadapter.listeners.OnBindViewHolderListenerImpl
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Category
import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.view.marginBottom
class CategoryRecyclerView @JvmOverloads constructor(
context: Context,
@ -71,13 +71,15 @@ class CategoryRecyclerView @JvmOverloads constructor(
}
override fun onMeasure(widthSpec: Int, heightSpec: Int) {
val recyclerView = (parent.parent as ViewGroup).findViewById<RecyclerView>(R.id.recycler)
val recyclerView = (parent.parent as ViewGroup).findViewById<View>(R.id.recycler)
val mainView = (parent.parent.parent.parent as ViewGroup)
val top = recyclerView.paddingTop
val bottom = recyclerView.marginBottom
val parent = recyclerView.measuredHeight - top - bottom
val heightS = if (parent > 0)
val parent = mainView.measuredHeight - top - 50.dpToPx
val heightS = if (parent > 0) {
MeasureSpec.makeMeasureSpec(parent, MeasureSpec.AT_MOST)
else heightSpec
} else {
heightSpec
}
super.onMeasure(widthSpec, heightS)
}
}