public abstract class

SectionedRecyclerViewAdapter

extends RecyclerView.Adapter<VH extends RecyclerView.ViewHolder>
java.lang.Object
   ↳ androidx.recyclerview.widget.RecyclerView.Adapter<VH extends androidx.recyclerview.widget.RecyclerView.ViewHolder>
     ↳ com.sap.cloud.mobile.fiori.formcell.SectionedRecyclerViewAdapter

Class Overview

Filter activity will be displayed using a Recycler View. Divide the recycler view into Sections and Rows within Sections. Maintain a list holding information on what type of view will be used at a particular row in a section. Application developer needs to implement the abstract functions of this class providing the information about the views at a row in a section

Summary

Nested Classes
class SectionedRecyclerViewAdapter.FormCellHolder View holder for FormCell  
class SectionedRecyclerViewAdapter.SectionHeaderFooter  
Public Constructors
SectionedRecyclerViewAdapter()
Public Methods
final int getItemCount()
Return number of items in the RecyclerView
abstract int getItemCountForSection(int section)
Returns the number of views in a section of the RecyclerView
final int getItemViewType(int position)
Return the itemType for the position.
abstract int getItemViewType(int section, int row)
Return the enum for the control at the given row in the section
abstract int getNumberOfSections()
Returns the number of sections in the view
int getSeparatorViewType()
Returns the number of sections in the view
abstract void onBindCellHolder(SectionedRecyclerViewAdapter.FormCellHolder cellHolder, int section, int row)
Bind the data values to the control at the row in a section.
void onBindViewHolder(SectionedRecyclerViewAdapter.FormCellHolder holder, int position)
Bind the view at the given position with the corresponding class holder
SectionedRecyclerViewAdapter.FormCellHolder onCreateViewHolder(ViewGroup parent, int viewType)
void registerCellCreator(int code, FormCellCreator cellCreator)
void setFooterEnabled(boolean footerEnabled)
void setHeaderEnabled(boolean headerEnabled)
void setSeparatorEnabled(boolean separatorEnabled)
Protected Methods
boolean hasFooter(int section)
Does the given section has the header
boolean hasHeader(int section)
Does the given section has the header
void onBindFooter(SectionedRecyclerViewAdapter.FormCellHolder holder, int section)
Bind the captions on the separator
void onBindHeader(SectionedRecyclerViewAdapter.FormCellHolder holder, int section)
Bind the captions on the separator
void onBindSeparatorViewHolder(SectionedRecyclerViewAdapter.FormCellHolder holder, int section)
Bind the captions on the separator
[Expand]
Inherited Methods
From class androidx.recyclerview.widget.RecyclerView.Adapter
From class java.lang.Object

Public Constructors

public SectionedRecyclerViewAdapter ()

Public Methods

public final int getItemCount ()

Return number of items in the RecyclerView

Returns
  • int item count for RecyclerView

public abstract int getItemCountForSection (int section)

Returns the number of views in a section of the RecyclerView

Parameters
section section number for the view
Returns
  • int number of views

public final int getItemViewType (int position)

Return the itemType for the position.

Parameters
position position of the view in the Recycler View
Returns
  • int enum value for the control

public abstract int getItemViewType (int section, int row)

Return the enum for the control at the given row in the section

Parameters
section section number for the View
row row number for the view
Returns
  • int type of control

public abstract int getNumberOfSections ()

Returns the number of sections in the view

Returns
  • int number of sections

public int getSeparatorViewType ()

Returns the number of sections in the view

Returns
  • int number of sections

public abstract void onBindCellHolder (SectionedRecyclerViewAdapter.FormCellHolder cellHolder, int section, int row)

Bind the data values to the control at the row in a section. Application developer will have to cast the base control object to the specific control type.

Parameters
cellHolder object of the FormCell at this position
section section number of the view
row row number of the view

public void onBindViewHolder (SectionedRecyclerViewAdapter.FormCellHolder holder, int position)

Bind the view at the given position with the corresponding class holder

Parameters
holder View holder
position position of the view in the Recycler View

public SectionedRecyclerViewAdapter.FormCellHolder onCreateViewHolder (ViewGroup parent, int viewType)

public void registerCellCreator (int code, FormCellCreator cellCreator)

public void setFooterEnabled (boolean footerEnabled)

public void setHeaderEnabled (boolean headerEnabled)

public void setSeparatorEnabled (boolean separatorEnabled)

Protected Methods

protected boolean hasFooter (int section)

Does the given section has the header

Parameters
section section number
Returns
  • boolean

protected boolean hasHeader (int section)

Does the given section has the header

Parameters
section section number
Returns
  • boolean

protected void onBindFooter (SectionedRecyclerViewAdapter.FormCellHolder holder, int section)

Bind the captions on the separator

Parameters
holder MultiSelectViewHolder
section int

protected void onBindHeader (SectionedRecyclerViewAdapter.FormCellHolder holder, int section)

Bind the captions on the separator

Parameters
holder MultiSelectViewHolder
section int

protected void onBindSeparatorViewHolder (SectionedRecyclerViewAdapter.FormCellHolder holder, int section)

Bind the captions on the separator

Parameters
holder MultiSelectViewHolder
section int