Slide 12
Slide 12 text
うまくいったこと
RecyclerViewのサイクルに合わせた表示処理
- onCreateViewHolderでgetMap
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
MapItemViewHolder(parent.inflate(viewType)).also { holder ->
if (holder.binding is ListItemMapBinding) {
holder.binding.campusMap.onCreate(null)
holder.binding.campusMap.getMapAsync { map ->
MapsInitializer.initialize(holder.itemView.context.applicationContext)
mapType = GoogleMap.MAP_TYPE_NORMAL
}
}
}