INNER CODE UNIT · Kotlin

onBindViewHolder

mikepenz/FastAdapter · fastadapter/src/main/java/com/mikepenz/fastadapter/FastAdapter.kt:377

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
        if (legacyBindViewMode) {
            if (verboseLoggingEnabled) {
                Log.v(TAG, "onBindViewHolderLegacy: " + position + "/" + holder.itemViewType + " isLegacy: true")
            }
            //set the R.id.fastadapter_item_adapter tag to the adapter so we always have the proper bound adapter available
            holder.itemView.setTag(R.id.fastadapter_item_adapter, this)
            //now we bind the item to this viewHolder
            onBindViewHolderListener.onBindViewHolder(holder, position, Collections.emptyList())
        }
    }

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int, payloads: List<Any>) {
        //we do not want the binding to happen twice (the legacyBindViewMode
        if (!legacyBindViewMode) {
            if (verboseLoggingEnabled)
                Log.v(TAG, "onBindViewHolder: " + position + "/" + holder.itemViewType + " isLegacy: false")
            //set the R.id.fastadapter_item_adapter tag to the adapter so we always have the proper bound adapter available

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…