Merge pull request #645 from Merkost/manage_speed_dial_selection

Manage speed dial long press disabled
This commit is contained in:
Tibor Kaputa 2023-07-20 09:03:15 +02:00 committed by GitHub
commit 59d5e92fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -47,6 +47,7 @@ class ContactsAdapter(
highlightText: String = "",
val showDeleteButton: Boolean = true,
private val enableDrag: Boolean = false,
private val allowLongClick: Boolean = true,
itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, itemClick), ItemTouchHelperContract {
@ -127,7 +128,7 @@ class ContactsAdapter(
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val contact = contacts[position]
holder.bindView(contact, true, true) { itemView, layoutPosition ->
holder.bindView(contact, true, allowLongClick) { itemView, layoutPosition ->
setupView(itemView, contact, holder)
}
bindViewHolder(holder)

View File

@ -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)
dialog?.dismiss()
}