Created
March 28, 2019 12:57
-
-
Save riggaroo/5068328b836f9c7758eff5973f970a10 to your computer and use it in GitHub Desktop.
Example of using FloatPropertyCompat for SpringAnimations.
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
private val floatPropertyAnimX = object : FloatPropertyCompat<ColorDropperView>(PROPERTY_X) { | |
override fun setValue(dropper: ColorDropperView?, value: Float) { | |
dropper?.setDropperX(value) | |
} | |
override fun getValue(dropper: ColorDropperView?): Float { | |
return dropper?.getDropperX() ?: 0f | |
} | |
} | |
private val floatPropertyAnimY = object : FloatPropertyCompat<ColorDropperView>(PROPERTY_Y) { | |
override fun setValue(dropper: ColorDropperView?, value: Float) { | |
dropper?.setDropperY(value) | |
} | |
override fun getValue(dropper: ColorDropperView?): Float { | |
return dropper?.getDropperY() ?: 0f | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment