I\'m working on a rotation animation in Kotlin and I after each Animation I want to set a net rotationStart and rotationEnd where the rotationStart value initially should be set
Well, the only way I found until now is this here (just in case nobody will answer to this thread, here is my solution)
val angles = arrayOf(9,6,9,4)
var rotStart = 0f
var imageSpinner = findViewById(R.id.img_spinner)
val ra1 = RotateAnimation(rotStart,-angles[0].toFloat() * 39, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f)
ra1.duration = 3200
val ra2 = RotateAnimation(rotStart, -angles[1].toFloat() * 39, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f)
ra2.duration = 1900
val ra3 = RotateAnimation(rotStart, -angles[2].toFloat() * 39, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f)
ra3.duration = 5400
val ra4 = RotateAnimation(rotStart, -angles[3].toFloat() * 39, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f)
ra4.duration = 5400
after this you have to set on each onAnimationEnd: imageview.startAnimation(ra#NUMBER#). It's a workaround and not a clean solution :-)