Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18421] iOS: Add animation properties "springVelocity" and "dampingRatio"

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2019-04-25T11:03:39.000+0000
Affected Version/sn/a
Fix Version/sRelease 8.1.0
ComponentsiOS
Labelsanimation, bouncing, ios, view
ReporterRick Blalock
AssigneeVijay Singh
Created2015-01-21T14:09:05.000+0000
Updated2019-04-25T11:03:39.000+0000

Description

*Summary:* App developers would like to apply a spring/bounce animation when a view reaches its end-point. This is desired for both translation, rotation, and scale animations. *Proposed Properties:* * "dampingRatio": Normalized value where 1.0 will reach its end-point without overshooting and no bounce/spring effect. A value less than 1.0 will overshoot its end-point and apply a spring animation, where the lower the value, the more the view will bounce back and forth until it slows down and reaches its end-point. A value of 0.0 will bounce back and forth forever without any damping effect. * "springVelocity": Scale factor where 1.0 represents the total spring animation distance traversed in 1 second. The lower the value, the slower the spring effect. The higher the value, the faster the spring animation. For example, 2.0 will reach the end-point twice as fast and 0.5 will reach the end-point at half-speed. *Notes:* In iOS (Swift is the example code I'm using below), there are a few spring based properties that can be added to a UIView animation, for example to get this bounce effect, it's just two properties - https://www.dropbox.com/s/n9dx2yw54kr895a/2015-01-21_08-55-58.mp4?dl=0 :
		UIView.animateWithDuration(0.5,
			delay: 0,
			usingSpringWithDamping: 0.7,
			initialSpringVelocity: 0.7,
			options: nil,
			animations: {
				
				// Animated views here
				
			}, completion: nil)

Comments

  1. Vijay Singh 2019-01-04

    PR from community - https://github.com/appcelerator/titanium_mobile/pull/10564
  2. Samir Mohammed 2019-02-14

    FR Passed, waiting for Jenkins to be ready for merge.
  3. Lokesh Choudhary 2019-04-22

    PR Merged.
  4. Samir Mohammed 2019-04-25

    Closing ticket, fix verified in SDK Version 8.1.0.v20190423134840 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10564

JSON Source