This file contains hidden or 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
companion object { | |
/** The magnitude of rotation while the list is scrolled. */ | |
private const val SCROLL_ROTATION_MAGNITUDE = 0.25f | |
/** The magnitude of rotation while the list is over-scrolled. */ | |
private const val OVERSCROLL_ROTATION_MAGNITUDE = -10 | |
/** The magnitude of translation distance while the list is over-scrolled. */ | |
private const val OVERSCROLL_TRANSLATION_MAGNITUDE = 0.2f |
This file contains hidden or 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
var currentVelocity = 0f | |
/** | |
* A [SpringAnimation] for this RecyclerView item. This animation rotates the view with a bouncy | |
* spring configuration, resulting in the oscillation effect. | |
* | |
* The animation is started in [Recyclerview.onScrollListener]. | |
*/ | |
val rotation: SpringAnimation = SpringAnimation(itemView, SpringAnimation.ROTATION) | |
.setSpring( |
NewerOlder