Class DynamicFragmentStateAdapter

All Implemented Interfaces:
StatefulAdapter
Direct Known Subclasses:
DynamicTutorialsAdapter

public abstract class DynamicFragmentStateAdapter extends FragmentStateAdapter
A FragmentStateAdapter to be used with the ViewPager2.

The main purpose of this adapter is to tint the recycler view edge glow according to the dynamic theme.

  • Constructor Details

  • Method Details

    • onAttachedToRecyclerView

      public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView)
      Overrides:
      onAttachedToRecyclerView in class FragmentStateAdapter
    • onSetupRecyclerView

      protected void onSetupRecyclerView()
      This method will be called to setup the recycler view.
    • tintRecyclerView

      public void tintRecyclerView()
      Tint the recycler view attached to this adapter.
    • getRecyclerView

      @Nullable public RecyclerView getRecyclerView()
      Returns the recycler view attached to this adapter.
      Returns:
      The recycler view attached to this adapter.
    • getContrastWithColor

      @ColorInt public int getContrastWithColor()
      Returns the contrast with color used by this adapter.
      Returns:
      The contrast with color used by this adapter.
    • setContrastWithColor

      public void setContrastWithColor(@ColorInt int contrastWithColor)
      Set the contrast with color used by this adapter.
      Parameters:
      contrastWithColor - The contrast with color to be set.