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 | |
} |
@dfeverx yes.
when I try this code in ide ,i get an error at "get Key(property)"
Unresolved reference: getKey
Yeah these are minimal snippets for a blog post. See this PR for a more complete implementation: nickbutcher/plaid#751
Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this ViewProperty from DynamicAnimation.ViewProperty?