minor code style updates

This commit is contained in:
tibbi 2017-09-01 15:17:11 +02:00
parent 2a76929312
commit bfad77b597
1 changed files with 6 additions and 10 deletions

View File

@ -123,13 +123,11 @@ class PhotoFragment : ViewPagerFragment() {
}
}
private fun degreesForRotation(orientation: Int): Int {
return when (orientation) {
8 -> 270
3 -> 180
6 -> 90
else -> 0
}
private fun degreesForRotation(orientation: Int) = when (orientation) {
8 -> 270
3 -> 180
6 -> 90
else -> 0
}
private fun rotateViaMatrix(original: Bitmap, orientation: Int): Bitmap {
@ -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)