package Ġcom . example . mv mm . utils Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ImageView Ċ import Ġandroidx . annotation . Drawable Res Ċ import Ġandroidx . databinding . Binding Adapter Ċ import Ġcom . bump tech . glide . G lide Ċ Ċ @ Binding Adapter (" visibility ") Ċ fun Ġset Visibility ( view : ĠView , Ġvalue : ĠBoolean ) Ġ{ ĊĠĠĠ Ġview . visibility Ġ= Ġif Ġ( value ) ĠView . VISIBLE Ġelse ĠView . GONE Ċ } Ċ Ċ @ Binding Adapter (" src ") Ċ fun Ġload Image ( view : ImageView ,@ Drawable Res Ġdrawable Res : Int ){ ĊĠĠĠ ĠG lide . with ( view . context ). load ( drawable Res ). into ( view ) Ċ } Ċ Ċ @ Binding Adapter (" imageUrl ") Ċ fun Ġimage ( view : ĠImageView , imageUrl : String ? ){ ĊĠĠĠ Ġif (! imageUrl . isNull OrEmpty ()){ ĊĠĠĠĠĠĠĠ ĠG lide . with ( view . context ). load ( imageUrl ). into ( view ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Binding Adapter (" imageUrl With Path ") Ċ fun Ġimage With Path ( view : ĠImageView , imageUrl : String ? ){ ĊĠĠĠ Ġif (! imageUrl . isNull OrEmpty ()){ ĊĠĠĠĠĠĠ Ġimage ( view ," http :// open weather map . org / img / wn /${ imageUrl }@ 2 x . png ") ĊĠĠĠ Ġ} Ċ }