Aperture: Simplify View.smoothRotate
Change-Id: Iaa7ea80495d76d9822cbdedd556996258c467e4f
diff --git a/app/src/main/java/org/lineageos/aperture/ViewExt.kt b/app/src/main/java/org/lineageos/aperture/ViewExt.kt
index e9d1f45..79578d3 100644
--- a/app/src/main/java/org/lineageos/aperture/ViewExt.kt
+++ b/app/src/main/java/org/lineageos/aperture/ViewExt.kt
@@ -61,8 +61,9 @@
}
internal fun View.smoothRotate(rotation: Float) {
- animate().cancel()
- animate()
- .rotationBy(Rotation.getDifference(this.rotation, rotation))
- .interpolator = AccelerateDecelerateInterpolator()
+ with(animate()) {
+ cancel()
+ rotationBy(Rotation.getDifference(this@smoothRotate.rotation, rotation))
+ .interpolator = AccelerateDecelerateInterpolator()
+ }
}