Created
April 7, 2020 07:31
-
-
Save alistairsykes/cb67ec485ba0c24a70bb90b5752bfca3 to your computer and use it in GitHub Desktop.
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
val background = itemView.background | |
if (background is RippleDrawable) { | |
itemView.postOnAnimationDelayed({ | |
background.setHotspot( | |
(itemView.width * 0.75).toFloat(), | |
(itemView.height * 0.5).toFloat() | |
) | |
background.state = intArrayOf( | |
android.R.attr.state_pressed, | |
android.R.attr.state_enabled | |
) | |
itemView.postDelayed({ | |
background.state = intArrayOf() | |
}, 200) | |
}, 100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment