Click or drag to resize

Com.ForbiddenByte.OSA.Util.PullToRefresh Namespace

 
Classes
  ClassDescription
Public classPullToRefreshBehaviour
Attach it to your ScrollView where the pull to refresh functionality is needed. Browse the PullToRefreshExample scene to see how the gizmo should be set up. An image is better than 1k words.
Public classPullToRefreshBehaviourUnityEventFloat
Public classPullToRefreshGizmo
Base class for gizmos that can be used with PullToRefreshBehaviour (see it for more details). Attach it to your ScrollView
Public classPullToRefreshRotateGizmo

Implementation of PullToRefreshGizmo that uses a rotating image to show the pull progress.

The image is rotated by the amount of distance traveled by the click/finger.

When enough pulling distance is covered the gizmo enters the "ready to refresh" state,

the rotation amount applied is damped by _ExcessPullRotationDamping (i.e. a value of 1f won't apply any furter rotation,

while a value of 0f will apply the same amount of rotation per distance traveled by the click/finger as before the "ready to refresh" state).

When OnRefreshed(Boolean) is called with true, the gizmo will disappear; if it'll be called with false,

it'll start auto-rotating with a speed of _AutoRotationDegreesPerSec degrees per second, until IsShown is set to false.

This last use-case is very common for when the refresh event actually takes time (i.e. retrieving items from a server).