Class DynamicMotionLayout

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent, NestedScrollingParent, NestedScrollingParent2, NestedScrollingParent3

public class DynamicMotionLayout extends MotionLayout
A MotionLayout to perform operations according to the ViewPager2 page offset.
  • Constructor Details

    • DynamicMotionLayout

      public DynamicMotionLayout(Context context)
    • DynamicMotionLayout

      public DynamicMotionLayout(Context context, AttributeSet attrs)
    • DynamicMotionLayout

      public DynamicMotionLayout(Context context, AttributeSet attrs, int defStyleAttr)
  • Method Details

    • loadFromAttributes

      public void loadFromAttributes(@Nullable AttributeSet attrs)
      Load values from the supplied attribute set.
      Parameters:
      attrs - The supplied attribute set to load the values.
    • initialize

      public void initialize()
      Initialize this view by setting the default values.
    • setPageCount

      public void setPageCount(int pageCount, @Nullable ViewPager2.OnPageChangeCallback onPageChangeCallback)
      Set the page count for the view pager.
      Parameters:
      pageCount - The page count to be set.
      onPageChangeCallback - The callback to receive page change events.
    • getPageCount

      public int getPageCount()
      Get the page count for the view pager.
      Returns:
      The page count for the view pager.
    • getViewPager

      @Nullable public ViewPager2 getViewPager()
      Get the view pager used by this view.
      Returns:
      The view pager used by this view.