PreCachingLayoutManager.kt 514 B

123456789101112131415161718192021
  1. package eu.kanade.tachiyomi.widget
  2. import android.content.Context
  3. import android.support.v7.widget.RecyclerView
  4. class PreCachingLayoutManager(context: Context) : NpaLinearLayoutManager(context) {
  5. companion object {
  6. const val DEFAULT_EXTRA_LAYOUT_SPACE = 600
  7. }
  8. var extraLayoutSpace = 0
  9. override fun getExtraLayoutSpace(state: RecyclerView.State): Int {
  10. if (extraLayoutSpace > 0) {
  11. return extraLayoutSpace
  12. }
  13. return DEFAULT_EXTRA_LAYOUT_SPACE
  14. }
  15. }