properly determine the default portrait photos cover

This commit is contained in:
tibbi 2019-10-02 19:36:50 +02:00
parent 29cd22bda7
commit d70dd26ea6
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ import java.util.*
class PortraitPhotosAdapter(val context: Context, val photos: ArrayList<String>, val sideElementWidth: Int, val itemClick: (Int) -> Unit) :
RecyclerView.Adapter<PortraitPhotosAdapter.ViewHolder>() {
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()