Smart Adapter
open class SmartAdapter<T>(list: MutableList<T>, bind: SmartContainer<T>?) : RecyclerView.Adapter<SmartViewHolder<T>>
Content copied to clipboard
RecyclerView.Adapter的继承类,可以继承重写open方法,可以使用smart满足大多数需求.
Author
Ayvytr 's GitHub
Since
0.1.0
Constructors
SmartAdapter
Link copied to clipboard
fun <T> SmartAdapter(list: MutableList<T> = mutableListOf(), bind: SmartContainer<T>? = null)
Content copied to clipboard
Functions
bind View Holder
Link copied to clipboard
click
Link copied to clipboard
fun click(onItemClickListener: (T, position: Int) -> Unit): SmartAdapter<T>
Content copied to clipboard
create View Holder
Link copied to clipboard
@NonNull
Content copied to clipboard
diff
Link copied to clipboard
open fun diff(smartDiffCallback: SmartDiffCallback<T>? = SmartDiffCallback(), detectMovies: Boolean = true): SmartAdapter<T>
Content copied to clipboard
设置diff callback(实际使用了smartDiffCallback包装了DiffUtil.Callback).
get Item Count
Link copied to clipboard
get Item View Type
Link copied to clipboard
has Diff
Link copied to clipboard
SmartAdapter是否设置了diffCallback.
has Observers
Link copied to clipboard
has Stable Ids
Link copied to clipboard
long Click
Link copied to clipboard
fun longClick(onItemLongClickListener: (T, position: Int) -> Unit): SmartAdapter<T>
Content copied to clipboard
map
Link copied to clipboard
设置RecyclerView多类型item view的方法.
open fun map(@LayoutRes layoutId: Int, type: Int, bind: View.(T, position: Int) -> Unit): SmartAdapter<T>
Content copied to clipboard
notify Data Set Changed
Link copied to clipboard
notify Item Changed
Link copied to clipboard
notify Item Inserted
Link copied to clipboard
notify Item Moved
Link copied to clipboard
notify Item Range Changed
Link copied to clipboard
notify Item Range Inserted
Link copied to clipboard
notify Item Range Removed
Link copied to clipboard
notify Item Removed
Link copied to clipboard
on Attached To Recycler View
Link copied to clipboard
on Bind View Holder
Link copied to clipboard
open override fun onBindViewHolder(holder: SmartViewHolder<T>, position: Int)
Content copied to clipboard
open override fun onBindViewHolder(holder: SmartViewHolder<T>, position: Int, payloads: MutableList<Any>)
Content copied to clipboard
on Create View Holder
Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SmartViewHolder<T>
Content copied to clipboard
on Detached From Recycler View
Link copied to clipboard
on Failed To Recycle View
Link copied to clipboard
on View Attached To Window
Link copied to clipboard
on View Detached From Window
Link copied to clipboard
on View Recycled
Link copied to clipboard
register Adapter Data Observer
Link copied to clipboard
open fun registerAdapterDataObserver(@NonNull p0: RecyclerView.AdapterDataObserver)
Content copied to clipboard
remove Diff
Link copied to clipboard
移除diff callback.
set Has Stable Ids
Link copied to clipboard
type
Link copied to clipboard
设置 view type 获取方法.
unregister Adapter Data Observer
Link copied to clipboard
open fun unregisterAdapterDataObserver(@NonNull p0: RecyclerView.AdapterDataObserver)
Content copied to clipboard
Properties
detectMovies
Link copied to clipboard
diffCallback
Link copied to clipboard
itemClickListener
Link copied to clipboard
itemLongClickListener
Link copied to clipboard