Click or drag to resize

MultiplePrefabsExample Methods

The MultiplePrefabsExample type exposes the following members.

Methods
  NameDescription
Public methodChangeItemsCount
Self-explanatory. See ItemCountChangeMode in order to understand how change modes differ from each other.
(Overrides SRIATParams, TItemViewsHolderChangeItemsCount(ItemCountChangeMode, Int32, Int32, Boolean, Boolean).)
Protected methodCreateViewsHolder
Creates either a BidirectionalVH or a ExpandableVH, depending on the type of the model at index itemIndex. Calls Init(RectTransform, Int32, Boolean, Boolean) on it, which instantiates the prefab etc.
(Overrides SRIATParams, TItemViewsHolderCreateViewsHolder(Int32).)
Protected methodIsRecyclable
Overriding the base implementation, which always returns true. In this case, a views holder is recyclable only if its CanPresentModelType(Type) returns true for the model at index indexOfItemThatWillBecomeVisible
(Overrides SRIATParams, TItemViewsHolderIsRecyclable(TItemViewsHolder, Int32, Single).)
Public methodOnExpandedStateChanged
Protected methodStart (Overrides SRIATParams, TItemViewsHolderStart.)
Protected methodUpdate (Overrides SRIATParams, TItemViewsHolderUpdate.)
Public methodUpdateItems
Protected methodUpdateViewsHolder

Here the data in your model should be bound to the views. Use newOrRecycled.ItemIndex (ItemIndex) to retrieve its associated model

Note that views holders are re-used (this is the main purpose of this adapter), so a views holder's views will contain data from its previously associated model and if,

for example, you're downloading an image to be set as an icon, it makes sense to first clear the previous one (and probably temporarily replace it with a generic "Loading" image)

(Overrides SRIATParams, TItemViewsHolderUpdateViewsHolder(TItemViewsHolder).)
Top
See Also