INNER CODE UNIT · Kotlin
cacheSizes
mikepenz/FastAdapter · fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt:667
protected fun cacheSizes() {
adapterSizes.clear()
var size = 0
for (adapter in adapters) {
if (adapter.adapterItemCount > 0) {
adapterSizes.append(size, adapter)
size += adapter.adapterItemCount
}
}
//we also have to add this for the first adapter otherwise the floorIndex method will return the wrong value
if (size == 0 && adapters.size > 0) {
adapterSizes.append(0, adapters[0])
}
globalSize = size
}