Closed jizhe7550 closed 4 years ago
@jizhe7550 For me it helped adding padding to the RecyclerView
android:clipToPadding="false"
android:paddingLeft="100dp"
android:paddingRight="100dp"
You need to have enough decoration or padding set for that to work. The sample app has a "Center with decoration" example
When I try to set the gravity as Center and set the startPadding as the mid of the phone screen in horizontal, I found I cannot snap the first and the last view in some phone, such as Pixel, and it seems the second item is nearest than the first item to centre, but I don't know what I can change if I want to snap the first view in this situation, plz help me, thank you.
the decoration code
recyclerView.addItemDecoration( LinearEdgeDecoration( startPadding = screenWidth() / 2