// ĠCopyright Ġ 2 0 2 1 ĠGoogle ĠLLC Ċ // Ċ // ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ // Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ // ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ // Ċ // ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ // Ċ // ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ // Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ // ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ // ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ // Ġlimitations Ġunder Ġthe ĠLicense . Ċ package Ġcom . google . we ar . where ami Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . text . TextUtils Ċ import Ġandroid . text . format . Date Utils Ċ import Ġcom . google . we ar . where ami . data . Location Result Ċ import Ġcom . google . we ar . where ami . data . Resolved Location Ċ Ċ fun ĠContext . getTime Ago ( time : ĠLong ): ĠCharSequence Ġ{ ĊĠĠĠ Ġreturn ĠDate Utils . get Relative TimeSpan String ( time ) Ċ } Ċ Ċ fun ĠContext . getAddress Description ( location : ĠResolved Location ): ĠString Ġ{ ĊĠĠĠ Ġval Ġaddress Ġ= Ġlocation . address ĊĠĠĠ Ġval Ġsub Th orough f are Ġ= Ġaddress . sub Th orough f are ĊĠĠĠ Ġval Ġthorough f are Ġ= Ġaddress . th orough f are Ġ?: Ġreturn Ġaddress . country Name ĊĠĠĠ Ġreturn Ġ( if Ġ( TextUtils . isEmpty ( sub Th orough f are )) Ġ"" Ġelse Ġ"$ sub Th orough f are Ġ") Ġ+ Ġthorough f are Ċ } Ċ Ċ fun ĠContext . describe Location ( location : ĠLocation Result ): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġwhen Ġ( location ) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠResolved Location Ġ-> Ġget Address Description ( location ) ĊĠĠĠĠĠĠĠ Ġelse Ġ-> Ġ" Unknown " ĊĠĠĠ Ġ} Ċ } Ċ