Class ProfileAttrsAdapter
- java.lang.Object
-
- androidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
-
- com.cheetahdigital.challenges.ui.responses.profile.attribute.ProfileAttrsAdapter
-
public class ProfileAttrsAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
Class that handles Profile Attribute lists used inUpdateAttributeFragment
-
-
Field Summary
Fields Modifier and Type Field Description static int
TYPE_BOOLEAN
static int
TYPE_DATE
static int
TYPE_EMAIL
static int
TYPE_GENDER
static int
TYPE_NUMBER
static int
TYPE_PHONE
static int
TYPE_STRING
-
Constructor Summary
Constructors Constructor Description ProfileAttrsAdapter(java.util.List<ProfileAttribute> mAttributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
completeAnswer()
Check if answers are completejava.util.List<ProfileAttribute>
getAttributes()
Returns list of updated attributesint
getItemCount()
int
getItemViewType(int position)
void
onBindViewHolder(BaseAttributeViewHolder holder, int position)
BaseAttributeViewHolder
onCreateViewHolder(android.view.ViewGroup parent, int viewType)
-
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, getItemId, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
-
-
-
-
Field Detail
-
TYPE_STRING
public static final int TYPE_STRING
- See Also:
- Constant Field Values
-
TYPE_BOOLEAN
public static final int TYPE_BOOLEAN
- See Also:
- Constant Field Values
-
TYPE_NUMBER
public static final int TYPE_NUMBER
- See Also:
- Constant Field Values
-
TYPE_EMAIL
public static final int TYPE_EMAIL
- See Also:
- Constant Field Values
-
TYPE_PHONE
public static final int TYPE_PHONE
- See Also:
- Constant Field Values
-
TYPE_DATE
public static final int TYPE_DATE
- See Also:
- Constant Field Values
-
TYPE_GENDER
public static final int TYPE_GENDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProfileAttrsAdapter
public ProfileAttrsAdapter(java.util.List<ProfileAttribute> mAttributes)
-
-
Method Detail
-
getItemViewType
public int getItemViewType(int position)
- Overrides:
getItemViewType
in classandroidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
-
onCreateViewHolder
@NonNull public BaseAttributeViewHolder onCreateViewHolder(@NonNull android.view.ViewGroup parent, int viewType)
- Specified by:
onCreateViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
-
onBindViewHolder
public void onBindViewHolder(@NonNull BaseAttributeViewHolder holder, int position)
- Specified by:
onBindViewHolder
in classandroidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
-
getItemCount
public int getItemCount()
- Specified by:
getItemCount
in classandroidx.recyclerview.widget.RecyclerView.Adapter<BaseAttributeViewHolder>
-
completeAnswer
public boolean completeAnswer()
Check if answers are complete- Returns:
- true if all required questions have answers, false otherwise
-
getAttributes
public java.util.List<ProfileAttribute> getAttributes()
Returns list of updated attributes- Returns:
- list of
ProfileAttribute
-
-