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 62a9d466c..d90654c4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -39,9 +39,9 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList, fun toggleItemSelection(itemView: View, select: Boolean) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) - itemView.medium_thumbnail_holder.isActivated = select + itemView.medium_thumbnail_holder.isSelected = select else - itemView.medium_thumbnail.isActivated = select + itemView.medium_thumbnail.isSelected = select } } @@ -148,22 +148,22 @@ class MediaAdapter(val activity: SimpleActivity, val media: MutableList, return selectedMedia } - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - views.add(holder.bindView(activity, multiSelectorMode, multiSelector, media[position])) - } - override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { val view = LayoutInflater.from(parent?.context).inflate(R.layout.photo_video_item, parent, false) return ViewHolder(view, itemClick) } + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + views.add(holder.bindView(activity, multiSelectorMode, multiSelector, media[position])) + } + + override fun getItemCount() = media.size + fun updateDisplayFilenames(display: Boolean) { displayFilenames = display notifyDataSetChanged() } - override fun getItemCount() = media.size - class ViewHolder(view: View, val itemClick: (Medium) -> (Unit)) : SwappingHolder(view, MultiSelector()) { fun bindView(activity: SimpleActivity, multiSelectorCallback: ModalMultiSelectorCallback, multiSelector: MultiSelector, medium: Medium): View { itemView.play_outline.visibility = if (medium.isVideo) View.VISIBLE else View.GONE diff --git a/app/src/main/res/drawable-v21/selector.xml b/app/src/main/res/drawable-v21/selector.xml index 4d61c7b4d..a24cfe2b1 100644 --- a/app/src/main/res/drawable-v21/selector.xml +++ b/app/src/main/res/drawable-v21/selector.xml @@ -4,7 +4,7 @@ + android:state_selected="true"/> diff --git a/app/src/main/res/drawable/selector.xml b/app/src/main/res/drawable/selector.xml index 480db1e64..c0b842372 100644 --- a/app/src/main/res/drawable/selector.xml +++ b/app/src/main/res/drawable/selector.xml @@ -1,5 +1,5 @@ - +