Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override fun onOffsetChanged(appBarLayout: AppBarLayout, verticalOffset: Int) {
- if(maxScrollSize == 0)
- maxScrollSize = appBarLayout.totalScrollRange
- val currentScrollPercentage = (Math.abs(verticalOffset)) * 100 / maxScrollSize
- if(currentScrollPercentage >= IMAGE_SHOW_PERCENT)
- if(!isImageHidden){
- isImageHidden = true
- ViewCompat.animate(reserveIconFAB).scaleY(0f).scaleX(0f).start()
- }
- if(currentScrollPercentage < IMAGE_SHOW_PERCENT)
- if(isImageHidden){
- isImageHidden = false
- ViewCompat.animate(reserveIconFAB).scaleY(1f).scaleX(1f).start()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement