package Ġcom . popular movies . vp aliy . popular movies app . ui . more Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Bitmap Ċ import Ġandroid . support . v 7 . graphics . Palette Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . bump tech . glide . G lide Ċ import Ġcom . bump tech . glide . Priority Ċ import Ġcom . bump tech . glide . load . engine . Disk Cache Strategy Ċ import Ġcom . bump tech . glide . request . target . ImageView Target Ċ import Ġcom . popular movies . vp aliy . popular movies app . R Ċ import Ġcom . popular movies . vp aliy . popular movies app . ui . base . Base Adapter Ċ import Ġcom . popular movies . vp aliy . popular movies app . ui . model . Media Model Ċ import Ġcom . popular movies . vp aliy . popular movies app . ui . utils . fetch Dominant Sw atch Ċ import Ġcom . popular movies . vp aliy . popular movies app . ui . utils . set Drawable Color Ċ import Ġkotlinx . android . synt hetic . main . adapter _ more _ item . view .* Ċ Ċ class ĠMore Media Adapter ( context : ĠContext , Ġval Ġclick : Ġ( Media Model ) Ġ-> ĠUnit ) Ġ: ĠBase Adapter < Media Model >( context ) Ġ{ ĊĠ Ġinner Ġclass ĠMedia ViewHolder ( item View : ĠView ) Ġ: ĠBase ViewHolder ( item View ) Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġbind () Ġ= Ġwith ( item View ) Ġ{ ĊĠĠĠĠĠ Ġval Ġitem Ġ= Ġthis @ More Media Adapter [ adapter Position ] ĊĠĠĠĠĠ ĠG lide . with ( item View . context ) ĊĠĠĠĠĠĠĠĠĠ Ġ. load ( item . backdrop ) ĊĠĠĠĠĠĠĠĠĠ Ġ. as Bitmap () ĊĠĠĠĠĠĠĠĠĠ Ġ. priority ( Priority . IM MEDI ATE ) ĊĠĠĠĠĠĠĠĠĠ Ġ. disk Cache Strategy ( Disk Cache Strategy . RESULT ) ĊĠĠĠĠĠĠĠĠĠ Ġ. placeholder ( R . drawable . placeholder ) ĊĠĠĠĠĠĠĠĠĠ Ġ. animate ( R . anim . fade _ in ) ĊĠĠĠĠĠĠĠĠĠ Ġ. into ( object Ġ: ĠImageView Target < Bitmap >( poster ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġset Resource ( resource : ĠBitmap ?) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġposter . setImage Bitmap ( resource ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠPalette . Builder ( resource ). generate ({ Ġapply Colors ( it ) Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠ Ġtitle . text Ġ= Ġitem . title ĊĠĠĠĠĠ Ġrelease . text Ġ= Ġitem . release ĊĠĠĠĠĠ Ġratings . text Ġ= Ġitem . ratings ĊĠĠĠĠĠ Ġch ips . set Tags ( item . tags ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġapply Colors ( palette : ĠPalette ) Ġ= Ġwith ( item View ) Ġ{ ĊĠĠĠĠĠ Ġval Ġsw atch Ġ= Ġfetch Dominant Sw atch ( palette ) ĊĠĠĠĠĠ Ġsw atch ?. let Ġ{ ĊĠĠĠĠĠĠĠ Ġdetails . set BackgroundColor ( sw atch . rgb ) ĊĠĠĠĠĠĠĠ Ġch ips . set Chips Colors ( sw atch . body TextColor , Ġsw atch . title TextColor ) ĊĠĠĠĠĠĠĠ Ġtitle . setTextColor ( sw atch . body TextColor ) ĊĠĠĠĠĠĠĠ Ġrelease . setTextColor ( sw atch . body TextColor ) ĊĠĠĠĠĠĠĠ Ġratings . setTextColor ( sw atch . body TextColor ) ĊĠĠĠĠĠĠĠ Ġset Drawable Color ( release , Ġsw atch . body TextColor ) ĊĠĠĠĠĠĠĠ Ġset Drawable Color ( ratings , Ġsw atch . body TextColor ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup ?, Ġview Type : ĠInt ) ĊĠĠĠĠĠ Ġ: ĠMedia ViewHolder ĊĠĠĠĠĠ Ġ= ĠMedia ViewHolder ( in flater . inflate ( R . layout . adapter _ more _ item , Ġparent , Ġfalse )) Ċ }