package Ġcom . example . hi ro shi . r xt ube app . ui . player Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . databinding . Data Binding Util Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . example . hi ro shi . r xt ube app . R Ċ import Ġcom . example . hi ro shi . r xt ube app . databinding . Item Related Video Binding Ċ Ċ class ĠRelated Videos Adapter ( var Ġview Models : ĠList < Related Video ViewModel >) Ġ: ĠRecyclerView . Adapter < Related Videos Adapter . Related ViewHolder >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠRelated Videos Adapter . Related ViewHolder Ġ{ ĊĊĠĠĠĠĠĠĠ Ġreturn ĠRelated ViewHolder ( Data Binding Util . inflate < Item Related Video Binding >( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠLayoutInflater . from ( parent . context ), ĠR . layout . item _ related _ video , Ġparent , Ġfalse )) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠRelated Videos Adapter . Related ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġholder . binding . viewModel Ġ= Ġview Models [ position ] ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ= Ġview Models . count () ĊĊĊĠĠĠ Ġinner Ġclass ĠRelated ViewHolder ( val Ġbinding : ĠItem Related Video Binding ) Ġ: ĠRecyclerView . ViewHolder Ġ( binding . root ) Ċ }