SimpleRcvViewBindingListAdapter

A simple RecyclerView ListAdapter implementation with ViewBinding support.
Provides a convenient way to create adapters without subclassing.

ViewBinding을 지원하는 간단한 RecyclerView ListAdapter 구현체입니다.
서브클래싱 없이 어댑터를 생성하는 편리한 방법을 제공합니다.

Features:

  • ViewBinding support for item views

  • Lambda-based binding without subclassing

  • Inherits all BaseRcvListAdapter functionality

  • DiffUtil-based efficient list updates

    기능:

  • 아이템 뷰를 위한 ViewBinding 지원

  • 서브클래싱 없이 람다 기반 바인딩

  • BaseRcvListAdapter의 모든 기능 상속

  • DiffUtil 기반 효율적인 리스트 업데이트

Parameters

ITEM

The type of data items in the list.

리스트의 데이터 아이템 타입.

BINDING

The type of ViewBinding for item views.

아이템 뷰를 위한 ViewBinding 타입.

inflate

ViewBinding inflate function for item views.

아이템 뷰용 ViewBinding inflate 함수.

listDiffUtil

DiffUtil callback for comparing items.

아이템 비교를 위한 DiffUtil 콜백.

onBind

Lambda function to bind data to the ViewHolder.

ViewHolder에 데이터를 바인딩하는 람다 함수.

See also

For adapter without binding support.

바인딩이 없는 어댑터는 SimpleRcvListAdapter를 참조하세요.

For adapter with DataBinding support.

DataBinding 어댑터는 SimpleRcvDataBindingListAdapter를 참조하세요.

Constructors

Link copied to clipboard
constructor(inflate: (LayoutInflater, ViewGroup, Boolean) -> BINDING, listDiffUtil: RcvListDiffUtilCallBack<ITEM>, onBind: (BaseRcvViewBindingViewHolder<BINDING>, ITEM, position: Int) -> Unit)

Properties

Link copied to clipboard
@get:NonNull
open override val currentList: List<ITEM?>
Link copied to clipboard
open override val itemCount: Int

Functions

Link copied to clipboard
open override fun addItem(item: ITEM, onResult: (ListAdapterResult) -> Unit?)

Adds an item to the end of the list.

리스트 끝에 아이템을 추가합니다.

Link copied to clipboard
open override fun addItemAt(position: Int, item: ITEM, onResult: (ListAdapterResult) -> Unit?)

Adds an item at a specific position.

지정한 위치에 아이템을 추가합니다.

Link copied to clipboard
open override fun addItems(items: List<ITEM>, onResult: (ListAdapterResult) -> Unit?)

Adds multiple items to the end of the list.

리스트 끝에 여러 아이템을 추가합니다.

Link copied to clipboard
open override fun addItemsAt(position: Int, items: List<ITEM>, onResult: (ListAdapterResult) -> Unit?)

Inserts multiple items at a specific position.

지정한 위치에 여러 아이템을 삽입합니다.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getItemId(position: Int): Long
Link copied to clipboard
open override fun getItemOrNull(position: Int): ITEM?

Safely returns the item at the position or null.

position의 아이템을 안전하게 조회하고 없으면 null을 반환합니다.

Link copied to clipboard
open override fun getItemPosition(item: ITEM): Int

Returns the index of item within the current list.

현재 리스트에서 item의 인덱스를 반환합니다.

Link copied to clipboard
open override fun getItems(): List<ITEM>

Returns the current item list set in the adapter.

현재 adapter에 설정된 아이템 리스트를 반환합니다.

Link copied to clipboard
open fun getItemViewType(position: Int): Int
Link copied to clipboard

Returns a mutable copy of the current item list.
현재 아이템 리스트의 가변 복사본을 반환합니다.
Warning: This is a snapshot copy. Mutations do NOT affect the adapter state.
경고: 이 리스트는 스냅샷 복사본이며 변경해도 adapter 상태에 반영되지 않습니다.
To update the adapter, pass the modified list to setItems explicitly.

adapter를 갱신하려면 수정된 리스트를 setItems에 명시적으로 전달해야 합니다.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun moveItem(fromPosition: Int, toPosition: Int, onResult: (ListAdapterResult) -> Unit?)

Moves an item from one position to another.

아이템을 한 위치에서 다른 위치로 이동합니다.

