minor code style update

This commit is contained in:
tibbi 2019-10-02 19:59:31 +02:00
parent 687b8697c8
commit 615f32935c
2 changed files with 3 additions and 4 deletions

View file

@ -46,10 +46,10 @@ class PortraitPhotosAdapter(val context: Context, val photos: ArrayList<String>,
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) {

View file

@ -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