Skip to content

Commit

Permalink
Always configure spring force.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Jul 11, 2019
1 parent 3db0f59 commit fb951b6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions core/src/main/java/io/plaidapp/core/util/SpringUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@ fun View.spring(
val key = getKey(property)
var springAnim = getTag(key) as? SpringAnimation?
if (springAnim == null) {
springAnim = SpringAnimation(this, property).apply {
spring = SpringForce().apply {
this.dampingRatio = damping
this.stiffness = stiffness
startVelocity?.let { setStartVelocity(it) }
}
}
springAnim = SpringAnimation(this, property)
setTag(key, springAnim)
}
springAnim.spring = (springAnim.spring ?: SpringForce()).apply {
this.dampingRatio = damping
this.stiffness = stiffness
}
startVelocity?.let { springAnim.setStartVelocity(it) }
return springAnim
}

Expand Down

0 comments on commit fb951b6

Please sign in to comment.