package Ġcom . j ep pe man . jet pack playground . video . presentation . detail Ċ Ċ import Ġandroid . graphics . drawable . Animated Vector Drawable Ċ import Ġandroidx . fragment . app . Fragment Activity Ċ import Ġandroidx . test . espress o . Id ling Resource Ċ import Ġandroidx . test . runner . lifecycle . Activity Lifecycle Monitor Registry Ċ import Ġandroidx . test . runner . lifecycle . Stage Ċ import Ġkotlinx . android . synt hetic . main . fragment _ video _ detail .* Ċ Ċ class ĠVideo Detail Animation Id ling Resource Ġ: ĠId ling Resource Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġresource Callback : ĠId ling Resource . Resource Callback ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġvar Ġwas Idle Ġ= Ġfalse ĊĊĠĠĠ Ġoverride Ġfun ĠgetName (): ĠString Ġ= ĠVideo Detail Animation Id ling Resource :: class . java . name ĊĊĠĠĠ Ġoverride Ġfun Ġis Idle Now (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfragment Ġ= Ġ( Activity Lifecycle Monitor Registry . getInstance (). get Activities In Stage ( Stage . RE SU MED ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. first OrNull () Ġas ĠFragment Activity ?) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ? . support FragmentManager ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ? . fragments ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ? . as Sequence () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ? . filter Is Instance ( Video Detail Fragment :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ? . first OrNull () Ġ?: Ġreturn Ġtrue ĊĊĠĠĠĠĠĠĠ Ġval Ġmain Action Is Anim ating Ġ= Ġ( fragment . main Action ?. drawable Ġas ? ĠAnimated Vector Drawable )?. isRunning ĊĠĠĠĠĠĠĠ Ġval Ġfullscreen Play Is Anim ating Ġ= Ġ( fragment . main Action ?. drawable Ġas ? ĠAnimated Vector Drawable )?. isRunning ĊĠĠĠĠĠĠĠ Ġval Ġvolume Button Is Anim ating Ġ= Ġ( fragment . main Action ?. drawable Ġas ? ĠAnimated Vector Drawable )?. isRunning ĊĠĠĠĠĠĠĠ Ġval Ġarc View Anim ating Ġ= Ġfragment . arc ?. is Anim ating ĊĠĠĠĠĠĠĠ Ġval Ġidle Ġ= Ġmain Action Is Anim ating Ġ!= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ&& Ġfullscreen Play Is Anim ating Ġ!= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ&& Ġvolume Button Is Anim ating Ġ!= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ&& Ġarc View Anim ating Ġ!= Ġtrue ĊĊĠĠĠĠĠĠĠ Ġif Ġ( idle ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwas Idle Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresource Callback ?. on Transition To Idle () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġidle ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġregister Idle Transition Callback ( callback : ĠId ling Resource . Resource Callback ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġresource Callback Ġ= Ġcallback ĊĠĠĠ Ġ} Ċ }