Class ItemsLayouter
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
Default layout manager for RecyclerView. Layouting RecyclerViewItem on the scroll ContentContainer which need to be visible on the view by scroll position.
public abstract class ItemsLayouter : ICollectionChangedNotifier, IDisposable
- Inheritance
-
objectItemsLayouter
- Derived
- Implements
-
IDisposable
Properties
View SourceCandidateMargin
Candidate item's Margin for scroll size measure.
Declaration
protected Extents CandidateMargin { get; set; }
Property Value
Type | Description |
---|---|
Extents |
Container
Container which contains ViewItems.
Declaration
protected View Container { get; }
Property Value
Type | Description |
---|---|
View |
FirstVisible
First index of visible items.
Declaration
protected int FirstVisible { get; set; }
Property Value
Type | Description |
---|---|
int |
GroupItems
Visible ViewItem.
Declaration
protected virtual List<ItemsLayouter.GroupInfo> GroupItems { get; }
Property Value
Type | Description |
---|---|
List<><GroupInfo> |
IsHorizontal
boolean flag of scrollable horizontal direction.
Declaration
protected bool IsHorizontal { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsInitialized
Flag of layouter initialization.
Declaration
protected bool IsInitialized { get; set; }
Property Value
Type | Description |
---|---|
bool |
ItemsView
Parent ItemsView.
Declaration
protected RecyclerView ItemsView { get; set; }
Property Value
Type | Description |
---|---|
RecyclerView |
LastVisible
Last index of visible items.
Declaration
protected int LastVisible { get; set; }
Property Value
Type | Description |
---|---|
int |
Padding
Padding for ContentContainer of RecyclerView.
Declaration
public Extents Padding { get; set; }
Property Value
Type | Description |
---|---|
Extents |
PrevScrollPosition
The last scrolled position which is calculated by ScrollableBase. The value should be updated in the Recycle() method.
Declaration
protected float PrevScrollPosition { get; set; }
Property Value
Type | Description |
---|---|
float |
ScrollContentSize
Content size of scrollable.
Declaration
protected float ScrollContentSize { get; set; }
Property Value
Type | Description |
---|---|
float |
Source
Internal item source that organized. Check IItemSource and IGrouppedItemSoure also.
Declaration
protected IItemSource Source { get; }
Property Value
Type | Description |
---|---|
IItemSource |
StepCandidate
Candidate item step size for scroll size measure.
Declaration
protected float StepCandidate { get; set; }
Property Value
Type | Description |
---|---|
float |
VisibleItems
Visible ViewItem.
Declaration
protected List<RecyclerViewItem> VisibleItems { get; }
Property Value
Type | Description |
---|---|
List<><RecyclerViewItem> |
Methods
View SourceCalculateCandidateScrollPosition(float)
Adjust scrolling position by own scrolling rules.
Declaration
public virtual float CalculateCandidateScrollPosition(float scrollPosition)
Parameters
Type | Name | Description |
---|---|---|
float | scrollPosition | Scroll position which is calculated by ScrollableBase |
Returns
Type | Description |
---|---|
float |
CalculateLayoutOrientationSize()
This is called to find out how much container size can be.
Declaration
public virtual float CalculateLayoutOrientationSize()
Returns
Type | Description |
---|---|
float |
Clear()
Clear the current screen and all properties.
Declaration
public virtual void Clear()
Dispose()
Dispose ItemsLayouter and all children on it.
Declaration
public void Dispose()
Dispose(bool)
Dispose ItemsLayouter and all children on it.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true when it disposed by Dispose(). |
FindVisibleItems((float X, float Y))
Find consecutive visible items index.
Declaration
protected virtual (int start, int end) FindVisibleItems((float X, float Y) visibleArea)
Parameters
Type | Name | Description |
---|---|---|
(float Width, float Height) | visibleArea | float turple of visible area start position to end position. |
Returns
Type | Description |
---|---|
(int, int) |
GetItemPosition(int)
Get item position.
Declaration
protected virtual (float X, float Y) GetItemPosition(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
(float Width, float Height) |
GetItemSize(int)
Get item size.
Declaration
protected virtual (float Width, float Height) GetItemSize(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
(float Width, float Height) |
GetVisibleItem(int)
Get visible item object on index if it is realized.
Declaration
protected virtual RecyclerViewItem GetVisibleItem(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
RecyclerViewItem |
Initialize(RecyclerView)
Clean up ItemsLayouter.
Declaration
public virtual void Initialize(RecyclerView view)
Parameters
Type | Name | Description |
---|---|---|
RecyclerView | view | ItemsView of layouter. |
MeasureChild(RecyclerView, RecyclerViewItem)
Measure the size of child ViewItem manually.
Declaration
protected virtual void MeasureChild(RecyclerView parent, RecyclerViewItem child)
Parameters
Type | Name | Description |
---|---|---|
RecyclerView | parent | Parent ItemsView. |
RecyclerViewItem | child | Child ViewItem to Measure() |
NotifyDataSetChanged()
Notify the dataset is Changed.
Declaration
public virtual void NotifyDataSetChanged()
NotifyItemChanged(IItemSource, int)
Notify the observable item in startIndex 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 the 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 the 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 the 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 the count range of observable 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 range of the observable items are 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. |
NotifyItemSizeChanged(RecyclerViewItem)
Notify the relayout of ViewItem.
Declaration
public virtual void NotifyItemSizeChanged(RecyclerViewItem item)
Parameters
Type | Name | Description |
---|---|---|
RecyclerViewItem | item | updated ViewItem. |
RequestLayout(float, bool)
This is called to find out where items are lain out according to current scroll position.
Declaration
public virtual void RequestLayout(float scrollPosition, bool force = false)
Parameters
Type | Name | Description |
---|---|---|
float | scrollPosition | Scroll position which is calculated by ScrollableBase |
bool | force | boolean force flag to layouting forcely. |
RequestNextFocusableView(View, FocusDirection, bool)
Gets the next keyboard focusable view in this control towards the given direction.
A control needs to override this function in order to support two dimensional keyboard navigation.
Declaration
public virtual View RequestNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
Parameters
Type | Name | Description |
---|---|---|
View | currentFocusedView | The current focused view. |
View.FocusDirection | direction | The direction to move the focus towards. |
bool | loopEnabled | Whether the focus movement should be looped within the control. |
Returns
Type | Description |
---|---|
View | The next keyboard focusable view in this control or an empty handle if no view can be focused. |