From 615f32935c241fc7898e6c386e4afc4a2034a215 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Oct 2019 19:59:31 +0200 Subject: [PATCH] minor code style update --- .../gallery/pro/adapters/PortraitPhotosAdapter.kt | 6 +++--- .../gallery/pro/fragments/PhotoFragment.kt | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt index 829c9d341..650207fb3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/PortraitPhotosAdapter.kt @@ -46,10 +46,10 @@ class PortraitPhotosAdapter(val context: Context, val photos: ArrayList, inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { fun bindView(photo: String, position: Int): View { itemView.apply { - if (position == 0 || position == photos.size - 1) { - portrait_photo_item_thumbnail.layoutParams.width = sideElementWidth + portrait_photo_item_thumbnail.layoutParams.width = if (position == 0 || position == photos.size - 1) { + sideElementWidth } else { - portrait_photo_item_thumbnail.layoutParams.width = itemWidth + itemWidth } portrait_photo_item_thumbnail.background = if (photo.isEmpty() || getCurrentPhoto() != photo) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index c1401fe21..6d902b1e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -483,7 +483,6 @@ class PhotoFragment : ViewPagerFragment() { val sideElementWidth = curWidth - screenWidth val adapter = PortraitPhotosAdapter(context!!, paths, sideElementWidth) { position, x -> mView.photo_portrait_stripe.smoothScrollBy((x + itemWidth / 2) - screenWidth / 2, 0) - } mView.photo_portrait_stripe.adapter = adapter