public abstract class

GenericListPickerFormCellActivity

extends AppCompatActivity
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ androidx.core.app.ComponentActivity
             ↳ androidx.activity.ComponentActivity
               ↳ androidx.fragment.app.FragmentActivity
                 ↳ androidx.appcompat.app.AppCompatActivity
                   ↳ com.sap.cloud.mobile.fiori.formcell.GenericListPickerFormCellActivity<V extends android.view.View, T extends java.io.Serializable>

Class Overview

Base class for the activity which will display the list of items in a Recycler View for GenericListPickerFormCell. The adapter for RecyclerView will of class GenericListPickerFormCellActivity. On pressing the navigate up button on the toolbar it goes back to the activity from which it was called. It gets the list of index of currently selected items through getSelections() method and passes this list to the parent activity.It passes the following parameters with the intent:

  • Intent Source with key "Intent Source" and value "List Picker Activity"
  • List List of index of selected items with key "SelectedIndex"
  • The parent activity needs to receive this intent and update the data source with the new selected values.

    Summary

    Constants
    String ACTION_ITEMS_SELECTED
    [Expand]
    Inherited Constants
    From class android.app.Activity
    From class android.content.Context
    From interface android.content.ComponentCallbacks2
    [Expand]
    Inherited Fields
    From class android.app.Activity
    Public Constructors
    GenericListPickerFormCellActivity()
    Public Methods
    boolean allowMultipleSelection()
    Is the single selection feature on on this activity?
    void finish()
    List<T> getSelections()
    Returns the list of index of selected items
    boolean isSingleSelect()
    Is the single selection feature on on this activity?
    boolean onOptionsItemSelected(MenuItem item)
    Toolbar of this activity contains navigate up arrow clicking which will navigate back to the parent activity.Parent activity will be called with an intent.
    void setTitle(String title)
    Set the title of the Activity
    Protected Methods
    abstract T getId(int pos)
    Given the position get the Id of the element.
    int getItemBottomMargin()
    Get the bottom margin to be applied to the item view while putting it into Picker Cell
    abstract int getItemCount()
    How many types of View to be inflated in the list filter
    int getItemTopMargin()
    Get the top margin to be applied to the item view while putting it into Picker Cell
    abstract int getItemViewType(int position)
    Type of View to be inflated in the list filter at index represented by position
    int getSelectorGravity()
    Get the gravity of the selector drawable
    void notifyDataSetChanged()
    void onBindPosition(int pos)
    A callback mechanism to notify the user that view at given position was just loaded.
    abstract void onBindView(V view, T id)
    Bind the view for the data at position represented by position
    void onCreate(Bundle savedInstanceState)
    abstract V onCreateView(int viewType, Context context)
    Create the view of type represented by viewType and context
    void onSaveInstanceState(Bundle outState)
    void onSelectionChanged(T id, boolean isSelected)
    void reset()
    void restoreData(Bundle bundle)
    GenericListPickerFormCellActivity needs to restore the user defined data received through the intent.
    Bundle saveData()
    ListForm cell has two properties:
    • Utilizes GenericListPickerFormCellActivity to present list of items to choose from
    • Allows user to perform data binding and XMl binding by providing data into the declaring XML file.
    void setListFormCellItemProvider(Adapter adapter)
    Sets the adapter for the RecyclerView
    void setSelections(List<T> selections)
    [Expand]
    Inherited Methods
    From class androidx.appcompat.app.AppCompatActivity
    From class androidx.fragment.app.FragmentActivity
    From class androidx.activity.ComponentActivity
    From class androidx.core.app.ComponentActivity
    From class android.app.Activity
    From class android.view.ContextThemeWrapper
    From class android.content.ContextWrapper
    From class android.content.Context
    From class java.lang.Object
    From interface android.content.ComponentCallbacks
    From interface android.content.ComponentCallbacks2
    From interface android.view.KeyEvent.Callback
    From interface android.view.LayoutInflater.Factory
    From interface android.view.LayoutInflater.Factory2
    From interface android.view.View.OnCreateContextMenuListener
    From interface android.view.Window.Callback
    From interface androidx.activity.OnBackPressedDispatcherOwner
    From interface androidx.activity.contextaware.ContextAware
    From interface androidx.activity.result.ActivityResultCaller
    From interface androidx.activity.result.ActivityResultRegistryOwner
    From interface androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider
    From interface androidx.appcompat.app.AppCompatCallback
    From interface androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
    From interface androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator
    From interface androidx.core.app.TaskStackBuilder.SupportParentable
    From interface androidx.core.view.KeyEventDispatcher.Component
    From interface androidx.lifecycle.HasDefaultViewModelProviderFactory
    From interface androidx.lifecycle.LifecycleOwner
    From interface androidx.lifecycle.ViewModelStoreOwner
    From interface androidx.savedstate.SavedStateRegistryOwner

    Constants

    public static final String ACTION_ITEMS_SELECTED

    Constant Value: "fiori.list_picker_filter.items_selected"

    Public Constructors

    public GenericListPickerFormCellActivity ()

    Public Methods

    public boolean allowMultipleSelection ()

    Is the single selection feature on on this activity?

    Returns
    • boolean

    public void finish ()

    public List<T> getSelections ()

    Returns the list of index of selected items

    Returns
    • List list of index of selected items

    public boolean isSingleSelect ()

    Is the single selection feature on on this activity?

    Returns
    • boolean

    public boolean onOptionsItemSelected (MenuItem item)

    Toolbar of this activity contains navigate up arrow clicking which will navigate back to the parent activity.Parent activity will be called with an intent.

    Returns
    • Boolean if navigation to the parent activity was successful

    public void setTitle (String title)

    Set the title of the Activity

    Parameters
    title Title as String

    Protected Methods

    protected abstract T getId (int pos)

    Given the position get the Id of the element.

    Parameters
    pos position

    protected int getItemBottomMargin ()

    Get the bottom margin to be applied to the item view while putting it into Picker Cell

    Returns
    • bottom margin

    protected abstract int getItemCount ()

    How many types of View to be inflated in the list filter

    Returns
    • int

    protected int getItemTopMargin ()

    Get the top margin to be applied to the item view while putting it into Picker Cell

    Returns
    • top margin

    protected abstract int getItemViewType (int position)

    Type of View to be inflated in the list filter at index represented by position

    Parameters
    position int
    Returns
    • int

    protected int getSelectorGravity ()

    Get the gravity of the selector drawable

    protected void notifyDataSetChanged ()

    protected void onBindPosition (int pos)

    A callback mechanism to notify the user that view at given position was just loaded.

    Parameters
    pos int

    protected abstract void onBindView (V view, T id)

    Bind the view for the data at position represented by position

    Parameters
    view View
    id int

    protected void onCreate (Bundle savedInstanceState)

    protected abstract V onCreateView (int viewType, Context context)

    Create the view of type represented by viewType and context

    Parameters
    viewType int
    context Context
    Returns
    • View

    protected void onSaveInstanceState (Bundle outState)

    protected void onSelectionChanged (T id, boolean isSelected)

    protected void reset ()

    protected void restoreData (Bundle bundle)

    GenericListPickerFormCellActivity needs to restore the user defined data received through the intent.

    Parameters
    bundle Bundle
    See Also

    protected Bundle saveData ()

    ListForm cell has two properties:

    • Utilizes GenericListPickerFormCellActivity to present list of items to choose from
    • Allows user to perform data binding and XMl binding by providing data into the declaring XML file.
    In order to present the user defined data to the GenericListPickerFormCellActivity, GenericListPickerFormCell has to store the data into intent. In order to store the data, GenericListPickerFormCell calls this method.

    protected void setListFormCellItemProvider (Adapter adapter)

    Sets the adapter for the RecyclerView

    protected void setSelections (List<T> selections)