do not allow clicking or long pressing thumbnail sections

This commit is contained in:
tibbi 2018-06-22 20:57:19 +02:00
parent 12ed9a66c1
commit 9520a25f62
3 changed files with 9 additions and 4 deletions

View file

@ -320,7 +320,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
initZoomListener()
val fastscroller = if (config.scrollHorizontally) media_horizontal_fastscroller else media_vertical_fastscroller
MediaAdapter(this, mMedia, this, mIsGetImageIntent || mIsGetVideoIntent || mIsGetAnyIntent, mAllowPickingMultiple, media_grid, fastscroller) {
itemClicked((it as Medium).path)
if (it is Medium) {
itemClicked(it.path)
}
}.apply {
setupZoomListener(mZoomListener)
media_grid.adapter = this

View file

@ -81,7 +81,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
visibleItemPaths.add(tmbItem.path)
}
val view = holder.bindView(tmbItem, !allowMultiplePicks) { itemView, adapterPosition ->
val allowLongPress = !allowMultiplePicks && tmbItem is Medium
val view = holder.bindView(tmbItem, allowLongPress) { itemView, adapterPosition ->
if (tmbItem is Medium) {
setupThumbnail(itemView, tmbItem)
} else {

View file

@ -64,9 +64,11 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
shownMedia = media
val adapter = MediaAdapter(activity, shownMedia, null, true, false, view.media_grid, null) {
callback((it as Medium).path)
if (it is Medium) {
callback(it.path)
dialog.dismiss()
}
}
val scrollHorizontally = activity.config.scrollHorizontally && isGridViewType
val sorting = activity.config.getFileSorting(path)