Click or drag to resize

ExpandCollapseOnClick Class

Utility to expand an item when it's clicked, dispatching the size change request via ExpandCollapseOnClickISizeChangesHandler for increased flexibility Known issue when used with OSA: when during collapsing the item goes outside viewport, the animation stales, since the views are recycled. This can be solved by having a separate resizing utility script that's not attached to a recycling-prone object.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          Com.ForbiddenByte.OSA.UtilExpandCollapseOnClick

Namespace:  Com.ForbiddenByte.OSA.Util
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class ExpandCollapseOnClick : MonoBehaviour

The ExpandCollapseOnClick type exposes the following members.

Constructors
  NameDescription
Public methodExpandCollapseOnClick
Top
Properties
  NameDescription
Public propertyonExpandAmounChanged Obsolete.
Top
Methods
  NameDescription
Public methodOnClicked
Top
Fields
  NameDescription
Public fieldanimDuration
The duration of the expand(or collapse) animation
Public fieldbutton
The button to whose onClock to subscribe. If not specified, will try to GetComponent<Button> from the GO containing this script
Public fieldexpanded
This keeps track of the 'expanded' state. If true, on click the animation will set nonExpandedSize as the target size; else, nonExpandedSize x expandFactor
Public fieldexpandFactor
When expanding, the initial size will be nonExpandedSize and the target size will be nonExpandedSize x expandFactor; opposite is true when collapsing
Public fieldnonExpandedSize
This is the size from which the item will start expanding
Public fieldnonExpandedSizePredefined
Public fieldnonExpandedSizeSource
Public fieldonExpandAmountChanged
Public fieldonExpandSizeChanged
Public fieldsizeChangesHandler
Top
Version Information

Optimized ScrollView Adapter

Supported in: 4.1
See Also