Class ViewPagerAdapter

java.lang.Object
androidx.recyclerview.widget.RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter

public class ViewPagerAdapter extends RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
A RecyclerView.Adapter to show different views as pages.

It will be used internally to add dummy views inside the view pager.

  • Constructor Details

    • ViewPagerAdapter

      public ViewPagerAdapter(int pageCount)
      Constructor to initialize an object of this class.
      Parameters:
      pageCount - The item count for this adapter.
  • Method Details

    • onCreateViewHolder

      @NonNull public com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
      Specified by:
      onCreateViewHolder in class RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
    • onBindViewHolder

      public void onBindViewHolder(@NonNull com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder holder, int position)
      Specified by:
      onBindViewHolder in class RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>
    • getItemCount

      public int getItemCount()
      Specified by:
      getItemCount in class RecyclerView.Adapter<com.pranavpandey.android.dynamic.motion.adapter.ViewPagerAdapter.ViewHolder>