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.

C#
Copy
public abstract class FlexibleViewAdapter : object
Inheritance
FlexibleViewAdapter

Methods

View Source

GetItemCount()

Returns the total number of items in the data set held by the adapter.

Declaration
C#
Copy
public abstract int GetItemCount()
Returns
Type Description
Int32
View Source

GetItemViewType(Int32)

Return the view type of the item at position for the purposes of view recycling.

Declaration
C#
Copy
public virtual int GetItemViewType(int position)
Parameters
Type Name Description
Int32 position

The position of the item within the adapter's data set.

Returns
Type Description
Int32
View Source

NotifyDataSetChanged()

Notify any registered observers that the data set has changed.

Declaration
C#
Copy
public void NotifyDataSetChanged()
View Source

NotifyItemChanged(Int32)

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
C#
Copy
public void NotifyItemChanged(int position)
Parameters
Type Name Description
Int32 position

Position of the item that has changed

View Source

NotifyItemInserted(Int32)

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
C#
Copy
public void NotifyItemInserted(int position)
Parameters
Type Name Description
Int32 position

Position of the item that has been newly inserted

View Source

NotifyItemMoved(Int32, Int32)

Notify any registered observers that the item reflected at fromPosition has been moved to toPosition.

Declaration
C#
Copy
public void NotifyItemMoved(int fromPosition, int toPosition)
Parameters
Type Name Description
Int32 fromPosition

Previous position of the item

Int32 toPosition

New position of the item.

View Source

NotifyItemRangeChanged(Int32, Int32)

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
C#
Copy
public void NotifyItemRangeChanged(int positionStart, int itemCount)
Parameters
Type Name Description
Int32 positionStart

Position of the first item that has changed

Int32 itemCount

Number of items that have changed

View Source

NotifyItemRangeInserted(Int32, Int32)

Notify any registered observers that the itemCount items starting at position positionStart have been newly inserted.

Declaration
C#
Copy
public void NotifyItemRangeInserted(int positionStart, int itemCount)
Parameters
Type Name Description
Int32 positionStart

Position of the first item that was inserted

Int32 itemCount

Number of items inserted

View Source

NotifyItemRangeRemoved(Int32, Int32)

Notify any registered observers that the itemCount items previously located at positionStart have been removed from the data set.

Declaration
C#
Copy
public void NotifyItemRangeRemoved(int positionStart, int itemCount)
Parameters
Type Name Description
Int32 positionStart

Previous position of the first item that was removed

Int32 itemCount

Number of items removed from the data set

View Source

NotifyItemRemoved(Int32)

Notify any registered observers that the item previously located at position has been removed from the data set.

Declaration
C#
Copy
public void NotifyItemRemoved(int position)
Parameters
Type Name Description
Int32 position

Previous position of the first item that was removed

View Source

OnAttachedToRecyclerView(FlexibleView)

Called by FlexibleView when it starts observing this FlexibleViewAdapter. Keep in mind that same adapter may be observed by multiple FlexibleView.

Declaration
C#
Copy
public virtual void OnAttachedToRecyclerView(FlexibleView flexibleView)
Parameters
Type Name Description
FlexibleView flexibleView

The FlexibleView instance which started observing this adapter.

View Source

OnBindViewHolder(FlexibleViewViewHolder, Int32)

Called by FlexibleView to display the data at the specified position.

Declaration
C#
Copy
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.

Int32 position

The position of the item within the adapter's data set.

View Source

OnCreateViewHolder(Int32)

Called when FlexibleView needs a new FlexibleViewViewHolder of the given type to represent an item.

Declaration
C#
Copy
public abstract FlexibleViewViewHolder OnCreateViewHolder(int viewType)
Parameters
Type Name Description
Int32 viewType

The view type of the new View

Returns
Type Description
FlexibleViewViewHolder
View Source

OnDestroyViewHolder(FlexibleViewViewHolder)

Called when a FlexibleViewViewHolder is never used.

Declaration
C#
Copy
public abstract void OnDestroyViewHolder(FlexibleViewViewHolder holder)
Parameters
Type Name Description
FlexibleViewViewHolder holder

The FlexibleViewViewHolder which need to be disposed

View Source

OnDetachedFromRecyclerView(FlexibleView)

Called by FlexibleView when it stops observing this FlexibleViewAdapter.

Declaration
C#
Copy
public virtual void OnDetachedFromRecyclerView(FlexibleView flexibleView)
Parameters
Type Name Description
FlexibleView flexibleView

The FlexibleView instance which stopped observing this adapter.

View Source

OnFocusChange(FlexibleView, Int32, Int32)

Called when FlexibleView focus changed.

Declaration
C#
Copy
public virtual void OnFocusChange(FlexibleView flexibleView, int previousFocus, int currentFocus)
Parameters
Type Name Description
FlexibleView flexibleView

The FlexibleView into which the focus FlexibleViewViewHolder changed.

Int32 previousFocus

The position of previous focus

Int32 currentFocus

The position of current focus

View Source

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
C#
Copy
public virtual void OnViewAttachedToWindow(FlexibleViewViewHolder holder)
Parameters
Type Name Description
FlexibleViewViewHolder holder

Holder of the view being attached.

View Source

OnViewDetachedFromWindow(FlexibleViewViewHolder)

Called when a view created by this adapter has been detached from its window.

Declaration
C#
Copy
public virtual void OnViewDetachedFromWindow(FlexibleViewViewHolder holder)
Parameters
Type Name Description
FlexibleViewViewHolder holder

Holder of the view being detached.

View Source

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
C#
Copy
public virtual void OnViewRecycled(FlexibleViewViewHolder holder)
Parameters
Type Name Description
FlexibleViewViewHolder holder

The FlexibleViewViewHolder will be recycled.

Extension Methods