How move the first and the last element of RecyclerView to the center of the widget?
Example
I found next example: RecyclerView allow first/last items to be scrolled to the centre
But i can't describe this solution for my case. There is my code:
class CustomLinearLayoutManager(context: Context): LinearLayoutManager(context , LinearLayoutManager.HORIZONTAL, false) {
override fun getPaddingStart(): Int {
return width / 2
}
override fun getPaddingEnd(): Int {
return paddingStart
}
}
I feel that I have implemented incorrectly this solution
Please let me know how correctly to realize move outermost items to the center in horizontal RecyclerView widget.