Class FlexibleViewLayoutManager
Definition
- Namespace:
- Tizen.NUI.Components
- Assembly:
- Tizen.NUI.Components.dll
A FlexibleViewLayoutManager is responsible for measuring and positioning item views within a FlexibleView as well as determining the policy for when to recycle item views that are no longer visible to the user.
public abstract class FlexibleViewLayoutManager : Disposable
- Inheritance
- Derived
Properties
View SourceChildCount
Return the current number of child views attached to the parent FlexibleView.
Declaration
public int ChildCount { get; }
Property Value
Type | Description |
---|---|
int |
FocusPosition
Gets the current focus position in adapter.
Declaration
public int FocusPosition { get; }
Property Value
Type | Description |
---|---|
int |
Height
Return the height of the parent FlexibleView.
Declaration
public float Height { get; }
Property Value
Type | Description |
---|---|
float |
ItemCount
Gets the datas count in data sets.
Declaration
public int ItemCount { get; }
Property Value
Type | Description |
---|---|
int |
PaddingBottom
Return the bottom padding of the parent FlexibleView.
Declaration
public int PaddingBottom { get; }
Property Value
Type | Description |
---|---|
int |
PaddingLeft
Return the left padding of the parent FlexibleView.
Declaration
public int PaddingLeft { get; }
Property Value
Type | Description |
---|---|
int |
PaddingRight
Return the right padding of the parent FlexibleView.
Declaration
public int PaddingRight { get; }
Property Value
Type | Description |
---|---|
int |
PaddingTop
Return the top padding of the parent FlexibleView.
Declaration
public int PaddingTop { get; }
Property Value
Type | Description |
---|---|
int |
Width
Return the width of the parent FlexibleView.
Declaration
public float Width { get; }
Property Value
Type | Description |
---|---|
float |
Methods
View SourceAddView(FlexibleViewViewHolder, int)
Add a view to the currently attached FlexibleView if needed.
FlexibleViewLayoutManagers should use this method to add views obtained from a FlexibleViewRecycler using getViewForPosition(int).
Declaration
public void AddView(FlexibleViewViewHolder holder, int index)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | view to add |
int | index | index to add child at |
AddView(FlexibleViewViewHolder)
Add a view to the currently attached FlexibleView if needed.
FlexibleViewLayoutManagers should use this method to add views obtained from a FlexibleViewRecycler using getViewForPosition(int).
Declaration
public void AddView(FlexibleViewViewHolder holder)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | holder | view to add |
CanScrollHorizontally()
Query if horizontal scrolling is currently supported. The default implementation returns false.
Declaration
public virtual bool CanScrollHorizontally()
Returns
Type | Description |
---|---|
bool |
CanScrollVertically()
Query if vertical scrolling is currently supported. The default implementation returns false.
Declaration
public virtual bool CanScrollVertically()
Returns
Type | Description |
---|---|
bool |
ChangeFocus(int)
Change the FlexibleViewViewHolder with focusPosition to focus.
Declaration
public void ChangeFocus(int focusPosition)
Parameters
Type | Name | Description |
---|---|---|
int | focusPosition | the newly focus position |
ComputeScrollExtent()
Compute the extent of the scrollbar's thumb within the range.
Declaration
public virtual float ComputeScrollExtent()
Returns
Type | Description |
---|---|
float |
ComputeScrollOffset()
Compute the offset of the scrollbar's thumb within the range.
Declaration
public virtual float ComputeScrollOffset()
Returns
Type | Description |
---|---|
float |
ComputeScrollRange()
Compute the range that the scrollbar represents.
Declaration
public virtual float ComputeScrollRange()
Returns
Type | Description |
---|---|
float |
Dispose(DisposeTypes)
Dispose FlexibleView and all children on it.
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
Type | Name | Description |
---|---|---|
DisposeTypes | type | Dispose type. |
Overrides
View SourceFindFirstVisibleItemView()
Retrieves the first visible item view.
Declaration
protected virtual FlexibleViewViewHolder FindFirstVisibleItemView()
Returns
Type | Description |
---|---|
FlexibleViewViewHolder |
FindItemViewByPosition(int)
Finds the view which represents the given adapter position.
Declaration
public FlexibleViewViewHolder FindItemViewByPosition(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | adapter position |
Returns
Type | Description |
---|---|
FlexibleViewViewHolder |
FindLastVisibleItemView()
Retrieves the last visible item view.
Declaration
protected virtual FlexibleViewViewHolder FindLastVisibleItemView()
Returns
Type | Description |
---|---|
FlexibleViewViewHolder |
GetChildAt(int)
Return the child view at the given index.
Declaration
public FlexibleViewViewHolder GetChildAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | child index |
Returns
Type | Description |
---|---|
FlexibleViewViewHolder |
GetNextPosition(int, Direction)
Retrieves a position that neighbor to current position by direction.
Declaration
protected abstract int GetNextPosition(int position, FlexibleViewLayoutManager.Direction direction)
Parameters
Type | Name | Description |
---|---|---|
int | position | The anchor adapter position |
FlexibleViewLayoutManager.Direction | direction | The direction. |
Returns
Type | Description |
---|---|
int |
LayoutChild(FlexibleViewViewHolder, float, float, float, float)
Lay out the given child view within the FlexibleView using coordinates that include view margins.
Declaration
public void LayoutChild(FlexibleViewViewHolder child, float left, float top, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewViewHolder | child | Child to lay out |
float | left | Left edge, with item view left margin included |
float | top | Top edge, with item view top margin included |
float | width | Width, with item view left and right margin included |
float | height | Height, with item view top and bottom margin included |
OffsetChildrenHorizontal(float, bool)
Offset all child views attached to the parent FlexibleView by dx pixels along the horizontal axis.
Declaration
public void OffsetChildrenHorizontal(float dx, bool immediate)
Parameters
Type | Name | Description |
---|---|---|
float | dx | Pixels to offset by |
bool | immediate | specify if the offset need animation |
OffsetChildrenVertical(float, bool)
Offset all child views attached to the parent FlexibleView by dy pixels along the vertical axis.
Declaration
public void OffsetChildrenVertical(float dy, bool immediate)
Parameters
Type | Name | Description |
---|---|---|
float | dy | Pixels to offset by |
bool | immediate | specify if the offset need animation |
OnLayoutChildren(FlexibleViewRecycler)
Layout all relevant child views from the given adapter.
Declaration
public abstract void OnLayoutChildren(FlexibleViewRecycler recycler)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewRecycler | recycler | Recycler to use for fetching potentially cached views for a position |
OnLayoutCompleted()
Called after a full layout calculation is finished.
Declaration
public virtual void OnLayoutCompleted()
RecycleChildren(FlexibleViewRecycler, int, int, bool)
Recycles children between given indices..
Declaration
public void RecycleChildren(FlexibleViewRecycler recycler, int startIndex, int endIndex, bool immediate)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewRecycler | recycler | Recycler to recycle views into |
int | startIndex | inclusive |
int | endIndex | exclusive |
bool | immediate | recycle immediately or add to pending list and recycle later. |
RelayoutRequest()
Calls {@code FlexibleView#RelayoutRequest} on the underlying FlexibleView.
Declaration
public void RelayoutRequest()
RemoveAndRecycleViewAt(int, FlexibleViewRecycler)
Declaration
public void RemoveAndRecycleViewAt(int index, FlexibleViewRecycler recycler)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
FlexibleViewRecycler | recycler |
ScrapAttachedViews(FlexibleViewRecycler)
Temporarily detach and scrap all currently attached child views. Views will be scrapped into the given FlexibleViewRecycler. The FlexibleViewRecycler may prefer to reuse scrap views before other views that were previously recycled.
Declaration
public void ScrapAttachedViews(FlexibleViewRecycler recycler)
Parameters
Type | Name | Description |
---|---|---|
FlexibleViewRecycler | recycler | Recycler to scrap views into |
ScrollHorizontallyBy(float, FlexibleViewRecycler, bool)
Scroll horizontally by dy pixels in screen coordinates.
Declaration
public virtual float ScrollHorizontallyBy(float dy, FlexibleViewRecycler recycler, bool immediate)
Parameters
Type | Name | Description |
---|---|---|
float | dy | distance to scroll in pixels. Y increases as scroll position approaches the top. |
FlexibleViewRecycler | recycler | Recycler to use for fetching potentially cached views for a position |
bool | immediate | Specify if the scroll need animation |
Returns
Type | Description |
---|---|
float |
ScrollToPosition(int)
Scroll the FlexibleView to make the position visible.
Declaration
public virtual void ScrollToPosition(int position)
Parameters
Type | Name | Description |
---|---|---|
int | position | Scroll to this adapter position |
ScrollToPositionWithOffset(int, int)
Scroll to the specified adapter position with the given offset from resolved layout start.
Declaration
public virtual void ScrollToPositionWithOffset(int position, int offset)
Parameters
Type | Name | Description |
---|---|---|
int | position | Scroll to this adapter position |
int | offset | The distance (in pixels) between the start edge of the item view and start edge of the FlexibleView. |
ScrollVerticallyBy(float, FlexibleViewRecycler, bool)
Scroll vertically by dy pixels in screen coordinates.
Declaration
public virtual float ScrollVerticallyBy(float dy, FlexibleViewRecycler recycler, bool immediate)
Parameters
Type | Name | Description |
---|---|---|
float | dy | distance to scroll in pixels. Y increases as scroll position approaches the top. |
FlexibleViewRecycler | recycler | Recycler to use for fetching potentially cached views for a position |
bool | immediate | Specify if the scroll need animation |
Returns
Type | Description |
---|---|
float |