package Ġcom . github . vs ay 0 1 . mvp setup . mvp Ċ Ċ import Ġcom . android . tools . idea . wizard . template . Module Template Data Ċ import Ġcom . android . tools . idea . wizard . template . Recipe Executor Ċ import Ġcom . android . tools . idea . wizard . template . impl . activities . common . addAll Kotlin Dependencies Ċ import Ġcom . android . tools . idea . wizard . template . impl . activities . common . generate Manifest Ċ import Ġcom . github . vs ay 0 1 . mvp setup . listeners . My Project Manager Listener . Companion . project Instance Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . classes . create Activity Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . classes . create Contract Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . classes . create Fragment Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . classes . create Presenter Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . layout . create Activity Layout Ċ import Ġcom . github . vs ay 0 1 . mvp setup . mvp . template . layout . create Fragment Layout Ċ import Ġcom . intellij . openapi . roots . Project Root Manager Ċ import Ġcom . intellij . psi . Psi Directory Ċ import Ġcom . intellij . psi . Psi File Factory Ċ import Ġcom . intellij . psi . Psi Manager Ċ import Ġorg . jetbrains . kotlin . idea . Kotlin Language Ċ Ċ fun ĠRecipe Executor . mvp Setup ( ĊĠĠĠ Ġmodule Data : ĠModule Template Data , ĊĠĠĠ ĠpackageName : ĠString , ĊĠĠĠ ĠclassName : ĠString , ĊĠĠĠ Ġactivity Layout Name : ĠString , ĊĠĠĠ Ġfragment Layout Name : ĠString Ċ ) Ġ{ ĊĠĠĠ Ġval Ġ( project Data ) Ġ= Ġmodule Data ĊĠĠĠ Ġval Ġproject Ġ= Ġproject Instance Ġ?: Ġreturn ĊĊĠĠĠ Ġadd All Kotlin Dependencies ( module Data ) ĊĊĠĠĠ Ġval Ġvirtual Files Ġ= ĠProject Root Manager . getInstance ( project ). content Source Roots ĊĠĠĠ Ġval Ġvirt Src Ġ= Ġvirtual Files . first Ġ{ Ġit . path . contains (" src ") Ġ} ĊĠĠĠ Ġval Ġvirt Res Ġ= Ġvirtual Files . first Ġ{ Ġit . path . contains (" res ") Ġ} ĊĠĠĠ Ġval Ġdirectory Src Ġ= ĠPsi Manager . getInstance ( project ). find Directory ( virt Src ) !! ĊĠĠĠ Ġval Ġdirectory Res Ġ= ĠPsi Manager . getInstance ( project ). find Directory ( virt Res ) !! ĊĊĠĠĠ Ġval Ġactivity Class Ġ= Ġ"${ className } Activity ". capitalize () ĊĠĠĠ Ġval Ġfragment Class Ġ= Ġ"${ className } Fragment ". capitalize () ĊĠĠĠ Ġval Ġcontract Class Ġ= Ġ"${ className } Contract ". capitalize () ĊĠĠĠ Ġval Ġpresenter Class Ġ= Ġ"${ className } Presenter ". capitalize () ĊĠĠĠ Ġval Ġactivity Title Ġ= Ġ"$ className ĠActivity ". capitalize () ĊĊĠĠĠ Ġ// ĠThis Ġwill Ġgenerate Ġnew Ġmanifest Ġ( with Ġactivity ) Ġto Ġmerge Ġit Ġwith Ġexisting ĊĠĠĠ Ġgenerate Manifest ( ĊĠĠĠĠĠĠĠ Ġmodule Data , Ġactivity Class , Ġactivity Title , ĠpackageName , ĊĠĠĠĠĠĠĠ Ġis Launcher Ġ= Ġfalse , Ġhas No ActionBar Ġ= Ġtrue , Ġgenerate Activity Title Ġ= Ġtrue ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġcreate Activity ( packageName , ĠclassName , Ġactivity Layout Name , Ġproject Data ) ĊĠĠĠĠĠĠĠ Ġ. save ( directory Src , ĠpackageName , Ġ"$ activity Class . kt ") ĊĊĠĠĠ Ġcreate Contract ( packageName , ĠclassName ) ĊĠĠĠĠĠĠĠ Ġ. save ( directory Src , ĠpackageName , Ġ"$ contract Class . kt ") ĊĊĠĠĠ Ġcreate Fragment ( packageName , ĠclassName , Ġfragment Layout Name , Ġproject Data ) ĊĠĠĠĠĠĠĠ Ġ. save ( directory Src , ĠpackageName , Ġ"$ fragment Class . kt ") ĊĊĠĠĠ Ġcreate Presenter ( packageName , ĠclassName ) ĊĠĠĠĠĠĠĠ Ġ. save ( directory Src , ĠpackageName , Ġ"$ presenter Class . kt ") ĊĊĠĠĠ Ġcreate Activity Layout ( packageName , ĠclassName ) ĊĠĠĠĠĠĠĠ Ġ. save ( directory Res , Ġ" layout ", Ġ"${ activity Layout Name }_ layout . xml ") ĊĊĠĠĠ Ġcreate Fragment Layout () ĊĠĠĠĠĠĠĠ Ġ. save ( directory Res , Ġ" layout ", Ġ"${ fragment Layout Name }_ layout . xml ") Ċ } Ċ Ċ fun ĠString . save ( src Dir : ĠPsi Directory , Ġsub DirPath : ĠString , ĠfileName : ĠString ) Ġ{ ĊĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdest Dir Ġ= Ġsub DirPath . split (". "). to Dir ( src Dir ) ĊĠĠĠĠĠĠĠ Ġval Ġpsi File Ġ= ĠPsi File Factory ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. getInstance ( src Dir . project ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create File FromText ( fileName , ĠKotlin Language . INSTANCE , Ġthis ) ĊĠĠĠĠĠĠĠ Ġdest Dir . add ( psi File ) ĊĠĠĠ Ġ} Ġcatch Ġ( exc : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠ Ġexc . printStackTrace () ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠList < String >. to Dir ( src Dir : ĠPsi Directory ): ĠPsi Directory Ġ{ ĊĠĠĠ Ġvar Ġresult Ġ= Ġsrc Dir ĊĠĠĠ ĠforEach Ġ{ ĊĠĠĠĠĠĠĠ Ġresult Ġ= Ġresult . find Sub directory ( it ) Ġ?: Ġresult . create Sub directory ( it ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġresult Ċ } Ċ