This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.view.View | |
import android.view.ViewGroup.LayoutParams.MATCH_PARENT | |
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT | |
import android.widget.FrameLayout | |
import androidx.asynclayoutinflater.view.AsyncLayoutInflater | |
open class AsyncCell(context: Context) : FrameLayout(context, null, 0, 0) { | |
init { | |
layoutParams = LayoutParams(MATCH_PARENT, WRAP_CONTENT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
import com.example.recyclerasyncloadingexample.databinding.LargeItemCellBinding | |
import com.example.recyclerasyncloadingexample.databinding.SmallItemCellBinding | |
class RecyclerViewAsyncAdapter internal constructor(private val items: List<TestItem>) : | |
RecyclerView.Adapter<RecyclerView.ViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder = |