MarginPageTransformer

Adds space between pages via the ViewPager2.PageTransformer API.

Internally relies on setTranslationX and setTranslationY.

Note: translations on pages are not reset when this adapter is changed for another one, so you might want to set them manually to 0 when dynamically switching to another transformer, or when switching ViewPager2 orientation.

See also

Constructors

Link copied to clipboard
constructor(@Px marginPx: Int)

Functions

Link copied to clipboard
open fun transformPage(@NonNull page: View, position: Float)
Apply a property transformation to the given page.