MarginPageTransformer
class MarginPageTransformer : ViewPager2.PageTransformer
kotlin.Any | |
↳ | androidx.viewpager2.widget.MarginPageTransformer |
Adds space between pages via the ViewPager2.PageTransformer
API.
Internally relies on View#setTranslationX
and View#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.
Summary
Public constructors | |
---|---|
Creates a |
Public methods | |
---|---|
Unit |
transformPage(@NonNull page: View, position: Float) |
Public constructors
<init>
MarginPageTransformer(@Px marginPx: Int)
Creates a MarginPageTransformer
.
Parameters | |
---|---|
marginPx |
Int: non-negative margin |