make drag selection at recyclerview disabled by default

This commit is contained in:
tibbi 2017-06-20 20:51:30 +02:00
parent 54c56c559e
commit aed1d64e43
3 changed files with 4 additions and 1 deletions

View File

@ -239,6 +239,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
directories_grid.isDragSelectionEnabled = true
directories_grid.isZoomingEnabled = true
layoutManager.spanCount = config.dirColumnCnt
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {

View File

@ -315,6 +315,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
}
media_grid.isDragSelectionEnabled = true
media_grid.isZoomingEnabled = true
layoutManager.spanCount = config.mediaColumnCnt
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {

View File

@ -12,6 +12,7 @@ import com.simplemobiletools.gallery.R
class MyScalableRecyclerView : RecyclerView {
private val AUTO_SCROLL_DELAY = 25L
var isZoomingEnabled = false
var isDragSelectionEnabled = false
private var mScaleDetector: ScaleGestureDetector
@ -157,7 +158,7 @@ class MyScalableRecyclerView : RecyclerView {
}
fun setDragSelectActive(initialSelection: Int) {
if (dragSelectActive)
if (dragSelectActive || !isDragSelectionEnabled)
return
lastDraggedIndex = -1