Link copied to clipboard
Link copied to clipboard
fun notifyItemChanged(position: Int)
fun notifyItemChanged(position: Int, @Nullable payload: Any?)
Link copied to clipboard
fun notifyItemInserted(position: Int)
Link copied to clipboard
fun notifyItemMoved(fromPosition: Int, toPosition: Int)
Link copied to clipboard
fun notifyItemRangeChanged(positionStart: Int, itemCount: Int)
fun notifyItemRangeChanged(positionStart: Int, itemCount: Int, @Nullable payload: Any?)
Link copied to clipboard
fun notifyItemRangeInserted(positionStart: Int, itemCount: Int)
Link copied to clipboard
fun notifyItemRangeRemoved(positionStart: Int, itemCount: Int)
Link copied to clipboard
fun notifyItemRemoved(position: Int)
Link copied to clipboard
Link copied to clipboard
open override fun onBindViewHolder(holder: BaseRcvViewBindingViewHolder<BINDING>, position: Int)

Binds data to the ViewHolder at the specified position.

지정한 위치의 ViewHolder에 데이터를 바인딩합니다.

open override fun onBindViewHolder(holder: BaseRcvViewBindingViewHolder<BINDING>, position: Int, payloads: MutableList<Any>)

Binds data to the ViewHolder with payload support.
payload를 사용해 ViewHolder 데이터를 바인딩합니다.
Performs full binding if payloads is empty, otherwise partial update.

payload가 비어 있으면 전체 바인딩, 아니면 부분 업데이트를 수행합니다.

Link copied to clipboard

Creates a ViewHolder and attaches click listeners once.

ViewHolder를 생성하고 클릭 리스너를 1회 연결합니다.

Link copied to clipboard
open fun onCurrentListChanged(@NonNull previousList: List<ITEM?>, @NonNull currentList: List<ITEM?>)
Link copied to clipboard
Link copied to clipboard

Called when a ViewHolder is recycled.
ViewHolder가 재활용될 때 호출됩니다.
Clears the view cache if the holder is a BaseRcvViewHolder.

holder가 BaseRcvViewHolder이면 뷰 캐시를 정리합니다.

Link copied to clipboard
open override fun removeAll(onResult: (ListAdapterResult) -> Unit?)

Removes all items from the list.

리스트의 모든 아이템을 제거합니다.

Link copied to clipboard
open override fun removeAt(position: Int, onResult: (ListAdapterResult) -> Unit?)

Removes the item at a specific position.

지정한 위치의 아이템을 제거합니다.

Link copied to clipboard
open override fun removeItem(item: ITEM, onResult: (ListAdapterResult) -> Unit?)

Removes a specific item from the list.

리스트에서 특정 아이템을 제거합니다.

Link copied to clipboard
open override fun removeItems(items: List<ITEM>, onResult: (ListAdapterResult) -> Unit?)

Removes matching items from current list.
현재 리스트에서 일치하는 아이템을 제거합니다.
This method uses best-effort semantics and removes only existing matches.

best-effort 방식으로 실제 존재하는 항목만 제거합니다.

Link copied to clipboard
open override fun removeRange(start: Int, count: Int, onResult: (ListAdapterResult) -> Unit?)

Removes a contiguous range using start index and count.

시작 인덱스와 개수 기준으로 연속 구간을 제거합니다.

Link copied to clipboard
open override fun replaceItemAt(position: Int, item: ITEM, onResult: (ListAdapterResult) -> Unit?)

Replaces the item at a specific position with a new item.

지정한 위치의 아이템을 새 아이템으로 교체합니다.

Link copied to clipboard
open fun setHasStableIds(hasStableIds: Boolean)
Link copied to clipboard
open override fun setItems(items: List<ITEM>, onResult: (ListAdapterResult) -> Unit?)

Sets the item list.
아이템 리스트를 설정합니다.
Cancels all pending queue operations and replaces with the new list.

대기 중인 큐 연산을 취소하고 새 리스트로 교체합니다.

Link copied to clipboard
open override fun setOnItemClickListener(listener: (Int, ITEM, View) -> Unit)

Sets the item click listener.

아이템 클릭 리스너를 설정합니다.

Link copied to clipboard
open override fun setOnItemLongClickListener(listener: (Int, ITEM, View) -> Unit)

Sets the item long-click listener.

아이템 롱클릭 리스너를 설정합니다.

Link copied to clipboard
fun setQueuePolicy(maxPending: Int, overflowPolicy: QueueOverflowPolicy)

Sets queue overflow policy and max pending size.

큐 오버플로 정책과 최대 대기 크기를 설정합니다.

Link copied to clipboard
open fun submitList(@Nullable list: List<ITEM?>??)
open fun submitList(@Nullable list: List<ITEM?>??, @Nullable commitCallback: Runnable?)