Skip to content

Instantly share code, notes, and snippets.

View wooooooak's full-sized avatar

LEE YONGJUN wooooooak

  • kakaomobility
  • South Korea
View GitHub Profile
@wooooooak
wooooooak / rotateImageWithAdjustingHeight.kt
Created October 26, 2019 03:46
(Android) Rotate imageView 90 degree With adjusting imageView height
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val displayMetrics = DisplayMetrics()
windowManager.defaultDisplay.getMetrics(displayMetrics)
val deviceWidth = displayMetrics.widthPixels
val deviceHeight = displayMetrics.heightPixels
@wooooooak
wooooooak / rotateImage.kt
Last active October 7, 2019 12:40
(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()
}
}