Class RecyclerView
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
A View that serves as a base class for views that contain a templated list of items.
public abstract class RecyclerView : ScrollableBase, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider, ICollectionChangedNotifier
- Inheritance
-
objectRecyclerView
- Derived
- Implements
-
System.IDisposable
Constructors
View SourceRecyclerView()
Base Constructor
Declaration
public RecyclerView()
RecyclerView(ControlStyle)
Creates a new instance of a RecyclerView with style.
Declaration
public RecyclerView(ControlStyle style)
Parameters
| Type | Name | Description |
|---|---|---|
| ControlStyle | style | A style applied to the newly created RecyclerView. |
Fields
View SourceItemsSourceProperty
ItemsSourceProperty
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
ItemTemplateProperty
ItemTemplateProperty
Declaration
public static readonly BindableProperty ItemTemplateProperty
Field Value
| Type | Description |
|---|---|
| BindableProperty |
Properties
View SourceCacheMax
Max size of RecycleCache. Default is 50.
Declaration
protected int CacheMax { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
InternalItemsLayouter
Internal Items Layouter.
Declaration
protected virtual ItemsLayouter InternalItemsLayouter { get; set; }
Property Value
| Type | Description |
|---|---|
| ItemsLayouter |
ItemsSource
Item's source data.
Declaration
public virtual IEnumerable ItemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable |
ItemTemplate
DataTemplate for items.
Declaration
public virtual DataTemplate ItemTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| DataTemplate |
RecycleCache
RecycleCache of ViewItem.
Declaration
protected List<RecyclerViewItem> RecycleCache { get; }
Property Value
| Type | Description |
|---|---|
| List<><RecyclerViewItem> |
Methods
View SourceAdjustTargetPositionOfScrollAnimation(float)
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
protected override float AdjustTargetPositionOfScrollAnimation(float position)
Parameters
| Type | Name | Description |
|---|---|---|
| float | position | Scroll position which is calculated by ScrollableBase. |
Returns
| Type | Description |
|---|---|
| float | Adjusted scroll destination |
Overrides
View SourceClearCache()
Clear all remaining caches.
Declaration
protected virtual void ClearCache()
Dispose(DisposeTypes)
Dispose ItemsView and all children on it.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
| Type | Name | Description |
|---|---|---|
| DisposeTypes | type | Dispose type. |
Overrides
View SourceNotifyDataSetChanged()
Notify Dataset is Changed.
Declaration
public virtual void NotifyDataSetChanged()
NotifyItemChanged(IItemSource, int)
Notify observable item is changed.
Declaration
public virtual void NotifyItemChanged(IItemSource source, int startIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startIndex | Changed item index. |
NotifyItemInserted(IItemSource, int)
Notify observable item is inserted in dataset.
Declaration
public virtual void NotifyItemInserted(IItemSource source, int startIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startIndex | Inserted item index. |
NotifyItemMoved(IItemSource, int, int)
Notify observable item is moved from fromPosition to ToPosition.
Declaration
public virtual void NotifyItemMoved(IItemSource source, int fromPosition, int toPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | fromPosition | Previous item position. |
| int | toPosition | Moved item position. |
NotifyItemRangeChanged(IItemSource, int, int)
Notify range of observable items from start to end are changed.
Declaration
public virtual void NotifyItemRangeChanged(IItemSource source, int startRange, int endRange)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startRange | Start index of changed items range. |
| int | endRange | End index of changed items range. |
NotifyItemRangeInserted(IItemSource, int, int)
Notify count range of observable count items are inserted in startIndex.
Declaration
public virtual void NotifyItemRangeInserted(IItemSource source, int startIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startIndex | Start index of inserted items range. |
| int | count | The number of inserted items. |
NotifyItemRangeMoved(IItemSource, int, int, int)
Notify the observable item is moved from fromPosition to ToPosition.
Declaration
public virtual void NotifyItemRangeMoved(IItemSource source, int fromPosition, int toPosition, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | |
| int | fromPosition | |
| int | toPosition | |
| int | count |
NotifyItemRangeRemoved(IItemSource, int, int)
Notify the count range of observable items from the startIndex are removed.
Declaration
public virtual void NotifyItemRangeRemoved(IItemSource source, int startIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startIndex | Start index of removed items range. |
| int | count | The number of removed items |
NotifyItemRemoved(IItemSource, int)
Notify the observable item in startIndex is removed.
Declaration
public virtual void NotifyItemRemoved(IItemSource source, int startIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemSource | source | Dataset source. |
| int | startIndex | Index of removed item. |
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
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
View SourceOnScrolling(object, ScrollEventArgs)
On scroll event callback.
Declaration
protected virtual void OnScrolling(object source, ScrollEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| object | source | |
| ScrollEventArgs | args |
PopRecycleCache(DataTemplate)
Pop the item from the recycle cache.
Declaration
protected virtual RecyclerViewItem PopRecycleCache(DataTemplate Template)
Parameters
| Type | Name | Description |
|---|---|---|
| DataTemplate | Template | Template of wanted item. |
Returns
| Type | Description |
|---|---|
| RecyclerViewItem |
PushRecycleCache(RecyclerViewItem)
Push the item into the recycle cache. this item will be reused in view update.
Declaration
protected virtual bool PushRecycleCache(RecyclerViewItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| RecyclerViewItem | item | Target item to push into recycle cache. |
Returns
| Type | Description |
|---|---|
| bool |
RealizeItem(int)
Realize indexed item.
Declaration
protected virtual RecyclerViewItem RealizeItem(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index position of realizing item |
Returns
| Type | Description |
|---|---|
| RecyclerViewItem |
UnrealizeItem(RecyclerViewItem, bool)
Unrealize indexed item.
Declaration
protected virtual void UnrealizeItem(RecyclerViewItem item, bool recycle = true)
Parameters
| Type | Name | Description |
|---|---|---|
| RecyclerViewItem | item | Target item for unrealizing |
| bool | recycle | Allow recycle. default is true |