Click or drag to resize

AbstractViewsHolder Class

Class representing the concept of a Views Holder, i.e. a class that references some views and the id of the data displayed by those views. Usually, the root and its child views, once created, don't change, but ItemIndex does, after which the views will change their data.
Inheritance Hierarchy

Namespace:  Com.ForbiddenByte.OSA.Core
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public abstract class AbstractViewsHolder

The AbstractViewsHolder type exposes the following members.

Constructors
  NameDescription
Protected methodAbstractViewsHolder
Top
Properties
  NameDescription
Public propertyItemIndex
The index of the data model from which this viewsholder's views take their display information
Top
Methods
  NameDescription
Public methodCollectViews
If instead of calling Init(GameObject, Int32, Boolean, Boolean), the initializaton is done manually, this should be called lastly as part of the initialization phase
Public methodInit(GameObject, Int32, Boolean, Boolean)
Instantiates rootPrefabGO, assigns it to root and sets its itemIndex to itemIndex. Activates the new instance if activateRootGameObject is true. Also calls CollectViews if callCollectViews is true
Public methodInit(RectTransform, Int32, Boolean, Boolean)
Public methodMarkForRebuild
Make sure to override this when you have children layouts (for example, a [Vertical/Horizontal/Grid]LayoutGroup) and call MarkLayoutForRebuild(RectTransform) for them. Base's implementation should still be called!
Public methodShiftIndex
This is only called when an item is being shifted due to an InsertItems(Int32, Int32, Boolean, Boolean) or RemoveItems(Int32, Int32, Boolean, Boolean) call, but since its data remains the same (the models are shifted to make room for the others, but they don't change), there's no need to call UpdateViewsHolder(TItemViewsHolder)

Don't forget to call the base implementation first if you override this method!

Don't forget to call the base implementation first if you override this method!

Protected methodShiftIntWithOverflowCheck
Internal utility for adding a shift to value and keeping it within range [0, modulo), and also preventing integer overflow
Top
Fields
  NameDescription
Public fieldroot
The root of the view instance (which contains the actual views)
Top
Version Information

Optimized ScrollView Adapter

Supported in: 4.1
See Also