package Ġcom . mu ham met us lu . cin ema 1 0 1 . util Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . widget . ImageView Ċ import Ġandroidx . databinding . Binding Adapter Ċ import Ġandroidx . swiper ef resh layout . widget . Circular Progress Drawable Ċ import Ġcom . bump tech . glide . G lide Ċ import Ġcom . bump tech . glide . request . RequestOptions Ċ import Ġcom . mu ham met us lu . cin ema 1 0 1 . R Ċ Ċ fun ĠImageView . download From Url ( url : String ?, Ġprogress Drawable : ĠCircular Progress Drawable ) Ċ { ĊĠĠĠ Ġval Ġoptions Ġ= ĠRequest Options () ĊĠĠĠĠĠĠĠ Ġ. placeholder ( progress Drawable ) ĊĠĠĠĠĠĠĠ Ġ. error ( R . mip map . ic _ launcher _ round ) ĊĊĠĠĠ ĠG lide . with ( context ) ĊĠĠĠĠĠĠĠ Ġ. setDefault RequestOptions ( options ) ĊĠĠĠĠĠĠĠ Ġ. load ( url ) ĊĠĠĠĠĠĠĠ Ġ. into ( this ) Ċ } Ċ Ċ fun Ġplaceholder ProgressBar ( context : ĠContext ): ĠCircular Progress Drawable Ċ { ĊĠĠĠ Ġreturn ĠCircular Progress Drawable ( context ). apply Ġ{ ĊĠĠĠĠĠĠĠ ĠstrokeWidth Ġ= Ġ 8 f ĊĠĠĠĠĠĠĠ Ġcenter Radius Ġ= Ġ 4 0 f ĊĠĠĠĠĠĠĠ Ġstart () ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Binding Adapter (" android : download Url ") Ċ fun Ġdownload Image ( view : ImageView , url : ĠString ?) Ċ { ĊĠĠĠ Ġview . download From Url ( url , Ġplaceholder ProgressBar ( view . context )) Ċ }