minor code style updates

This commit is contained in:
tibbi 2017-09-01 15:17:11 +02:00
parent 2a76929312
commit bfad77b597

View file

@ -123,14 +123,12 @@ class PhotoFragment : ViewPagerFragment() {
}
}
private fun degreesForRotation(orientation: Int): Int {
return when (orientation) {
private fun degreesForRotation(orientation: Int) = when (orientation) {
8 -> 270
3 -> 180
6 -> 90
else -> 0
}
}
private fun rotateViaMatrix(original: Bitmap, orientation: Int): Bitmap {
val degrees = degreesForRotation(orientation).toFloat()
@ -176,9 +174,7 @@ class PhotoFragment : ViewPagerFragment() {
.load(medium.path)
.apply(options)
.listener(object : RequestListener<Bitmap> {
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean): Boolean {
return false
}
override fun onLoadFailed(e: GlideException?, model: Any?, target: Target<Bitmap>?, isFirstResource: Boolean) = false
override fun onResourceReady(resource: Bitmap?, model: Any?, target: Target<Bitmap>?, dataSource: DataSource?, isFirstResource: Boolean): Boolean {
if (isFragmentVisible)