package Ġcom . hard iks ach an . ledger . ui . base Ċ Ċ import Ġandroidx . compose . animation .* Ċ import Ġandroidx . compose . animation . core .* Ċ import Ġandroidx . compose . ui . unit . Int Offset Ċ import Ġandroidx . navigation . Nav Back Stack Entry Ċ import Ġcom . hard iks ach an . ledger . ui . theme . Motion Transition Ċ Ċ enum Ġclass ĠNav Transition ( val Ġspecs : Ġ( motion Values : ĠMotion Transition ) Ġ-> ĠNav Transition Specs ) Ġ{ ĊĠĠĠ ĠDefault ({ Ġmotion Values Ġ-> Ġdefault Specs ( motion Values ) Ġ}), ĊĠĠĠ ĠF ade Through ({ Ġmotion Values Ġ-> Ġfade Through Specs ( motion Values ) Ġ}), ĊĠĠĠ ĠShared Axis X ({ Ġmotion Values Ġ-> Ġshared Axis X Specs ( motion Values ) Ġ}), ĊĠĠĠ ĠShared Axis Y ({ Ġmotion Values Ġ-> Ġshared Axis Y Specs ( motion Values ) Ġ}), ĊĠĠĠ ĠShared Axis Z ({ Ġmotion Values Ġ-> Ġshared Axis Z Specs ( motion Values ) Ġ}), ĊĠĠĠ ĠShared Axis ZF ade ({ Ġmotion Values Ġ-> Ġshared Axis ZF ade Specs ( motion Values ) Ġ}); ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠARG _ KEY Ġ= Ġ" nav _ transition " ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ fun ĠAnimated Content Scope < Nav Back Stack Entry >. get Enter Transition ( motion Values : ĠMotion Transition ) Ġ= ĊĠĠĠ Ġtarget State . get Transition (). specs ( motion Values ). enter Transition Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ fun ĠAnimated Content Scope < Nav Back Stack Entry >. get Exit Transition ( motion Values : ĠMotion Transition ) Ġ= ĊĠĠĠ Ġtarget State . get Transition (). specs ( motion Values ). exit Transition Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ fun ĠAnimated Content Scope < Nav Back Stack Entry >. get Pop Enter Transition ( motion Values : ĠMotion Transition ) Ġ= ĊĠĠĠ ĠinitialState . get Transition (). specs ( motion Values ). pop Enter Transition Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ fun ĠAnimated Content Scope < Nav Back Stack Entry >. get Pop Exit Transition ( ĊĠĠĠ Ġmotion Values : ĠMotion Transition Ċ ): ĠExit Transition Ġ= ĠinitialState . get Transition (). specs ( motion Values ). pop Exit Transition Ċ Ċ private Ġfun ĠNav Back Stack Entry . get Transition () Ġ= ĊĠĠĠ Ġwhen Ġ( val Ġtransition Ġ= Ġ( arguments ?. get ( Nav Transition . ARG _ KEY ))) Ġ{ ĊĠĠĠĠĠĠĠ Ġis ĠString Ġ-> Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNav Transition . valueOf ( transition ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠThrowable ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNav Transition . Default ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġis ĠNav Transition Ġ-> Ġtransition ĊĠĠĠĠĠĠĠ Ġelse Ġ-> ĠNav Transition . Default ĊĠĠĠ Ġ} Ċ Ċ data Ġclass ĠNav Transition Specs ( ĊĠĠĠ Ġval Ġenter Transition : ĠEnter Transition , ĊĠĠĠ Ġval Ġexit Transition : ĠExit Transition , ĊĠĠĠ Ġval Ġpop Enter Transition : ĠEnter Transition , ĊĠĠĠ Ġval Ġpop Exit Transition : ĠExit Transition , Ċ ) Ċ Ċ private Ġfun Ġdefault Specs ( motion Values : ĠMotion Transition ) Ġ= Ġfade Through Specs ( motion Values ) Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ private Ġfun Ġfade Through Specs ( motion Values : ĠMotion Transition ) Ġ= ĠNav Transition Specs ( ĊĠĠĠ Ġenter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġexit Transition Ġ= Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), ĊĠĠĠ Ġpop Enter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġpop Exit Transition Ġ= Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), Ċ ) Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ private Ġfun Ġshared Axis X Specs ( motion Values : ĠMotion Transition ) Ġ= ĠNav Transition Specs ( ĊĠĠĠ Ġenter Transition Ġ= Ġslide In ( ĊĠĠĠĠĠĠĠ Ġinitial Offset Ġ= Ġ{ ĠInt Offset ( motion Values . transition Slide , Ġ 0 ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġexit Transition Ġ= Ġslide Out ( ĊĠĠĠĠĠĠĠ Ġtarget Offset Ġ= Ġ{ ĠInt Offset (- motion Values . transition Slide , Ġ 0 ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), ĊĠĠĠ Ġpop Enter Transition Ġ= Ġslide In ( ĊĠĠĠĠĠĠĠ Ġinitial Offset Ġ= Ġ{ ĠInt Offset (- motion Values . transition Slide , Ġ 0 ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġpop Exit Transition Ġ= Ġslide Out ( ĊĠĠĠĠĠĠĠ Ġtarget Offset Ġ= Ġ{ ĠInt Offset ( motion Values . transition Slide , Ġ 0 ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), Ċ ) Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ private Ġfun Ġshared Axis Y Specs ( motion Values : ĠMotion Transition ) Ġ= ĠNav Transition Specs ( ĊĠĠĠ Ġenter Transition Ġ= Ġslide In ( ĊĠĠĠĠĠĠĠ Ġinitial Offset Ġ= Ġ{ ĠInt Offset ( 0 , Ġmotion Values . transition Slide ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġexit Transition Ġ= Ġslide Out ( ĊĠĠĠĠĠĠĠ Ġtarget Offset Ġ= Ġ{ ĠInt Offset ( 0 , Ġ- motion Values . transition Slide ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), ĊĠĠĠ Ġpop Enter Transition Ġ= Ġslide In ( ĊĠĠĠĠĠĠĠ Ġinitial Offset Ġ= Ġ{ ĠInt Offset ( 0 , Ġ- motion Values . transition Slide ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġpop Exit Transition Ġ= Ġslide Out ( ĊĠĠĠĠĠĠĠ Ġtarget Offset Ġ= Ġ{ ĠInt Offset ( 0 , Ġmotion Values . transition Slide ) Ġ}, ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), Ċ ) Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ private Ġfun Ġshared Axis Z Specs ( motion Values : ĠMotion Transition ) Ġ= ĠNav Transition Specs ( ĊĠĠĠ Ġenter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġexit Transition Ġ= Ġscale Out ( ĊĠĠĠĠĠĠĠ Ġtarget Scale Ġ= Ġmotion Values . transition Target Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), ĊĠĠĠ Ġpop Enter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Target Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġt ween ( 3 0 0 , Ġeasing Ġ= ĠFast Out Slow In E asing ) ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( animation Spec Ġ= Ġmotion Values . entr ance Delayed Animation Spec ()), ĊĠĠĠ Ġpop Exit Transition Ġ= Ġscale Out ( ĊĠĠĠĠĠĠĠ Ġtarget Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( animation Spec Ġ= Ġmotion Values . exit Animation Spec ()), Ċ ) Ċ Ċ @ Opt In ( Experimental Animation Api :: class ) Ċ private Ġfun Ġshared Axis ZF ade Specs ( motion Values : ĠMotion Transition ) Ġ= ĠNav Transition Specs ( ĊĠĠĠ Ġenter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ ĠfadeIn ( ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġt ween ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmotion Values . duration Fraction ( Z _ FA DE _ FR ACTION ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelay Millis Ġ= Ġmotion Values . duration Fraction ( Z _ FA DE _ FR ACTION ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeasing Ġ= ĠLinear E asing , ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ), ĊĠĠĠ Ġexit Transition Ġ= Ġscale Out ( ĊĠĠĠĠĠĠĠ Ġtarget Scale Ġ= Ġmotion Values . transition Target Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ), ĊĠĠĠ Ġpop Enter Transition Ġ= Ġscale In ( ĊĠĠĠĠĠĠĠ Ġinitial Scale Ġ= Ġmotion Values . transition Target Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ), ĊĠĠĠ Ġpop Exit Transition Ġ= Ġscale Out ( ĊĠĠĠĠĠĠĠ Ġtarget Scale Ġ= Ġmotion Values . transition Initial Scale , ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġmotion Values . entr ance Animation Spec (), ĊĠĠĠ Ġ) Ġ+ Ġfade Out ( ĊĠĠĠĠĠĠĠ Ġanimation Spec Ġ= Ġt ween ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmotion Values . duration Fraction ( Z _ FA DE _ FR ACTION ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelay Millis Ġ= Ġmotion Values . duration Fraction ( Z _ FA DE _ FR ACTION ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeasing Ġ= ĠLinear E asing , ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ), Ċ ) Ċ Ċ private Ġfun Ġ< T > ĠMotion Transition . entr ance Animation Spec () Ġ= Ġt ween < T >( ĊĠĠĠ Ġtransition Duration . toInt (), ĊĠĠĠ Ġeasing Ġ= ĠFast Out Slow In E asing , Ċ ) Ċ Ċ private Ġfun Ġ< T > ĠMotion Transition . entr ance Delayed Animation Spec () Ġ= Ġt ween < T >( ĊĠĠĠ Ġduration Millis Ġ= Ġduration Fraction ( ENTR ANCE _ FR ACTION ), ĊĠĠĠ Ġdelay Millis Ġ= Ġ( transition Duration Ġ* ĠEXIT _ FR ACTION ). toInt (), ĊĠĠĠ Ġeasing Ġ= ĠLinear Out Slow In E asing , Ċ ) Ċ Ċ private Ġfun Ġ< T > ĠMotion Transition . exit Animation Spec () Ġ= Ġt ween < T >( ĊĠĠĠ Ġduration Millis Ġ= Ġduration Fraction ( EXIT _ FR ACTION ), ĊĠĠĠ Ġeasing Ġ= ĠFast Out Linear In E asing , Ċ ) Ċ Ċ private Ġfun ĠMotion Transition . duration Fraction ( fraction : ĠDouble ) Ġ= ĊĠĠĠ Ġ( transition Duration Ġ* Ġfraction ). toInt () Ċ Ċ private Ġconst Ġval ĠEN TR ANCE _ FR ACTION Ġ= Ġ 0 . 7 Ċ private Ġconst Ġval ĠEXIT _ FR ACTION Ġ= Ġ 0 . 3 Ċ private Ġconst Ġval ĠZ _ FA DE _ FR ACTION Ġ= Ġ 0 . 2 Ċ