Simple Rcv List Adapter
A simple RecyclerView ListAdapter implementation without DataBinding support.
Provides a convenient way to create adapters without subclassing.
DataBinding 없이 사용하는 간단한 RecyclerView ListAdapter 구현체입니다.
서브클래싱 없이 어댑터를 생성하는 편리한 방법을 제공합니다.
Features:
View-based binding using findViewById
Lambda-based binding without subclassing
Inherits all BaseRcvListAdapter functionality
DiffUtil-based efficient list updates
기능:findViewById를 사용한 뷰 기반 바인딩
서브클래싱 없이 람다 기반 바인딩
BaseRcvListAdapter의 모든 기능 상속
DiffUtil 기반 효율적인 리스트 업데이트
Usage example:
val adapter = SimpleRcvListAdapter<User>(
layoutRes = R.layout.item_user,
listDiffUtil = RcvListDiffUtilCallBack(
itemsTheSame = { old, new -> old.id == new.id },
contentsTheSame = { old, new -> old == new }
)
) { holder, item, position ->
holder.findViewById<TextView>(R.id.tvName).text = item.name
holder.findViewById<TextView>(R.id.tvEmail).text = item.email
}Parameters
The type of data items in the list.
리스트의 데이터 아이템 타입.
Layout resource ID for item views.
아이템 뷰를 위한 레이아웃 리소스 ID.
DiffUtil callback for comparing items.
아이템 비교를 위한 DiffUtil 콜백.
Lambda function to bind data to the ViewHolder.
ViewHolder에 데이터를 바인딩하는 람다 함수.
See also
For adapter with DataBinding support.
DataBinding을 사용하는 어댑터는 SimpleRcvDataBindingListAdapter를 참조하세요.
For the base ListAdapter implementation.
기본 ListAdapter 구현은 BaseRcvListAdapter를 참조하세요.
Constructors
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.
큐 오버플로 정책과 최대 대기 크기를 설정합니다.