package Ġbr . alex and reg per e ira . j erry . animation . expand able Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . view . View . Measure Spec Ċ import Ġandroid . view . ViewGroup Ċ import Ġbr . alex and reg per e ira . j erry . R Ċ import Ġbr . alex and reg per e ira . j erry . Spring Animation Property Key Ċ import Ġbr . alex and reg per e ira . j erry . visible Ċ Ċ internal Ġfun Ġget Expand ing Col lap sing Spring Key ( is Height : ĠBoolean ): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( is Height ) Ġ{ ĊĠĠĠĠĠĠĠ ĠSpring Animation Property Key . HEIGHT . id ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ ĠSpring Animation Property Key . WIDTH . id ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠView . finish Expand ing Col lap sing Animation ( ĊĠĠĠ Ġis Height : ĠBoolean , ĊĠĠĠ Ġcanceled : ĠBoolean , ĊĠĠĠ Ġon Animation End : Ġ(( c anceled : ĠBoolean ) Ġ-> ĠUnit )? Ċ ) Ġ{ ĊĠĠĠ Ġclear Width Or Height Original Value ( is Height ) ĊĠĠĠ Ġclear Expand ing Col lap sing Running () ĊĠĠĠ Ġon Animation End ?. invoke ( c anceled ) Ċ } Ċ Ċ internal Ġfun ĠView . setLayout Param Size ( value : ĠInt , Ġis Height : ĠBoolean ) Ġ{ ĊĠĠĠ Ġif Ġ( is Height ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlayout Params . height Ġ= Ġvalue ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġlayout Params . width Ġ= Ġvalue ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠView . get Layout Param Size ( is Height : ĠBoolean ): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( is Height ) Ġlayout Params . height Ġelse Ġlayout Params . width Ċ } ĊĊ Ċ internal Ġfun ĠView . is Expand ing Col lap sing Running ( animation Mode : ĠAnimation Mode ): ĠBoolean Ġ= ĊĠĠĠ Ġis Animation Running ( R . string . is _ expand ing _ coll ap sing _ key , Ġanimation Mode ) Ċ Ċ internal Ġfun ĠView . set Expand ing Col lap sing Running ( animation Mode : ĠAnimation Mode ) Ġ= ĊĠĠĠ Ġset Animation Running ( R . string . is _ expand ing _ coll ap sing _ key , Ġanimation Mode ) Ċ Ċ internal Ġfun ĠView . is Expand ing Running () Ġ= ĊĠĠĠ Ġis Expand ing Col lap sing Running ( Animation Mode . ENTER _ ANIM ATION _ MODE ) Ċ Ċ internal Ġfun ĠView . is Col lap sing Running () Ġ= ĊĠĠĠ Ġis Expand ing Col lap sing Running ( Animation Mode . POP _ ANIM ATION _ MODE ) Ċ Ċ internal Ġfun ĠView . clear Expand ing Col lap sing Running () Ġ= ĊĠĠĠ Ġset Expand ing Col lap sing Running ( Animation Mode . NONE _ ANIM ATION _ MODE ) Ċ Ċ internal Ġfun ĠView . start Expand ing Running () Ġ= ĊĠĠĠ Ġset Expand ing Col lap sing Running ( Animation Mode . ENTER _ ANIM ATION _ MODE ) Ċ Ċ internal Ġfun ĠView . start Col lap sing Running () Ġ= ĊĠĠĠ Ġset Expand ing Col lap sing Running ( Animation Mode . POP _ ANIM ATION _ MODE ) Ċ Ċ internal Ġfun ĠView . get Col lap sing Initial Value ( is Height : ĠBoolean ): ĠInt Ġ{ ĊĠĠĠ Ġval Ġvalue Ġ= Ġget Layout Param Size ( is Height ) ĊĠĠĠ Ġreturn Ġvalue . take If Ġ{ Ġit Ġ> Ġ 0 Ġ} Ġ?: Ġrun Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( is Height ) Ġmeasured Height Ġelse Ġmeasured Width ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠView . get Or Store Width Or Height Original Value ( is Height : ĠBoolean ): ĠInt Ġ{ ĊĠĠĠ Ġval Ġkey Ġ= Ġget Width Or Height Original Value Key ( is Height ) ĊĠĠĠ Ġreturn Ġrun Catch ing Ġ{ ĊĠĠĠĠĠĠĠ Ġget Tag ( key ) Ġas ĠInt ĊĠĠĠ Ġ}. getOrElse Ġ{ ĊĠĠĠĠĠĠĠ Ġ( get Layout Param Size ( is Height )). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Tag ( key , Ġthis ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun Ġget Width Or Height Original Value Key ( is Height : ĠBoolean ): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( is Height ) Ġ{ ĊĠĠĠĠĠĠĠ ĠOriginal Value Key . HEIGHT . id ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ ĠOriginal Value Key . WIDTH . id ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠView . clear Width Or Height Original Value ( is Height : ĠBoolean ) Ġ{ ĊĠĠĠ Ġrun Catch ing Ġ{ ĊĠĠĠĠĠĠĠ Ġset Tag ( getWidth Or Height Original Value Key ( is Height ), Ġnull ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠView . getTarget Value ( original Value : ĠInt , Ġis Height : ĠBoolean ): ĠInt ? Ġ{ ĊĠĠĠ Ġif Ġ( original Value Ġ> Ġ 0 ) Ġreturn Ġoriginal Value ĊĊĠĠĠ Ġval Ġparent Size Ġ= Ġ( parent Ġas ĠView ). width ĊĠĠĠ Ġif Ġ( parent Size Ġ== Ġ 0 ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvisible () ĊĠĠĠĠĠĠĠ Ġreturn Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( original Value Ġ== ĠViewGroup . LayoutParams . MATCH _ PARENT Ġ|| Ġoriginal Value Ġ== Ġ 0 ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġparent Size ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġmeasure ( ĊĠĠĠĠĠĠĠ ĠMeasure Spec . make Measure Spec ( 0 , ĠMeasure Spec . UNSPECIFIED ), ĊĠĠĠĠĠĠĠ ĠMeasure Spec . make Measure Spec ( 0 , ĠMeasure Spec . UNSPECIFIED ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġreturn Ġif Ġ( is Height ) Ġmeasured Height Ġelse Ġmeasured Width Ċ } ĊĊĊ