mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Add drag to re-arrange support for quick chat actions
This commit is contained in:
parent
7da224a1ce
commit
1bdb6bf340
8 changed files with 92 additions and 14 deletions
|
|
@ -13,7 +13,7 @@ import com.geeksville.mesh.database.entity.QuickChatAction
|
|||
class QuickChatActionAdapter internal constructor(
|
||||
context: Context,
|
||||
private val onEdit: (action: QuickChatAction) -> Unit
|
||||
) : RecyclerView.Adapter<QuickChatActionAdapter.ActionViewHolder>() {
|
||||
) : RecyclerView.Adapter<QuickChatActionAdapter.ActionViewHolder>(), DragManageAdapter.SwapAdapter {
|
||||
|
||||
private val inflater: LayoutInflater = LayoutInflater.from(context)
|
||||
private var actions = emptyList<QuickChatAction>()
|
||||
|
|
@ -50,4 +50,9 @@ class QuickChatActionAdapter internal constructor(
|
|||
|
||||
override fun getItemCount() = actions.size
|
||||
|
||||
override fun swapItems(fromPosition: Int, toPosition: Int) {
|
||||
// TODO: Update data
|
||||
notifyItemMoved(fromPosition, toPosition)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue