Show / Hide Table of Contents

Class ListView

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ListView
Namespace: BennyKok.RuntimeDebug.Components.UI
Assembly: com.bennykok.runtime-debug-action.dll
Syntax
[AddComponentMenu("Runtime Debug Action/UI/List View")]
public class ListView : MonoBehaviour

Fields

childBufferStart

Declaration
protected int childBufferStart
Field Value
Type Description
System.Int32

childItems

Declaration
protected ListItemView[] childItems
Field Value
Type Description
ListItemView[]

ignoreScrollChange

Declaration
protected bool ignoreScrollChange
Field Value
Type Description
System.Boolean

previousBuildHeight

Declaration
protected float previousBuildHeight
Field Value
Type Description
System.Single

reverseOrder

Declaration
[Title("Options", 1)]
public bool reverseOrder
Field Value
Type Description
System.Boolean

rowCount

Declaration
protected int rowCount
Field Value
Type Description
System.Int32

rowsAboveBelow

Declaration
protected const int rowsAboveBelow = 1
Field Value
Type Description
System.Int32

scrollRect

Declaration
protected ScrollRect scrollRect
Field Value
Type Description
UnityEngine.UI.ScrollRect

sourceDataRowStart

Declaration
protected int sourceDataRowStart
Field Value
Type Description
System.Int32

uiParent

Declaration
[NonSerialized]
public DebugUIHandler uiParent
Field Value
Type Description
DebugUIHandler

Properties

IsRootLevel

Declaration
public bool IsRootLevel { get; }
Property Value
Type Description
System.Boolean

RowCount

Get / set the number of rows in the list. If changed, will cause a rebuild of the contents of the list. Call Refresh() instead to update contents without changing length.

Declaration
public int RowCount { get; set; }
Property Value
Type Description
System.Int32

Methods

AttachUI(DebugUIHandler)

Declaration
public void AttachUI(DebugUIHandler ui)
Parameters
Type Name Description
DebugUIHandler ui

AutoScroll(Int32)

Declaration
public void AutoScroll(int dir = 0)
Parameters
Type Name Description
System.Int32 dir

CheckChildItems()

Declaration
protected virtual bool CheckChildItems()
Returns
Type Description
System.Boolean

Clear()

Quick way of clearing all the content from the list (alias for RowCount = 0)

Declaration
public virtual void Clear()

DisableAllChildren()

Declaration
protected virtual void DisableAllChildren()

GetRowItem(Int32)

Retrieve the item instance for a given row, IF it is currently allocated for the view. Because these items are recycled as the view moves, you should not hold on to this item beyond the site of the call to this method.

Declaration
public ListItemView GetRowItem(int row)
Parameters
Type Name Description
System.Int32 row

The row number

Returns
Type Description
ListItemView

The list view item assigned to this row IF it's within the window the list currently has allocated for viewing. If row is outside this range, returns null.

GetRowScrollPosition(Int32, Int32)

Get the normalised vertical scroll position which would centre the given row in the view, as best as possible without scrolling outside the bounds of the content. Use this instead of ScrollToRow if you want to control the actual scrolling yourself.

Declaration
public float GetRowScrollPosition(int row, int dir = 0)
Parameters
Type Name Description
System.Int32 row
System.Int32 dir
Returns
Type Description
System.Single

Navigate(ListItem)

Declaration
public void Navigate(ListItem subItem)
Parameters
Type Name Description
ListItem subItem

OnBackNavigation()

Declaration
public bool OnBackNavigation()
Returns
Type Description
System.Boolean

OnDisable()

Declaration
protected virtual void OnDisable()

OnScrollChanged(Vector2)

Declaration
protected virtual void OnScrollChanged(Vector2 normalisedPos)
Parameters
Type Name Description
UnityEngine.Vector2 normalisedPos

Refresh()

Trigger the refreshing of the list content (e.g. if you've changed some values). Use this if the number of rows hasn't changed but you want to update the contents for some other reason. All active items will have the ItemCallback invoked.

Declaration
public virtual void Refresh()

Refresh(ListItemView)

Refresh a single row based on its reference.

Declaration
public virtual void Refresh(ListItemView item)
Parameters
Type Name Description
ListItemView item

Refresh(Int32, Int32)

Refresh a subset of the list content. Any rows which currently have data populated in the view will cause a call to ItemCallback. The size of the list or positions won't change.

Declaration
public virtual void Refresh(int rowStart, int count)
Parameters
Type Name Description
System.Int32 rowStart
System.Int32 count

RefreshCurrent()

Declaration
public void RefreshCurrent()

RefreshStatus()

Declaration
public void RefreshStatus()

ReorganiseContent(Boolean)

Declaration
protected virtual void ReorganiseContent(bool clearContents)
Parameters
Type Name Description
System.Boolean clearContents

ScrollToRow(Int32)

Scroll the viewport so that a given row is in view, preferably centred vertically.

Declaration
public virtual void ScrollToRow(int row)
Parameters
Type Name Description
System.Int32 row

SetItem(ListItem)

Declaration
public void SetItem(ListItem item)
Parameters
Type Name Description
ListItem item

UpdateChild(ListItemView, Int32)

Declaration
protected virtual void UpdateChild(ListItemView child, int rowIdx)
Parameters
Type Name Description
ListItemView child
System.Int32 rowIdx

UpdateContentHeight()

Declaration
protected virtual void UpdateContentHeight()

UpdateTooltip(ListItem)

Declaration
public void UpdateTooltip(ListItem item)
Parameters
Type Name Description
ListItem item
In This Article
👆 RuntimeDebugAction by ❤️ BennyKok