mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Manage speed dial long press disabled
This commit is contained in:
@ -74,7 +74,7 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
handleNotificationPermission { granted ->
|
handleNotificationPermission { granted ->
|
||||||
if (!granted) {
|
if (!granted) {
|
||||||
PermissionRequiredDialog(this, R.string.allow_notifications_incoming_calls)
|
PermissionRequiredDialog(this, R.string.allow_notifications_incoming_calls, { openNotificationSettings() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -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