package Ġorg . ny pl . simpl ified . ui . catalog Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ImageView Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . google . common . util . concurrent . Fluent Future Ċ import Ġorg . ny pl . simpl ified . books . covers . Book Cover Provider Type Ċ import Ġorg . ny pl . simpl ified . feeds . api . Feed Entry Ċ Ċ /** Ċ Ġ* ĠThis Ġadapter Ġdisplays Ġa Ġlist Ġof Ġfeed Ġitems Ġin Ġa Ġcatalog Ġlane . Ċ Ġ* Ċ Ġ* Ġ@ see ĠCatalog Lane Item ViewHolder Ċ Ġ*/ Ċ class ĠCatalog Lane Item ViewHolder ( ĊĠ Ġprivate Ġval Ġview : ĠView , ĊĠ Ġprivate Ġval Ġcover Loader : ĠBook Cover Provider Type , ĊĠ Ġprivate Ġval Ġon Book Selected : Ġ( Feed Entry . Feed Entry OP DS ) Ġ-> ĠUnit Ċ ) Ġ: ĠRecyclerView . ViewHolder ( view ) Ġ{ ĊĊĠ Ġprivate Ġvar Ġthumbnail Loading : ĠFluent Future < Unit >? Ġ= Ġnull ĊĊĠ Ġprivate Ġval ĠimageView Ġ= Ġview . findViewById < ImageView >( R . id . cover Image ) ĊĠ Ġprivate Ġval Ġtarget Height Ġ= ĊĠĠĠ Ġview . resources . get Dimension Pixel Size ( org . ny pl . simpl ified . books . covers . R . dim en . cover _ thumbnail _ height ) ĊĊĠ Ġfun Ġbind To ( entry : ĠFeed Entry . Feed Entry OP DS ) Ġ{ ĊĠĠĠ Ġview . content Description Ġ= ĊĠĠĠĠĠ ĠCatalog Book Accessibility Strings . cover Description ( view . resources , Ġentry ) ĊĊĠĠĠ Ġview . setOnClickListener Ġ{ ĊĠĠĠĠĠ Ġon Book Selected . invoke ( entry ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġthis . thumbnail Loading Ġ= Ġcover Loader . load Thumbnail Into ( ĊĠĠĠĠĠ Ġentry , ĠimageView , Ġ 0 , Ġtarget Height ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġfun Ġun bind () Ġ{ ĊĠĠĠ Ġthis . thumbnail Loading Ġ= Ġthis . thumbnail Loading ?. let Ġ{ Ġloading Ġ-> ĊĠĠĠĠĠ Ġloading . cancel ( true ) ĊĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġview . content Description Ġ= Ġnull ĊĠĠĠ Ġview . setOnClickListener ( null ) ĊĠ Ġ} Ċ } Ċ