make drag selection at recyclerview disabled by default
This commit is contained in:
parent
54c56c559e
commit
aed1d64e43
|
@ -239,6 +239,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
directories_grid.isDragSelectionEnabled = true
|
||||||
directories_grid.isZoomingEnabled = true
|
directories_grid.isZoomingEnabled = true
|
||||||
layoutManager.spanCount = config.dirColumnCnt
|
layoutManager.spanCount = config.dirColumnCnt
|
||||||
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
||||||
|
|
|
@ -315,6 +315,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
media_grid.isDragSelectionEnabled = true
|
||||||
media_grid.isZoomingEnabled = true
|
media_grid.isZoomingEnabled = true
|
||||||
layoutManager.spanCount = config.mediaColumnCnt
|
layoutManager.spanCount = config.mediaColumnCnt
|
||||||
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.simplemobiletools.gallery.R
|
||||||
class MyScalableRecyclerView : RecyclerView {
|
class MyScalableRecyclerView : RecyclerView {
|
||||||
private val AUTO_SCROLL_DELAY = 25L
|
private val AUTO_SCROLL_DELAY = 25L
|
||||||
var isZoomingEnabled = false
|
var isZoomingEnabled = false
|
||||||
|
var isDragSelectionEnabled = false
|
||||||
|
|
||||||
private var mScaleDetector: ScaleGestureDetector
|
private var mScaleDetector: ScaleGestureDetector
|
||||||
|
|
||||||
|
@ -157,7 +158,7 @@ class MyScalableRecyclerView : RecyclerView {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDragSelectActive(initialSelection: Int) {
|
fun setDragSelectActive(initialSelection: Int) {
|
||||||
if (dragSelectActive)
|
if (dragSelectActive || !isDragSelectionEnabled)
|
||||||
return
|
return
|
||||||
|
|
||||||
lastDraggedIndex = -1
|
lastDraggedIndex = -1
|
||||||
|
|
Loading…
Reference in New Issue