From d70dd26ea67c601c6e5d2c34a98cf70fece3c182 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 2 Oct 2019 19:36:50 +0200 Subject: [PATCH] properly determine the default portrait photos cover --- .../gallery/pro/adapters/PortraitPhotosAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3a3d3f4ee..983ea00a2 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 @@ -18,7 +18,7 @@ import java.util.* class PortraitPhotosAdapter(val context: Context, val photos: ArrayList, val sideElementWidth: Int, val itemClick: (Int) -> Unit) : RecyclerView.Adapter() { - private var currentSelection = photos.first() + private var currentSelection = photos.firstOrNull { it.contains("cover", true) } ?: photos.firstOrNull { it.isNotEmpty() } private var strokeBackground = context.resources.getDrawable(R.drawable.stroke_background) private val itemWidth = context.resources.getDimension(R.dimen.portrait_photos_stripe_height).toInt()