mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Merge pull request #645 from Merkost/manage_speed_dial_selection
Manage speed dial long press disabled
This commit is contained in:
@ -47,6 +47,7 @@ class ContactsAdapter(
|
|||||||
highlightText: String = "",
|
highlightText: String = "",
|
||||||
val showDeleteButton: Boolean = true,
|
val showDeleteButton: Boolean = true,
|
||||||
private val enableDrag: Boolean = false,
|
private val enableDrag: Boolean = false,
|
||||||
|
private val allowLongClick: Boolean = true,
|
||||||
itemClick: (Any) -> Unit
|
itemClick: (Any) -> Unit
|
||||||
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
|
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
|
||||||
|
|
||||||
@ -127,7 +128,7 @@ class ContactsAdapter(
|
|||||||
|
|
||||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||||
val contact = contacts[position]
|
val contact = contacts[position]
|
||||||
holder.bindView(contact, true, true) { itemView, layoutPosition ->
|
holder.bindView(contact, true, allowLongClick) { itemView, layoutPosition ->
|
||||||
setupView(itemView, contact, holder)
|
setupView(itemView, contact, holder)
|
||||||
}
|
}
|
||||||
bindViewHolder(holder)
|
bindViewHolder(holder)
|
||||||
|
@ -33,7 +33,7 @@ class SelectContactDialog(val activity: SimpleActivity, contacts: MutableList<Co
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
select_contact_list.adapter = ContactsAdapter(activity, contacts, select_contact_list) {
|
select_contact_list.adapter = ContactsAdapter(activity, contacts, select_contact_list, allowLongClick = false) {
|
||||||
callback(it as Contact)
|
callback(it as Contact)
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user