I need to set the child view as center of the ViewPager and also I would like to show some part of the next and previous views to the current view sides(like current screen
You can use padding for viewPager and set clipToPadding false
Java
viewPager.setClipToPadding(false); viewPager.setPadding(50, 0, 50, 0);
Kotlin
viewPager.clipToPadding = false viewPager.setPadding(50, 0, 50, 0)