/* Ċ Ġ* Ġ* Ċ Ġ* Ġ Ġ* Copyright Ġ 2 0 2 0 . ĠExplo re Ġin ĠH MS . ĠAll Ġrights Ġreserved . Ċ Ġ* Ċ Ġ* Ġ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 . h ms . reference app . health yl ife app . util Ċ Ċ import Ġcom . hu awei . h ms . hi health . Hi Health Activities Ċ import Ġkotlin . random . Random Ċ Ċ val ĠR AN DOM _ STRING Ġ: ĠList < Char > Ġ= Ġ(' a ' .. ' z ') Ġ+ Ġ(' A ' .. ' Z ') Ġ+ Ġ(' 0 ' .. ' 9 ') Ċ Ċ fun ĠgetRandom String ( length : ĠInt ) Ġ: ĠString Ġ{ ĊĠĠĠ Ġreturn Ġ( 1 .. length ) ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ ĠRandom . nextInt ( 0 , ĠR AN DOM _ STRING . size ) Ġ} ĊĠĠĠĠĠĠĠ Ġ. map ( RANDOM _ STRING :: get ) ĊĠĠĠĠĠĠĠ Ġ. join ToString ("") Ċ } Ċ Ċ fun ĠgetTime Difference ( startDate : ĠLong , ĠendDate : ĠLong ): ĠString { ĊĊĠĠĠ Ġvar Ġdifferent : ĠLong Ġ= ĠendDate Ġ- ĠstartDate ĊĊĠĠĠ Ġval Ġseconds In Milli : ĠLong Ġ= Ġ 1 0 0 0 ĊĠĠĠ Ġval Ġminutes In Milli Ġ= Ġseconds In Milli Ġ* Ġ 6 0 ĊĠĠĠ Ġval Ġhours In Milli Ġ= Ġminutes In Milli Ġ* Ġ 6 0 ĊĠĠĠ Ġval Ġdays In Milli Ġ= Ġhours In Milli Ġ* Ġ 2 4 ĊĊĠĠĠ Ġval Ġelapsed Days Ġ= Ġdifferent Ġ/ Ġdays In Milli ĊĠĠĠ Ġdifferent Ġ% = Ġdays In Milli ĊĊĠĠĠ Ġval Ġelapsed Hours Ġ= Ġdifferent Ġ/ Ġhours In Milli ĊĠĠĠ Ġdifferent Ġ% = Ġhours In Milli ĊĊĠĠĠ Ġval Ġelapsed Minutes Ġ= Ġdifferent Ġ/ Ġminutes In Milli ĊĠĠĠ Ġdifferent Ġ% = Ġminutes In Milli ĊĊĠĠĠ Ġval Ġelapsed Seconds Ġ= Ġdifferent Ġ/ Ġseconds In Milli ĊĊĠĠĠ Ġval Ġbuilder Ġ= ĠStringBuilder () ĊĊĠĠĠ Ġif Ġ( elapsed Days Ġ!= Ġ 0 L ){ ĊĠĠĠĠĠĠĠ Ġbuilder . append ("$ elapsed Days Ġd Ġ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( elapsed Hours Ġ!= Ġ 0 L ){ ĊĠĠĠĠĠĠĠ Ġbuilder . append ("$ elapsed Hours Ġh Ġ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( elapsed Minutes Ġ!= Ġ 0 L ){ ĊĠĠĠĠĠĠĠ Ġbuilder . append ("$ elapsed Minutes Ġm Ġ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( elapsed Seconds Ġ!= Ġ 0 L ){ ĊĠĠĠĠĠĠĠ Ġbuilder . append ("$ elapsed Seconds Ġs Ġ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġbuilder . toString () Ċ } Ċ Ċ val Ġlist Activity Types Ġ= ĠarrayOf ( ĊĠĠĠ ĠHi Health Activities . A ER OB ICS , ĊĠĠĠ ĠHi Health Activities . ARCH ERY , ĊĠĠĠ ĠHi Health Activities . BAD M INT ON , ĊĠĠĠ ĠHi Health Activities . BASE B ALL , ĊĠĠĠ ĠHi Health Activities . B ASK ET B ALL , ĊĠĠĠ ĠHi Health Activities . BI ATH LON , ĊĠĠĠ ĠHi Health Activities . BOX ING , ĊĠĠĠ ĠHi Health Activities . C ALIST HEN ICS , ĊĠĠĠ ĠHi Health Activities . CIR CU IT _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . CR ICK ET , ĊĠĠĠ ĠHi Health Activities . CROSS FIT , ĊĠĠĠ ĠHi Health Activities . CURL ING , ĊĠĠĠ ĠHi Health Activities . CY CL ING , ĊĠĠĠ ĠHi Health Activities . CY CL ING _ IN DO OR , ĊĠĠĠ ĠHi Health Activities . D AN C ING , ĊĠĠĠ ĠHi Health Activities . DIV ING , ĊĠĠĠ ĠHi Health Activities . EL LI PT ICAL , ĊĠĠĠ ĠHi Health Activities . ER GO METER , ĊĠĠĠ ĠHi Health Activities . ES CAL ATOR , ĊĠĠĠ ĠHi Health Activities . F ENC ING , ĊĠĠĠ ĠHi Health Activities . FO OT B ALL _ AM ERIC AN , ĊĠĠĠ ĠHi Health Activities . FO OT B ALL _ AU STR ALI AN , ĊĠĠĠ ĠHi Health Activities . FO OT B ALL _ SO CC ER , ĊĠĠĠ ĠHi Health Activities . FL Y ING _ DIS C , ĊĠĠĠ ĠHi Health Activities . G ARD EN ING , ĊĠĠĠ ĠHi Health Activities . G OL F , ĊĠĠĠ ĠHi Health Activities . GY M NA ST ICS , ĊĠĠĠ ĠHi Health Activities . H AN DB ALL , ĊĠĠĠ ĠHi Health Activities . HI IT , ĊĠĠĠ ĠHi Health Activities . H IK ING , ĊĠĠĠ ĠHi Health Activities . HO CK EY , ĊĠĠĠ ĠHi Health Activities . H OR SE _ RID ING , ĊĠĠĠ ĠHi Health Activities . HO USE WORK , ĊĠĠĠ ĠHi Health Activities . ICE _ SK ATING , ĊĠĠĠ ĠHi Health Activities . INTERVAL _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . JUMP ING _ RO PE , ĊĠĠĠ ĠHi Health Activities . K AY AK ING , ĊĠĠĠ ĠHi Health Activities . K ET TLE B ELL _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . K ICK BOX ING , ĊĠĠĠ ĠHi Health Activities . K ITES UR F ING , ĊĠĠĠ ĠHi Health Activities . MAR TIAL _ ART S , ĊĠĠĠ ĠHi Health Activities . MED IT ATION , ĊĠĠĠ ĠHi Health Activities . MIX ED _ MAR TIAL _ ART S , ĊĠĠĠ ĠHi Health Activities . OTHER , ĊĠĠĠ ĠHi Health Activities . P 9 0 X , ĊĠĠĠ ĠHi Health Activities . PAR AG L ID ING , ĊĠĠĠ ĠHi Health Activities . PI LAT ES , ĊĠĠĠ ĠHi Health Activities . PO LO , ĊĠĠĠ ĠHi Health Activities . R AC QU ET B ALL , ĊĠĠĠ ĠHi Health Activities . RO CK _ CL IM B ING , ĊĠĠĠ ĠHi Health Activities . ROW ING , ĊĠĠĠ ĠHi Health Activities . ROW ING _ MACHINE , ĊĠĠĠ ĠHi Health Activities . RU GB Y , ĊĠĠĠ ĠHi Health Activities . RUNNING , ĊĠĠĠ ĠHi Health Activities . RUNNING _ MACHINE , ĊĠĠĠ ĠHi Health Activities . SA IL ING , ĊĠĠĠ ĠHi Health Activities . SC UB A _ DIV ING , ĊĠĠĠ ĠHi Health Activities . SCO OTER _ RID ING , ĊĠĠĠ ĠHi Health Activities . SK ATE BOARD ING , ĊĠĠĠ ĠHi Health Activities . SK ATING , ĊĠĠĠ ĠHi Health Activities . SK I ING , ĊĠĠĠ ĠHi Health Activities . S LE DD ING , ĊĠĠĠ ĠHi Health Activities . S NOW BOARD ING , ĊĠĠĠ ĠHi Health Activities . S NOW MOB ILE , ĊĠĠĠ ĠHi Health Activities . S NO WS HO E ING , ĊĠĠĠ ĠHi Health Activities . S OF TB ALL , ĊĠĠĠ ĠHi Health Activities . S QU ASH , ĊĠĠĠ ĠHi Health Activities . STA IR _ CL IM B ING , ĊĠĠĠ ĠHi Health Activities . STA IR _ CL IM B ING _ MACHINE , ĊĠĠĠ ĠHi Health Activities . STAND UP _ P ADD LE BOARD ING , ĊĠĠĠ ĠHi Health Activities . ST ILL , ĊĠĠĠ ĠHi Health Activities . STRE NG TH _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . SUR F ING , ĊĠĠĠ ĠHi Health Activities . SW IM M ING , ĊĠĠĠ ĠHi Health Activities . SW IM M ING _ POOL , ĊĠĠĠ ĠHi Health Activities . SW IM M ING _ OPEN _ WATER , ĊĠĠĠ ĠHi Health Activities . TABLE _ TEN N IS , ĊĠĠĠ ĠHi Health Activities . TEAM _ SP ORT S , ĊĠĠĠ ĠHi Health Activities . TEN N IS , ĊĠĠĠ ĠHi Health Activities . T IL TING , ĊĠĠĠ ĠHi Health Activities . VOL LE Y B ALL , ĊĠĠĠ ĠHi Health Activities . WAKE BOARD ING , ĊĠĠĠ ĠHi Health Activities . WAL K ING , ĊĠĠĠ ĠHi Health Activities . WATER _ PO LO , ĊĠĠĠ ĠHi Health Activities . WEIGHT LI FT ING , ĊĠĠĠ ĠHi Health Activities . W HE EL CHA IR , ĊĠĠĠ ĠHi Health Activities . W IND SUR F ING , ĊĠĠĠ ĠHi Health Activities . YO GA , ĊĠĠĠ ĠHi Health Activities . Z UM BA , ĊĠĠĠ ĠHi Health Activities . D ART S , ĊĠĠĠ ĠHi Health Activities . B IL LI AR DS , ĊĠĠĠ ĠHi Health Activities . BO WL ING , ĊĠĠĠ ĠHi Health Activities . GROUP _ C ALIST HEN ICS , ĊĠĠĠ ĠHi Health Activities . T UG _ OF _ WAR , ĊĠĠĠ ĠHi Health Activities . BE ACH _ SO CC ER , ĊĠĠĠ ĠHi Health Activities . BE ACH _ VOL LE Y B ALL , ĊĠĠĠ ĠHi Health Activities . GATE B ALL , ĊĠĠĠ ĠHi Health Activities . SEP AK TA KR AW , ĊĠĠĠ ĠHi Health Activities . DO D GE _ B ALL , ĊĠĠĠ ĠHi Health Activities . T READ M ILL , ĊĠĠĠ ĠHi Health Activities . SP IN NING , ĊĠĠĠ ĠHi Health Activities . ST ROLL _ MACHINE , ĊĠĠĠ ĠHi Health Activities . CROSS _ FIT , ĊĠĠĠ ĠHi Health Activities . FUNCTION AL _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . PHYSICAL _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . B EL LY _ D ANCE , ĊĠĠĠ ĠHi Health Activities . J AZ Z , ĊĠĠĠ ĠHi Health Activities . LAT IN , ĊĠĠĠ ĠHi Health Activities . BAL LET , ĊĠĠĠ ĠHi Health Activities . CORE _ TRAIN ING , ĊĠĠĠ ĠHi Health Activities . HORIZONTAL _ BAR , ĊĠĠĠ ĠHi Health Activities . PAR ALLEL _ BAR S , ĊĠĠĠ ĠHi Health Activities . H IP _ H OP , ĊĠĠĠ ĠHi Health Activities . S QUARE _ D ANCE , ĊĠĠĠ ĠHi Health Activities . HU _ LA _ HO OP , ĊĠĠĠ ĠHi Health Activities . B MX , ĊĠĠĠ ĠHi Health Activities . OR IENT E ER ING , ĊĠĠĠ ĠHi Health Activities . IN DO OR _ WAL K , ĊĠĠĠ ĠHi Health Activities . IN DO OR _ RUNNING , ĊĠĠĠ ĠHi Health Activities . MOUNT IN _ CL IM B ING , ĊĠĠĠ ĠHi Health Activities . CROSS _ COUNTRY _ R ACE , ĊĠĠĠ ĠHi Health Activities . ROLL ER _ SK ATING , ĊĠĠĠ ĠHi Health Activities . H UNT ING , ĊĠĠĠ ĠHi Health Activities . FL Y _ A _ K ITE , ĊĠĠĠ ĠHi Health Activities . SW ING , ĊĠĠĠ ĠHi Health Activities . OB ST AC LE _ R ACE , ĊĠĠĠ ĠHi Health Activities . B UN GE E _ JUMP ING , ĊĠĠĠ ĠHi Health Activities . PAR KO UR , ĊĠĠĠ ĠHi Health Activities . PAR ACH UTE , ĊĠĠĠ ĠHi Health Activities . R ACING _ CAR , ĊĠĠĠ ĠHi Health Activities . TRI ATH L ONS , ĊĠĠĠ ĠHi Health Activities . ICE _ HO CK EY , ĊĠĠĠ ĠHi Health Activities . CROSS COUNTRY _ SK I ING , ĊĠĠĠ ĠHi Health Activities . S LED , ĊĠĠĠ ĠHi Health Activities . F ISH ING , ĊĠĠĠ ĠHi Health Activities . DR IFT ING , ĊĠĠĠ ĠHi Health Activities . DR AG ON _ BO AT , ĊĠĠĠ ĠHi Health Activities . MOTOR BO AT , ĊĠĠĠ ĠHi Health Activities . SUP , ĊĠĠĠ ĠHi Health Activities . FREE _ SP ARR ING , ĊĠĠĠ ĠHi Health Activities . K AR ATE , ĊĠĠĠ ĠHi Health Activities . BODY _ COMB AT , ĊĠĠĠ ĠHi Health Activities . KEN DO , ĊĠĠĠ ĠHi Health Activities . TA I _ CH I Ċ )