CompositePageTransformer


public final class CompositePageTransformer implements ViewPager2.PageTransformer


Allows for combining multiple PageTransformer objects.

Summary

Public constructors

Public methods

void

Adds a page transformer to the list.

void

Removes a page transformer from the list.

void
transformPage(@NonNull View page, float position)

Apply a property transformation to the given page.

Public constructors

CompositePageTransformer

Added in 1.0.0
public CompositePageTransformer()

Public methods

addTransformer

Added in 1.0.0
public void addTransformer(@NonNull ViewPager2.PageTransformer transformer)

Adds a page transformer to the list.

Transformers will be executed in the order that they were added.

removeTransformer

Added in 1.0.0
public void removeTransformer(@NonNull ViewPager2.PageTransformer transformer)

Removes a page transformer from the list.

transformPage

Added in 1.1.0
public void transformPage(@NonNull View page, float position)

Apply a property transformation to the given page.

Parameters
@NonNull View page

Apply the transformation to this page

float position

Position of page relative to the current front-and-center position of the pager. 0 is front and center. 1 is one full page position to the right, and -2 is two pages to the left. Minimum / maximum observed values depend on how many pages we keep attached, which depends on offscreenPageLimit.