Skip to content

Commit

Permalink
don't show drag handle if it is not draggable (fixes #2887)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed May 17, 2021
1 parent c225404 commit a43152a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.view.isGone
import androidx.core.view.isInvisible

import java.util.Collections
import java.util.Locale
Expand Down Expand Up @@ -155,6 +156,7 @@ class QuestSelectionAdapter @Inject constructor(
visibilityCheckBox.isEnabled = item.isInteractionEnabled
visibilityCheckBox.setOnCheckedChangeListener(this)

dragHandle.isInvisible = !item.isInteractionEnabled
dragHandle.setOnTouchListener { v, event ->
when (event.actionMasked) {
MotionEvent.ACTION_DOWN -> itemTouchHelper.startDrag(this)
Expand Down

0 comments on commit a43152a

Please sign in to comment.