Class DynamicSpinnerImageAdapter
java.lang.Object
android.widget.BaseAdapter
android.widget.ArrayAdapter<DynamicMenu>
com.pranavpandey.android.dynamic.support.adapter.DynamicSpinnerImageAdapter
- All Implemented Interfaces:
Adapter
,Filterable
,ListAdapter
,SpinnerAdapter
,ThemedSpinnerAdapter
A simple array adapter for the
Spinner
which can display an icon
and text together as an item. Use the constructor to pass the layout resource, image and the
text id with a list of items according to the requirements.-
Field Summary
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
-
Constructor Summary
ConstructorDescriptionDynamicSpinnerImageAdapter
(Context context, int resource, int imageViewResourceId, int textViewResourceId, List<DynamicMenu> data) Constructor to initialize an object of this class.DynamicSpinnerImageAdapter
(Context context, int resource, int imageViewResourceId, int textViewResourceId, List<DynamicMenu> data, View parent) Constructor to initialize an object of this class. -
Method Summary
Methods inherited from class android.widget.ArrayAdapter
add, addAll, addAll, clear, createFromResource, getAutofillOptions, getContext, getCount, getDropDownViewTheme, getFilter, getItem, getItemId, getPosition, insert, notifyDataSetChanged, remove, setDropDownViewResource, setDropDownViewTheme, setNotifyOnChange, sort
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface android.widget.Adapter
getItemViewType, getViewTypeCount, hasStableIds, isEmpty, registerDataSetObserver, unregisterDataSetObserver
-
Constructor Details
-
DynamicSpinnerImageAdapter
public DynamicSpinnerImageAdapter(@NonNull Context context, int resource, int imageViewResourceId, int textViewResourceId, @NonNull List<DynamicMenu> data) Constructor to initialize an object of this class.- Parameters:
context
- The context to be used.resource
- The layout resource to be used.imageViewResourceId
- The resource id for the image view.textViewResourceId
- The resource id for the text view.data
- The data to be handled by this adapter.
-
DynamicSpinnerImageAdapter
public DynamicSpinnerImageAdapter(@NonNull Context context, int resource, int imageViewResourceId, int textViewResourceId, @NonNull List<DynamicMenu> data, @Nullable View parent) Constructor to initialize an object of this class.- Parameters:
context
- The context to be used.resource
- The layout resource to be used.imageViewResourceId
- The resource id for the image view.textViewResourceId
- The resource id for the text view.data
- The data to be handled by this adapter.parent
- The view handling this adapter.
-
-
Method Details
-
getView
- Specified by:
getView
in interfaceAdapter
- Overrides:
getView
in classArrayAdapter<DynamicMenu>
-
getDropDownView
@NonNull public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) - Specified by:
getDropDownView
in interfaceSpinnerAdapter
- Overrides:
getDropDownView
in classArrayAdapter<DynamicMenu>
-