Remove non-nullable force assert for Long Click Listener in CCB (#360)
This commit is contained in:
Родитель
0b3ec4370e
Коммит
a2c5654e01
|
@ -150,7 +150,7 @@ class ContextualCommandBarActivity : DemoActivity() {
|
|||
})
|
||||
|
||||
setItemLongClickListener(object : CommandItem.OnItemLongClickListener {
|
||||
override fun onItemLongClick(item: CommandItem, view: View): Boolean {
|
||||
override fun onItemLongClick(item: CommandItem, view: View) {
|
||||
Toast.makeText(
|
||||
this@ContextualCommandBarActivity,
|
||||
getString(
|
||||
|
@ -159,7 +159,6 @@ class ContextualCommandBarActivity : DemoActivity() {
|
|||
),
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ interface CommandItem {
|
|||
}
|
||||
|
||||
interface OnItemLongClickListener {
|
||||
fun onItemLongClick(item: CommandItem, view: View): Boolean
|
||||
fun onItemLongClick(item: CommandItem, view: View)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -159,9 +159,12 @@ internal class CommandItemAdapter(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
setOnLongClickListener {
|
||||
itemLongClickListener?.onItemLongClick(commandItem, viewHolder.itemView)!!
|
||||
itemLongClickListener?.onItemLongClick(commandItem, viewHolder.itemView)
|
||||
true
|
||||
}
|
||||
|
||||
setOnClickListener {
|
||||
itemClickListener?.onItemClick(commandItem, viewHolder.itemView)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче