Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val animator:ValueAnimator = ValueAnimator.ofFloat(1.0f,0.0f)
- animator.repeatCount = ValueAnimator.INFINITE
- animator.interpolator = LinearInterpolator()
- animator.duration = 7000L
- animator.addUpdateListener {
- val progress = it.animatedValue
- val width = binding.bgView.width
- val translationX = width.toFloat() * progress.toString().toFloat()
- binding.bgView.translationX = translationX
- }
- animator.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement