/* Ċ Ġ* ĠCopyright Ġ 2 0 2 2 ĠV ital iy ĠZ ar ub in Ċ Ġ* Ċ Ġ* Ġ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 . key gen qt . viewer . android . extensions Ċ Ċ import Ġandroidx . compose . animation .* Ċ import Ġandroidx . compose . animation . core . t ween Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . Disposable Effect Ċ import Ġandroidx . compose . runtime . La unched Effect Ċ import Ġandroidx . compose . ui . Experimental Compose Ui Api Ċ import Ġandroidx . compose . ui . platform . Local Focus Manager Ċ import Ġandroidx . compose . ui . platform . Local Lifecycle Owner Ċ import Ġandroidx . compose . ui . platform . Local Software Keyboard Controller Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġandroidx . navigation . Named Nav Argument Ċ import Ġandroidx . navigation . Nav Back Stack Entry Ċ import Ġandroidx . navigation . Nav Deep Link Ċ import Ġandroidx . navigation . Nav Graph Builder Ċ import Ġcom . google . ac comp an ist . navigation . animation . comp osable Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . channels . Buffer Overflow Ċ import Ġkotlinx . coroutines . flow . Mutable Shared Flow Ċ import Ġkotlinx . coroutines . flow . collect Ċ Ċ /** Ċ Ġ* ĠStates Ġanimation Ċ Ġ*/ Ċ enum Ġclass ĠAnimated Nav Graph State Ġ{ ĊĠĠĠ ĠSTART , ĊĠĠĠ ĠEND Ċ } Ċ Ċ /** Ċ Ġ* ĠShared Flow Ġstate Ġanimation Ċ Ġ*/ Ċ private Ġval Ġstate Animation : ĠMutable Shared Flow < Animated Nav Graph State > Ġ= ĠMutable Shared Flow ( ĊĠĠĠ Ġreplay Ġ= Ġ 1 , ĊĠĠĠ Ġon Buffer Overflow Ġ= ĠBuffer Overflow . DROP _ OL DEST Ċ ) Ċ Ċ /** Ċ Ġ* ĠLa unched Effect Animation Ġfor Ġstate Ġanimation Ċ Ġ*/ Ċ @ Composable Ċ fun ĠLa unched Effect Animation ( ĊĠĠĠ Ġblock : Ġsuspend ĠCor outine Scope .( Animated Nav Graph State ) Ġ-> ĠUnit Ċ ) Ġ{ ĊĠĠĠ ĠLa unched Effect ( Unit ) Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Animation . collect Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock . invoke ( this , Ġit ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠAnimation Ġnavigator Ġapp Ċ Ġ*/ Ċ @ Opt In ( Experimental Animation Api :: class , ĠExperimental Compose Ui Api :: class ) Ċ fun ĠNav Graph Builder . comp osable Animation ( ĊĠĠĠ Ġroute : ĠString , ĊĠĠĠ Ġarguments : ĠList < Named Nav Argument > Ġ= Ġempty List (), ĊĠĠĠ Ġdeep Links : ĠList < Nav Deep Link > Ġ= Ġempty List (), ĊĠĠĠ Ġenter Transition : ĠAnimated Content Scope < Nav Back Stack Entry >. () Ġ-> ĠEnter Transition ? Ġ= Ġ{ ĊĠĠĠĠĠĠĠ ĠfadeIn ( animation Spec Ġ= Ġt ween ( 5 0 0 )) ĊĠĠĠ Ġ}, ĊĠĠĠ Ġexit Transition : Ġ( Animated Content Scope < Nav Back Stack Entry >. () Ġ-> ĠExit Transition ? )? Ġ= Ġ{ ĊĠĠĠĠĠĠĠ Ġfade Out ( animation Spec Ġ= Ġt ween ( 5 0 0 )) ĊĠĠĠ Ġ}, ĊĠĠĠ Ġpop Enter Transition : ĠAnimated Content Scope < Nav Back Stack Entry >. () Ġ-> ĠEnter Transition ? Ġ= Ġ{ ĊĠĠĠĠĠĠĠ ĠfadeIn ( animation Spec Ġ= Ġt ween ( 5 0 0 )) ĊĠĠĠ Ġ}, ĊĠĠĠ Ġpop Exit Transition : Ġ( Animated Content Scope < Nav Back Stack Entry >. () Ġ-> ĠExit Transition ? )? Ġ= Ġ{ ĊĠĠĠĠĠĠĠ Ġfade Out ( animation Spec Ġ= Ġt ween ( 5 0 0 )) ĊĠĠĠ Ġ}, ĊĠĠĠ Ġcontent : Ġ@ Composable ĠAnimated Visibility Scope .( Nav Back Stack Entry ) Ġ-> ĠUnit Ċ ) Ġ= Ġcomp osable ( ĊĠĠĠ Ġroute Ġ= Ġroute , ĊĠĠĠ Ġarguments Ġ= Ġarguments , ĊĠĠĠ Ġdeep Links Ġ= Ġdeep Links , ĊĠĠĠ Ġenter Transition Ġ= Ġenter Transition , ĊĠĠĠ Ġexit Transition Ġ= Ġexit Transition , ĊĠĠĠ Ġpop Enter Transition Ġ= Ġpop Enter Transition , ĊĠĠĠ Ġpop Exit Transition Ġ= Ġpop Exit Transition , Ċ ) Ġ{ ĊĠĠĠ Ġval Ġlifecycle Owner : ĠLifecycle Owner Ġ= ĠLocal Lifecycle Owner . current ĊĠĠĠ Ġval Ġsoftware Keyboard Controller Ġ= ĠLocal Software Keyboard Controller . current ĊĠĠĠ Ġval Ġlocal Focus Manager Ġ= ĠLocal Focus Manager . current ĊĠĠĠ Ġcontent . invoke ( this , Ġit ) ĊĠĠĠ ĠDis posable Effect ( lifecycle Owner ) Ġ{ ĊĠĠĠĠĠĠĠ Ġstate Animation . try Emit ( Animated Nav Graph State . START ) ĊĠĠĠĠĠĠĠ Ġon Dispose Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlocal Focus Manager . clear Focus () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsoftware Keyboard Controller ?. hide () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstate Animation . try Emit ( Animated Nav Graph State . END ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