package Ġar . com . wo lox . android . example . utils Ċ Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . graphics . drawable . Color Drawable Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . ImageView Ċ import Ġar . com . wo lox . android . R Ċ import Ġcom . bump tech . glide . G lide Ċ import Ġorg . oc p soft . pretty time . Pretty Time Ċ import Ġjava . text . SimpleDateFormat Ċ import Ġjava . util . Date Ċ Ċ /** Ċ Ġ* ĠToggle s Ġ[ View ] Ġvisibility , Ġaccording Ġto Ġ[ visible ], Ġbetween Ġ[ View . VISIBLE ] Ġand Ġ[ View . IN VISIBLE ]. Ċ Ġ*/ Ċ fun ĠView . toggle Visibility ( visible : ĠBoolean ) Ġ{ ĊĠĠĠ Ġvisibility Ġ= Ġif Ġ( visible ) ĠView . VISIBLE Ġelse ĠView . IN VISIBLE Ċ } Ċ Ċ /** Ċ Ġ* ĠToggle s Ġ[ View ] Ġvisibility , Ġaccording Ġto Ġ[ present ], Ġbetween Ġ[ View . VISIBLE ] Ġand Ġ[ View . GONE ]. Ċ Ġ*/ Ċ fun ĠView . toggle Presence ( present : ĠBoolean ) Ġ{ ĊĠĠĠ Ġvisibility Ġ= Ġif Ġ( present ) ĠView . VISIBLE Ġelse ĠView . GONE Ċ } Ċ Ċ const Ġval ĠTIME _ FORMAT Ġ= Ġ" yyyy - MM - dd ' T ' HH : mm : ss . SS S ' Z '" Ċ fun ĠString . abbre viation Day Format (): ĠString Ġ= ĠPretty Time (). format ( Date ( SimpleDateFormat ( TIME _ FORMAT ). parse ( this ). time )) Ċ Ċ fun ĠImageView . glide Image ( url : ĠString ) Ġ= ĊĠĠĠ ĠG lide . with ( this ). load ( url ) ĊĠĠĠĠĠĠĠ Ġ. placeholder ( Color Drawable ( Color . GRAY )) ĊĠĠĠĠĠĠĠ Ġ. error ( R . drawable . wo lox _ logo ) ĊĠĠĠĠĠĠĠ Ġ. into ( this ) Ċ