Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: David Luhmer <david-dev@live.de>
  • Loading branch information
David-Development committed Oct 16, 2024
1 parent 73b9982 commit cf6c3c7
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ import androidx.recyclerview.widget.RecyclerView
import kotlin.math.roundToInt

class LazyLoadingLinearLayoutManager(
context: Context?,
@RecyclerView.Orientation orientation: Int,
reverseLayout: Boolean
context: Context?,
@RecyclerView.Orientation orientation: Int,
reverseLayout: Boolean,
) : LinearLayoutManager(context, orientation, reverseLayout) {
var totalItemCount: Int = 0

var totalItemCount: Int = 0
override fun computeVerticalScrollRange(state: RecyclerView.State): Int {
if (state.itemCount == 0) {
return 0
}

override fun computeVerticalScrollRange(state: RecyclerView.State): Int {
if (state.itemCount == 0) {
return 0
}

return (super.computeVerticalScrollRange(state) / state.itemCount.toFloat() * totalItemCount).roundToInt()
}
return (super.computeVerticalScrollRange(state) / state.itemCount.toFloat() * totalItemCount).roundToInt()
}
}

0 comments on commit cf6c3c7

Please sign in to comment.