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#Copypublic abstract class RecyclerView : ScrollableBase, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider, ICollectionChangedNotifier
- Inheritance
- Derived
- Implements
Constructors
Declaration
C#Copypublic RecyclerView()
API Level: 9
Declaration
C#Copypublic RecyclerView(ControlStyle style)
Parameters
Type | Name | Description |
---|---|---|
ControlStyle | style | A style applied to the newly created RecyclerView. |
Fields
Declaration
C#Copypublic static readonly BindableProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Declaration
C#Copypublic static readonly BindableProperty ItemTemplateProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
Declaration
C#Copyprotected int CacheMax { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Declaration
C#Copyprotected virtual ItemsLayouter InternalItemsLayouter { get; set; }
Property Value
Type | Description |
---|---|
ItemsLayouter |
Declaration
C#Copypublic virtual IEnumerable ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable |
API Level: 9
Declaration
C#Copypublic virtual DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
API Level: 9
Declaration
C#Copyprotected List<RecyclerViewItem> RecycleCache { get; }
Property Value
Type | Description |
---|---|
List<RecyclerViewItem> |
Methods
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#Copyprotected 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
Declaration
C#Copyprotected virtual void ClearCache()
Declaration
C#Copyprotected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type | Dispose type. |
Overrides
Declaration
C#Copypublic virtual void NotifyDataSetChanged()
Declaration
C#Copypublic virtual void NotifyItemChanged(IItemSource source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IItemSource | source | Dataset source. |
Int32 | startIndex | Changed item index. |
Declaration
C#Copypublic virtual void NotifyItemInserted(IItemSource source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IItemSource | source | Dataset source. |
Int32 | startIndex | Inserted item index. |
NotifyItemMoved(IItemSource, Int32, Int32)
Notify observable item is moved from fromPosition to ToPosition.
Declaration
C#Copypublic 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. |
NotifyItemRangeChanged(IItemSource, Int32, Int32)
Notify range of observable items from start to end are changed.
Declaration
C#Copypublic 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. |
NotifyItemRangeInserted(IItemSource, Int32, Int32)
Notify count range of observable count items are inserted in startIndex.
Declaration
C#Copypublic 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. |
NotifyItemRangeMoved(IItemSource, Int32, Int32, Int32)
Notify the observable item is moved from fromPosition to ToPosition.
Declaration
C#Copypublic virtual void NotifyItemRangeMoved(IItemSource source, int fromPosition, int toPosition, int count)
Parameters
Type | Name | Description |
---|---|---|
IItemSource | source | |
Int32 | fromPosition | |
Int32 | toPosition | |
Int32 | count |
NotifyItemRangeRemoved(IItemSource, Int32, Int32)
Notify the count range of observable items from the startIndex are removed.
Declaration
C#Copypublic 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 |
NotifyItemRemoved(IItemSource, Int32)
Notify the observable item in startIndex is removed.
Declaration
C#Copypublic virtual void NotifyItemRemoved(IItemSource source, int startIndex)
Parameters
Type | Name | Description |
---|---|---|
IItemSource | source | Dataset source. |
Int32 | 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
C#Copypublic 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
Declaration
C#Copyprotected virtual void OnScrolling(object source, ScrollEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Object | source | |
ScrollEventArgs | args |
API Level: 9
Declaration
C#Copyprotected 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
C#Copyprotected virtual bool PushRecycleCache(RecyclerViewItem item)
Parameters
Type | Name | Description |
---|---|---|
RecyclerViewItem | item | Target item to push into recycle cache. |
Returns
Type | Description |
---|---|
Boolean |
Declaration
C#Copyprotected virtual RecyclerViewItem RealizeItem(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index position of realizing item |
Returns
Type | Description |
---|---|
RecyclerViewItem |
Declaration
C#Copyprotected 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 |