package Ġau . com . meal planner . meal planner . feature . add Me al Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . design . widget . Snackbar . LENGTH _ LONG Ċ import Ġandroid . support . design . widget . Snackbar . make Ċ import Ġandroid . view . Menu Ċ import Ġandroid . view . MenuItem Ċ import Ġau . com . meal planner . meal planner . R Ċ import Ġau . com . meal planner . meal planner . base . Base Activity Ċ import Ġau . com . meal planner . meal planner . data . model . DayOfWeek Ċ import Ġau . com . meal planner . meal planner . data . model . Me al Ċ import Ġau . com . meal planner . meal planner . feature . main . Week ly Plan Activity Ċ import Ġdagger . android . Android Injection Ċ import Ġkotlinx . android . synt hetic . main . add _ meal _ activity .* Ċ import Ġjava . io . Serializable Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠAdd Me al Activity Ġ: ĠBase Activity (), ĠAdd Me al View Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġgo To Me al Plan With New Me al ( meal : ĠMe al , Ġday OfWeek : ĠDay OfWeek ) Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġintent Ġ= ĠIntent ( this , ĠWeek ly Plan Activity :: class . java ) ĊĠĠĠĠĠĠĠ Ġintent . putExtra (" added _ meal ", Ġme al Ġas ĠSerializable ) ĊĠĠĠĠĠĠĠ Ġintent . putExtra (" added _ meal _ day _ of _ week ", Ġday OfWeek Ġas ĠSerializable ) ĊĠĠĠĠĠĠĠ Ġset Result ( RESULT _ OK , Ġintent ) ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Layout Id (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠR . layout . add _ meal _ activity ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġactivity Presenter : ĠAdd Me al Activity Presenter ĊĊĠĠĠ Ġoverride Ġfun Ġinject () Ġ{ ĊĠĠĠĠĠĠĠ ĠAndroid Injection . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Error () Ġ{ ĊĠĠĠĠĠĠĠ Ġmake ( add _ meal _ container , Ġ" O ops ", ĠLEN GTH _ LONG ). show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġday OfWeek : ĠDay OfWeek ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġactivity Presenter . setView ( this ) ĊĠĠĠĠĠĠĠ Ġday OfWeek Ġ= Ġintent . extras . get (" DAY _ OF _ WEEK ") Ġas ĠDay OfWeek ĊĠĠĠĠĠĠĠ Ġsupport ActionBar ?. set Display Home As Up Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġsupport ActionBar ?. set Home As Up Indicator ( R . drawable . ic _ close _ white ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate Options Menu ( menu : ĠMenu ?): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġmenu Inflater . inflate ( R . menu . confirm _ menu , Ġmenu ) ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Options ItemSelected ( item : ĠMenuItem ?): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġwhen Ġ( item ?. itemId ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . confirm _ action Ġ-> Ġactivity Presenter . on Confirm Add Me al ( meal _ name _ edit Text . text . toString (), Ġday OfWeek ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġsuper . on Options ItemSelected ( item ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} Ċ }