From f7f211cddf0adbd28b4546c6dae56a8f054906b4 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2016 10:49:42 +0100 Subject: [PATCH] fix showing selected items on Android 5 --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 46e433cb2..c68c09ab7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -39,7 +39,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList() fun toggleItemSelection(itemView: View, select: Boolean, pos: Int = -1) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) itemView.dir_frame.isSelected = select else itemView.dir_thumbnail.isSelected = select diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 5dade4b90..6c34931ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -39,7 +39,7 @@ class MediaAdapter(val activity: SimpleActivity, val media: MutableList, val markedItems = HashSet() fun toggleItemSelection(itemView: View, select: Boolean, pos: Int = -1) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) itemView.medium_thumbnail_holder.isSelected = select else itemView.medium_thumbnail.isSelected = select