Click or drag to resize

PageViewExample Class

Demonstrating a Page View which also allows for transitioning to the next/prev page when the drag speed exceeds a certain value, not only when the current page is more than half outside. This is mainly thanks to minSpeedToAllowSnapToNext
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          frame8.Logic.Misc.Visual.UI.ScrollRectItemsAdapterSRIAMyParams, PageViewsHolder
            frame8.ScrollRectItemsAdapter.PageViewExamplePageViewExample

Namespace:  frame8.ScrollRectItemsAdapter.PageViewExample
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class PageViewExample : SRIA<MyParams, PageViewsHolder>

The PageViewExample type exposes the following members.

Constructors
  NameDescription
Public methodPageViewExample
Top
Methods
  NameDescription
Protected methodCreateViewsHolder

Called when there are no recyclable views for itemIndex. Provide a new viewsholder instance for itemIndex. This is the place where you must initialize the viewsholder

via Init(GameObject, Int32, Boolean, Boolean) shortcut or manually set its itemIndex, instantiate the prefab and call its CollectViews

(Overrides SRIATParams, TItemViewsHolderCreateViewsHolder(Int32).)
Public methodScrollToPage
Protected methodStart (Overrides SRIATParams, TItemViewsHolderStart.)
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
Version Information

Optimized ScrollView Adapter

Supported in: 3.1
See Also