Class RecyclerView

Definition

Namespace:
Tizen.NUI.Components
Assembly:
Tizen.NUI.Components.dll
API Level:
9

A View that serves as a base class for views that contain a templated list of items.

C#
Copy
public abstract class RecyclerView : ScrollableBase, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider, ICollectionChangedNotifier
Inheritance
Derived
Implements

Constructors

View Source

RecyclerView()

Base Constructor

Declaration
C#
Copy
public RecyclerView()
API Level: 9
View Source

RecyclerView(ControlStyle)

Creates a new instance of a RecyclerView with style.

Declaration
C#
Copy
public RecyclerView(ControlStyle style)
Parameters
Type Name Description
ControlStyle style

A style applied to the newly created RecyclerView.

Fields

View Source

ItemsSourceProperty

ItemsSourceProperty

Declaration
C#
Copy
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type Description
BindableProperty
View Source

ItemTemplateProperty

ItemTemplateProperty

Declaration
C#
Copy
public static readonly BindableProperty ItemTemplateProperty
Field Value
Type Description
BindableProperty

Properties

View Source

CacheMax

Max size of RecycleCache. Default is 50.

Declaration
C#
Copy
protected int CacheMax { get; set; }
Property Value
Type Description
Int32
View Source

InternalItemsLayouter

Internal Items Layouter.

Declaration
C#
Copy
protected virtual ItemsLayouter InternalItemsLayouter { get; set; }
Property Value
Type Description
ItemsLayouter
View Source

ItemsSource

Item's source data.

Declaration
C#
Copy
public virtual IEnumerable ItemsSource { get; set; }
Property Value
Type Description
IEnumerable
API Level: 9
View Source

ItemTemplate

DataTemplate for items.

Declaration
C#
Copy
public virtual DataTemplate ItemTemplate { get; set; }
Property Value
Type Description
DataTemplate
API Level: 9
View Source

RecycleCache

RecycleCache of ViewItem.

Declaration
C#
Copy
protected List<RecyclerViewItem> RecycleCache { get; }
Property Value
Type Description
List<RecyclerViewItem>

Methods

View Source

AdjustTargetPositionOfScrollAnimation(Single)

Adjust scrolling position by own scrolling rules. Override this function when developer wants to change destination of flicking.(e.g. always snap to center of item)

Declaration
C#
Copy
protected override float AdjustTargetPositionOfScrollAnimation(float position)
Parameters
Type Name Description
Single position

Scroll position which is calculated by ScrollableBase.

Returns
Type Description
Single

Adjusted scroll destination

Overrides
View Source

ClearCache()

Clear all remaining caches.

Declaration
C#
Copy
protected virtual void ClearCache()
View Source

Dispose(DisposeTypes)

Dispose ItemsView and all children on it.

Declaration
C#
Copy
protected override void Dispose(DisposeTypes type)
Parameters
Type Name Description
DisposeTypes type

Dispose type.

Overrides
View Source

NotifyDataSetChanged()

Notify Dataset is Changed.

Declaration
C#
Copy
public virtual void NotifyDataSetChanged()
View Source

NotifyItemChanged(IItemSource, Int32)

Notify observable item is changed.

Declaration
C#
Copy
public virtual void NotifyItemChanged(IItemSource source, int startIndex)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startIndex

Changed item index.

View Source

NotifyItemInserted(IItemSource, Int32)

Notify observable item is inserted in dataset.

Declaration
C#
Copy
public virtual void NotifyItemInserted(IItemSource source, int startIndex)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startIndex

Inserted item index.

View Source

NotifyItemMoved(IItemSource, Int32, Int32)

Notify observable item is moved from fromPosition to ToPosition.

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

Dataset source.

Int32 fromPosition

Previous item position.

Int32 toPosition

Moved item position.

View Source

NotifyItemRangeChanged(IItemSource, Int32, Int32)

Notify range of observable items from start to end are changed.

Declaration
C#
Copy
public virtual void NotifyItemRangeChanged(IItemSource source, int startRange, int endRange)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startRange

Start index of changed items range.

Int32 endRange

End index of changed items range.

View Source

NotifyItemRangeInserted(IItemSource, Int32, Int32)

Notify count range of observable count items are inserted in startIndex.

Declaration
C#
Copy
public virtual void NotifyItemRangeInserted(IItemSource source, int startIndex, int count)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startIndex

Start index of inserted items range.

Int32 count

The number of inserted items.

View Source

NotifyItemRangeMoved(IItemSource, Int32, Int32, Int32)

Notify the observable item is moved from fromPosition to ToPosition.

Declaration
C#
Copy
public virtual void NotifyItemRangeMoved(IItemSource source, int fromPosition, int toPosition, int count)
Parameters
Type Name Description
IItemSource source
Int32 fromPosition
Int32 toPosition
Int32 count
View Source

NotifyItemRangeRemoved(IItemSource, Int32, Int32)

Notify the count range of observable items from the startIndex are removed.

Declaration
C#
Copy
public virtual void NotifyItemRangeRemoved(IItemSource source, int startIndex, int count)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startIndex

Start index of removed items range.

Int32 count

The number of removed items

View Source

NotifyItemRemoved(IItemSource, Int32)

Notify the observable item in startIndex is removed.

Declaration
C#
Copy
public virtual void NotifyItemRemoved(IItemSource source, int startIndex)
Parameters
Type Name Description
IItemSource source

Dataset source.

Int32 startIndex

Index of removed item.

View Source

OnRelayout(Vector2, RelayoutContainer)

Called after the size negotiation has been finished for this control.
The control is expected to assign this given size to itself or its children.
Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).

Declaration
C#
Copy
public override void OnRelayout(Vector2 size, RelayoutContainer container)
Parameters
Type Name Description
Vector2 size

The allocated size.

RelayoutContainer container

The control should add views to this container that it is not able to allocate a size for.

Overrides
API Level: 9
View Source

OnScrolling(Object, ScrollEventArgs)

On scroll event callback.

Declaration
C#
Copy
protected virtual void OnScrolling(object source, ScrollEventArgs args)
Parameters
Type Name Description
Object source
ScrollEventArgs args
API Level: 9
View Source

PopRecycleCache(DataTemplate)

Pop the item from the recycle cache.

Declaration
C#
Copy
protected virtual RecyclerViewItem PopRecycleCache(DataTemplate Template)
Parameters
Type Name Description
DataTemplate Template

Template of wanted item.

Returns
Type Description
RecyclerViewItem
View Source

PushRecycleCache(RecyclerViewItem)

Push the item into the recycle cache. this item will be reused in view update.

Declaration
C#
Copy
protected virtual bool PushRecycleCache(RecyclerViewItem item)
Parameters
Type Name Description
RecyclerViewItem item

Target item to push into recycle cache.

Returns
Type Description
Boolean
View Source

RealizeItem(Int32)

Realize indexed item.

Declaration
C#
Copy
protected virtual RecyclerViewItem RealizeItem(int index)
Parameters
Type Name Description
Int32 index

Index position of realizing item

Returns
Type Description
RecyclerViewItem
View Source

UnrealizeItem(RecyclerViewItem, Boolean)

Unrealize indexed item.

Declaration
C#
Copy
protected virtual void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
Parameters
Type Name Description
RecyclerViewItem item

Target item for unrealizing

Boolean recycle

Allow recycle. default is true

Implements

Extension Methods