Created
July 24, 2019 21:03
-
-
Save nickbutcher/68bf9dbcd76b2754ecf91b73117cfd06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
fun View.spring( | |
property: ViewProperty | |
): SpringAnimation { | |
val key = getKey(property) | |
var springAnim = getTag(key) as? SpringAnimation? | |
if (springAnim == null) { | |
springAnim = SpringAnimation(this, property) | |
setTag(key, springAnim) | |
} | |
return springAnim | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah these are minimal snippets for a blog post. See this PR for a more complete implementation: nickbutcher/plaid#751