TouchManager | API - NativeScript

Manage interactivity in your apps easily with TouchManager. Store reusable down/up animation settings for touches as well as optionally enable automatic tap (down/up) animations for your app.

Summary

Constructors

constructor

Properties

Define reusable touch animations to use on views with touchAnimation defined or with enableGlobalTapAnimations on.

enableGlobalTapAnimations

Static

enableGlobalTapAnimations: boolean

Enable animations for all tap bindings in the UI.

touchAnimationDefinitions

Static

touchAnimationDefinitions: {
animation: Animation;
type: TouchAnimationTypes;
}[]

When using NativeScript AnimationDefinition's for touch animations this will contain any instances for finer grain control of starting/stopping under various circumstances. The TouchManager uses this internally but makes public for other versatility if needed.

touchHandlers: {
  handler: any
}[]

Native Touch handlers (iOS only) registered with the view through the TouchManager. The TouchManager uses this internally but makes public for other versatility if needed.

Methods

addAnimations(view: View): void

The TouchManager uses this internally. Adds touch animations to view based upon it's touchAnimation property or TouchManager.animations.

startAnimationForType

Static

startAnimationForType(view: View, type: TouchAnimationTypes): void