Class FlexibleViewAdapter
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
FlexibleViewAdapters provide a binding from an app-specific data set to views that are displayed within a FlexibleView.
public abstract class FlexibleViewAdapter
- Inheritance
-
objectFlexibleViewAdapter
Methods
View SourceGetItemCount()
Returns the total number of items in the data set held by the adapter.
Declaration
public abstract int GetItemCount()
Returns
Type | Description |
---|---|
int |
GetItemViewType(int)
Return the view type of the item at position for the purposes of view recycling.
Declaration
public virtual int GetItemViewType(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | The position of the item within the adapter's data set. |
Returns
Type | Description |
---|---|
int |
NotifyDataSetChanged()
Notify any registered observers that the data set has changed.
Declaration
public void NotifyDataSetChanged()
NotifyItemChanged(int)
Notify any registered observers that the data set has changed. It indicates that any reflection of the data at position is out of date and should be updated.
Declaration
public void NotifyItemChanged(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | Position of the item that has changed |
NotifyItemInserted(int)
Notify any registered observers that the data set has been newly inserted. It indicates that any reflection of the data at position is out of date and should be updated.
Declaration
public void NotifyItemInserted(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | Position of the item that has been newly inserted |
NotifyItemMoved(int, int)
Notify any registered observers that the item reflected at fromPosition has been moved to toPosition.
Declaration
public void NotifyItemMoved(int fromPosition, int toPosition)
Parameters
Type | Name | Description |
---|---|---|
int | fromPosition | Previous position of the item |
int | toPosition | New position of the item. |
NotifyItemRangeChanged(int, int)
Notify any registered observers that the itemCount items starting at position positionStart have changed. An optional payload can be passed to each changed item.
Declaration
public void NotifyItemRangeChanged(int positionStart, int itemCount)
Parameters
Type | Name | Description |
---|---|---|
int | positionStart | Position of the first item that has changed |
int | itemCount | Number of items that have changed |
NotifyItemRangeInserted(int, int)
Notify any registered observers that the itemCount items starting at position positionStart have been newly inserted.
Declaration
public void NotifyItemRangeInserted(int positionStart, int itemCount)
Parameters
Type | Name | Description |
---|---|---|
int | positionStart | Position of the first item that was inserted |
int | itemCount | Number of items inserted |
NotifyItemRangeRemoved(int, int)
Notify any registered observers that the itemCount items previously located at positionStart have been removed from the data set.
Declaration
public void NotifyItemRangeRemoved(int positionStart, int itemCount)
Parameters
Type | Name | Description |
---|---|---|
int | positionStart | Previous position of the first item that was removed |
int | itemCount | Number of items removed from the data set |
NotifyItemRemoved(int)
Notify any registered observers that the item previously located at position has been removed from the data set.
Declaration
public void NotifyItemRemoved(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | Previous position of the first item that was removed |
OnAttachedToRecyclerView(FlexibleView)
Called by FlexibleView when it starts observing this FlexibleViewAdapter. Keep in mind that same adapter may be observed by multiple FlexibleView.
Declaration
public virtual void OnAttachedToRecyclerView(FlexibleView flexibleView)
Parameters
Type | Name | Description |
---|---|---|
FlexibleView | flexibleView | The FlexibleView instance which started observing this adapter. |
OnBindViewHolder(FlexibleViewViewHolder, int)
Called by FlexibleView to display the data at the specified position.
Declaration
public abstract void OnBindViewHolder(FlexibleViewViewHolder holder, int position)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | The FlexibleViewViewHolder which should be updated to represent the contents of the item at the given position in the data set. |
int | position | The position of the item within the adapter's data set. |
OnCreateViewHolder(int)
Called when FlexibleView needs a new FlexibleViewViewHolder of the given type to represent an item.
Declaration
public abstract FlexibleViewViewHolder OnCreateViewHolder(int viewType)
Parameters
Type | Name | Description |
---|---|---|
int | viewType | The view type of the new View |
Returns
Type | Description |
---|---|
FlexibleViewViewHolder |
OnDestroyViewHolder(FlexibleViewViewHolder)
Called when a FlexibleViewViewHolder is never used.
Declaration
public abstract void OnDestroyViewHolder(FlexibleViewViewHolder holder)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | The FlexibleViewViewHolder which need to be disposed |
OnDetachedFromRecyclerView(FlexibleView)
Called by FlexibleView when it stops observing this FlexibleViewAdapter.
Declaration
public virtual void OnDetachedFromRecyclerView(FlexibleView flexibleView)
Parameters
Type | Name | Description |
---|---|---|
FlexibleView | flexibleView | The FlexibleView instance which stopped observing this adapter. |
OnFocusChange(FlexibleView, int, int)
Called when FlexibleView focus changed.
Declaration
public virtual void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus)
Parameters
Type | Name | Description |
---|---|---|
FlexibleView | flexibleView | The FlexibleView into which the focus FlexibleViewViewHolder changed. |
int | previousFocus | The position of previous focus |
int | currentFocus | The position of current focus |
OnViewAttachedToWindow(FlexibleViewViewHolder)
Called when a view created by this adapter has been attached to a window. This can be used as a reasonable signal that the view is about to be seen by the user.
Declaration
public virtual void OnViewAttachedToWindow(FlexibleViewViewHolder holder)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | Holder of the view being attached. |
OnViewDetachedFromWindow(FlexibleViewViewHolder)
Called when a view created by this adapter has been detached from its window.
Declaration
public virtual void OnViewDetachedFromWindow(FlexibleViewViewHolder holder)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | Holder of the view being detached. |
OnViewRecycled(FlexibleViewViewHolder)
Called when a view created by this adapter has been recycled. If an item view has large or expensive data bound to it such as large bitmaps, this may be a good place to release those resources
Declaration
public virtual void OnViewRecycled(FlexibleViewViewHolder holder)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | The FlexibleViewViewHolder will be recycled. |