Manage speed dial long press disabled

This commit is contained in:
merkost
2023-07-20 14:22:03 +10:00
parent 0cd9341838
commit a1d5164823
3 changed files with 4 additions and 3 deletions

View File

@ -74,7 +74,7 @@ class MainActivity : SimpleActivity() {
handleNotificationPermission { granted ->
if (!granted) {
PermissionRequiredDialog(this, R.string.allow_notifications_incoming_calls)
PermissionRequiredDialog(this, R.string.allow_notifications_incoming_calls, { openNotificationSettings() })
}
}
} else {

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()
}