Skip to content

Instantly share code, notes, and snippets.

@wooooooak
Last active October 7, 2019 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wooooooak/d56c1ac4005e78fd1718d95831f1e9cd to your computer and use it in GitHub Desktop.
Save wooooooak/d56c1ac4005e78fd1718d95831f1e9cd to your computer and use it in GitHub Desktop.
(Android) Rotate imageView 90 degree continuously whenever you touch
...
override fun onCreate(savedInstanceState: Bundle?) {
...
myImageView.setOnClickListener {
val currentDegree = it.rotation
ObjectAnimator.ofFloat(it, View.ROTATION, currentDegree, currentDegree + 90f)
.setDuration(300)
.start()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment