CredentialAdapter

class CredentialAdapter(onDeleteClicked: (String) -> Unit, lifecycleOwner: LifecycleOwner, armadilloViewModel: ArmadilloViewModel) : ListAdapter<Credential, CredentialAdapter.CredentialViewHolder>

RecyclerView adapter used to display the retrieved list of credentials.

The adapter manages the RecyclerView CredentialViewHolders and binds the values from the retrieved list to the holders. If a holder is currently (re)usable, the current value is bound to it. If no holder is (re)usable, a new one is created and the current value is then bound to it. As soon as the user scrolls further and a Holder leaves the screen, it is no longer needed to display its current content and can be reused by binding a new content to it.

Constructors

CredentialAdapter
Link copied to clipboard
fun CredentialAdapter(onDeleteClicked: (String) -> Unit, lifecycleOwner: LifecycleOwner, armadilloViewModel: ArmadilloViewModel)

Types

CredentialViewHolder
Link copied to clipboard
class CredentialViewHolder(binding: <ERROR CLASS>, onDeleteClicked: (String) -> Unit) : RecyclerView.ViewHolder
ViewHolder class used by CredentialAdapter.
DiffCallback
Link copied to clipboard
object DiffCallback : DiffUtil.ItemCallback<Credential>
Allows RecyclerView to determine whether Credential items have changed in an update of the Credential list.

Properties

armadilloViewModel
Link copied to clipboard
private val armadilloViewModel: ArmadilloViewModel
Is necessary because the dyslexicFont value is saved there.
lifecycleOwner
Link copied to clipboard
private val lifecycleOwner: LifecycleOwner
Is necessary to set an observer to dyslexicFont value in armadilloViewModel.
onDeleteClicked
Link copied to clipboard
private val onDeleteClicked: (String) -> Unit
Will be triggered when the delete button is clicked.

Inherited properties

mDiffer
Link copied to clipboard
val mDiffer: AsyncListDiffer<Credential>
mHasStableIds
Link copied to clipboard
private val mHasStableIds: Boolean
mListener
Link copied to clipboard
private val mListener: AsyncListDiffer.ListListener<Credential>
mObservable
Link copied to clipboard
private val mObservable: RecyclerView.AdapterDataObservable

Functions

onBindViewHolder
Link copied to clipboard
open override fun onBindViewHolder(holder: CredentialAdapter.CredentialViewHolder, position: Int)
If there is a (re)usable CredentialViewHolder: change its content.
onCreateViewHolder
Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CredentialAdapter.CredentialViewHolder
If there is no (re)usable CredentialViewHolder: create a new one.

Inherited functions

bindViewHolder
Link copied to clipboard
fun bindViewHolder(@NonNull() p0: CredentialAdapter.CredentialViewHolder, p1: Int)
createViewHolder
Link copied to clipboard
getCurrentList
Link copied to clipboard
open fun getCurrentList(): MutableList<Credential>
getItem
Link copied to clipboard
open fun getItem(p0: Int): Credential
getItemCount
Link copied to clipboard
open override fun getItemCount(): Int
getItemId
Link copied to clipboard
open fun getItemId(p0: Int): Long
getItemViewType
Link copied to clipboard
open fun getItemViewType(p0: Int): Int
hasObservers
Link copied to clipboard
fun hasObservers(): Boolean
hasStableIds
Link copied to clipboard
fun hasStableIds(): Boolean
notifyDataSetChanged
Link copied to clipboard
fun notifyDataSetChanged()
notifyItemChanged
Link copied to clipboard
fun notifyItemChanged(p0: Int)
fun notifyItemChanged(p0: Int, @Nullable() p1: Any?)
notifyItemInserted
Link copied to clipboard
fun notifyItemInserted(p0: Int)
notifyItemMoved
Link copied to clipboard
fun notifyItemMoved(p0: Int, p1: Int)
notifyItemRangeChanged
Link copied to clipboard
fun notifyItemRangeChanged(p0: Int, p1: Int)
fun notifyItemRangeChanged(p0: Int, p1: Int, @Nullable() p2: Any?)
notifyItemRangeInserted
Link copied to clipboard
fun notifyItemRangeInserted(p0: Int, p1: Int)
notifyItemRangeRemoved
Link copied to clipboard
fun notifyItemRangeRemoved(p0: Int, p1: Int)
notifyItemRemoved
Link copied to clipboard
fun notifyItemRemoved(p0: Int)
onAttachedToRecyclerView
Link copied to clipboard
open fun onAttachedToRecyclerView(@NonNull() p0: RecyclerView)
onBindViewHolder
Link copied to clipboard
open fun onBindViewHolder(@NonNull() p0: CredentialAdapter.CredentialViewHolder, p1: Int, @NonNull() p2: MutableList<Any>)
onCurrentListChanged
Link copied to clipboard
open fun onCurrentListChanged(@NonNull() p0: MutableList<Credential>, @NonNull() p1: MutableList<Credential>)
onDetachedFromRecyclerView
Link copied to clipboard
open fun onDetachedFromRecyclerView(@NonNull() p0: RecyclerView)
onFailedToRecycleView
Link copied to clipboard
open fun onFailedToRecycleView(@NonNull() p0: CredentialAdapter.CredentialViewHolder): Boolean
onViewAttachedToWindow
Link copied to clipboard
open fun onViewAttachedToWindow(@NonNull() p0: CredentialAdapter.CredentialViewHolder)
onViewDetachedFromWindow
Link copied to clipboard
open fun onViewDetachedFromWindow(@NonNull() p0: CredentialAdapter.CredentialViewHolder)
onViewRecycled
Link copied to clipboard
open fun onViewRecycled(@NonNull() p0: CredentialAdapter.CredentialViewHolder)
registerAdapterDataObserver
Link copied to clipboard
open fun registerAdapterDataObserver(@NonNull() p0: RecyclerView.AdapterDataObserver)
setHasStableIds
Link copied to clipboard
open fun setHasStableIds(p0: Boolean)
submitList
Link copied to clipboard
open fun submitList(@Nullable() p0: MutableList<Credential>?)
open fun submitList(@Nullable() p0: MutableList<Credential>?, @Nullable() p1: Runnable?)
unregisterAdapterDataObserver
Link copied to clipboard
open fun unregisterAdapterDataObserver(@NonNull() p0: RecyclerView.AdapterDataObserver)