各位前輩高手您好請問...PagingDataAdapter下該如何使用putParcelableArrayList傳送一堆圖到下一個fragment...因為現在用Paging3...不能用listAdapter...變成currentList不可用...一直湊不出ArrayList裡面要放甚麼???
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val holder=MyViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.gallery_cell2,parent,false))
holder.itemView.setOnClickListener {
Bundle().apply {
putParcelableArrayList("PHOTO_LIST",ArrayList(currentList))
putInt("PHOTO_POSITION",holder.absoluteAdapterPosition)
holder.itemView.findNavController().navigate(R.id.action_galleryFragment_to_photoFragment,this)
}
}
return holder
}