Base Rcv List Adapter
Base RecyclerView ListAdapter implementation with queue-based operations.
큐 기반 연산을 제공하는 기본 RecyclerView ListAdapter 구현입니다.
Provides comprehensive item management and click handling functionality.
아이템 관리와 클릭 처리 기능을 포괄적으로 제공합니다.
Features:
주요 기능:
DiffUtil-based efficient list updates
DiffUtil 기반의 효율적인 리스트 업데이트를 지원합니다.
Queue-based consecutive operations handling
큐 기반 연속 연산 처리를 지원합니다.
Item click and long-click listener support
아이템 클릭/롱클릭 리스너를 지원합니다.
Add, remove, move, replace item operations
아이템 추가/제거/이동/교체 연산을 지원합니다.
Partial update support via payloads
payload 기반 부분 업데이트를 지원합니다.
Automatic ViewHolder cache clearing
ViewHolder 캐시 자동 정리를 지원합니다.
Usage example:
사용 예시:
class MyAdapter : BaseRcvListAdapter<MyItem, MyViewHolder>(MyDiffUtil()) {
override fun createViewHolderInternal(parent: ViewGroup, viewType: Int): MyViewHolder {
return MyViewHolder(LayoutInflater.from(parent.context)
.inflate(R.layout.item_layout, parent, false))
}
override fun onBindViewHolder(holder: MyViewHolder, item: MyItem, position: Int) {
holder.bind(item)
}
}예시 코드를 참고해 구현 패턴을 적용할 수 있습니다.
Parameters
The type of items in the list.
리스트의 아이템 타입입니다.
The type of ViewHolder.
ViewHolder 타입입니다.
DiffUtil callback for comparing items.
아이템 비교를 위한 DiffUtil 콜백입니다.
See also
For the DiffUtil callback implementation.
DiffUtil 콜백 구현은 RcvListDiffUtilCallBack을 참고하세요.
For the operation queue implementation.
연산 큐 구현은 AdapterOperationQueue를 참고하세요.
Inheritors
Functions
Adds an item to the end of the list.
리스트 끝에 아이템을 추가합니다.
Adds an item at a specific position.
지정한 위치에 아이템을 추가합니다.
Adds multiple items to the end of the list.
리스트 끝에 여러 아이템을 추가합니다.
Inserts multiple items at a specific position.
지정한 위치에 여러 아이템을 삽입합니다.
Safely returns the item at the position or null.
position의 아이템을 안전하게 조회하고 없으면 null을 반환합니다.
Returns the current item list set in the adapter.
현재 adapter에 설정된 아이템 리스트를 반환합니다.
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에 명시적으로 전달해야 합니다.
Moves an item from one position to another.
아이템을 한 위치에서 다른 위치로 이동합니다.
Binds data to the ViewHolder at the specified position.
지정한 위치의 ViewHolder에 데이터를 바인딩합니다.
Binds data to the ViewHolder with payload support.
payload를 사용해 ViewHolder 데이터를 바인딩합니다.
Performs full binding if payloads is empty, otherwise partial update.
payload가 비어 있으면 전체 바인딩, 아니면 부분 업데이트를 수행합니다.
Creates a ViewHolder and attaches click listeners once.
ViewHolder를 생성하고 클릭 리스너를 1회 연결합니다.
Called when a ViewHolder is recycled.
ViewHolder가 재활용될 때 호출됩니다.
Clears the view cache if the holder is a BaseRcvViewHolder.
holder가 BaseRcvViewHolder이면 뷰 캐시를 정리합니다.
Removes all items from the list.
리스트의 모든 아이템을 제거합니다.
Removes the item at a specific position.
지정한 위치의 아이템을 제거합니다.
Removes a specific item from the list.
리스트에서 특정 아이템을 제거합니다.
Removes matching items from current list.
현재 리스트에서 일치하는 아이템을 제거합니다.
This method uses best-effort semantics and removes only existing matches.
best-effort 방식으로 실제 존재하는 항목만 제거합니다.
Removes a contiguous range using start index and count.
시작 인덱스와 개수 기준으로 연속 구간을 제거합니다.
Replaces the item at a specific position with a new item.
지정한 위치의 아이템을 새 아이템으로 교체합니다.
Sets the item list.
아이템 리스트를 설정합니다.
Cancels all pending queue operations and replaces with the new list.
대기 중인 큐 연산을 취소하고 새 리스트로 교체합니다.
Sets the item click listener.
아이템 클릭 리스너를 설정합니다.
Sets the item long-click listener.
아이템 롱클릭 리스너를 설정합니다.
Sets queue overflow policy and max pending size.
큐 오버플로 정책과 최대 대기 크기를 설정합니다.