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