Improve code

csv
Laurent 6 years ago
parent 39d52aac4c
commit 259d453117
  1. 6
      app/src/main/java/net/pokeranalytics/android/ui/view/ContextMenuRecyclerView.kt

@ -20,9 +20,11 @@ class ContextMenuRecyclerView : RecyclerView {
}
override fun showContextMenuForChild(originalView: View): Boolean {
val longPressPosition = getChildAdapterPosition(originalView)
if (longPressPosition >= 0) {
val longPressId = adapter!!.getItemId(longPressPosition)
val longPressId = adapter?.getItemId(longPressPosition)
if (longPressPosition >= 0 && longPressId != null) {
mContextMenuInfo = RecyclerViewContextMenuInfo(longPressPosition, longPressId)
return super.showContextMenuForChild(originalView)
}

Loading…
Cancel
Save