mihon/app/src/main/java/eu/kanade/tachiyomi/widget/PreCachingLayoutManager.kt
arkon 78689e7443
Migrate to AndroidX (#2424)
* Migrate to AndroidX (automatic conversion by Android Studio)

* AndroidX dependency code updates

* Fix source preference reparenting

* fixes the androidx prefererences icon spacing issue

(cherry picked from commit b76a15d960ec2cdf771be16377db0348b66b3179)

* Fix source preference screen heading size/list padding

Co-authored-by: Carlos <cargo8005@gmail.com>
2020-01-05 11:29:27 -05:00

26 lines
626 B
Kotlin

package eu.kanade.tachiyomi.widget
import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
class PreCachingLayoutManager(context: Context) : LinearLayoutManager(context) {
init {
isItemPrefetchEnabled = false
}
companion object {
const val DEFAULT_EXTRA_LAYOUT_SPACE = 600
}
var extraLayoutSpace = 0
override fun getExtraLayoutSpace(state: RecyclerView.State): Int {
if (extraLayoutSpace > 0) {
return extraLayoutSpace
}
return DEFAULT_EXTRA_LAYOUT_SPACE
}
}