package Ġcom . tal entic a . android kotlin . custom camera . ui . landing Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . design . widget . Floating ActionButton Ċ import Ġandroid . support . design . widget . Navigation View Ċ import Ġandroid . support . v 4 . view . Gravity Compat Ċ import Ġandroid . support . v 4 . widget . Drawer Layout Ċ import Ġandroid . support . v 7 . app . ActionBar Drawer Toggle Ċ import Ġandroid . view . MenuItem Ċ import Ġandroid . view . View Ċ import Ġandroid . widget . Adapter View Ċ import Ġandroid . widget . GridView Ċ import Ġandroid . widget . TextView Ċ import Ġandroid . widget . Toast Ċ import Ġbutter knife . bind View Ċ import Ġcom . tal entic a . android kotlin . custom camera . R Ċ import Ġcom . tal entic a . android kotlin . custom camera . adapter . landing . Landing Gallery Adapter Ċ import Ġcom . tal entic a . android kotlin . custom camera . d agger . Has Component Ċ import Ġcom . tal entic a . android kotlin . custom camera . d agger . landing . Landing Activity Component Ċ import Ġcom . tal entic a . android kotlin . custom camera . d agger . landing . Landing Activity Component Assembler Ċ import Ġcom . tal entic a . android kotlin . custom camera . presenter . Activity Presenter Ċ import Ġcom . tal entic a . android kotlin . custom camera . presenter . landing . Landing Activity Presenter Ċ import Ġcom . tal entic a . android kotlin . custom camera . ui . Slow ka Activity Ċ import Ġcom . tal entic a . android kotlin . custom camera . ui . camera . Camera Activity Ċ import Ġjavax . inject . Inject Ċ import Ġandroid . content . Intent Ċ import Ġandroid . net . Uri ĊĊ Ċ class ĠLand ing Activity Ġ: ĠS low ka Activity < Landing Activity View >(), ĠLand ing Activity View , ĊĠĠĠĠĠĠĠ ĠHas Component < Landing Activity Component ? >, ĠAdapter View . On ItemClickListener Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġprotected Ġlateinit Ġvar Ġpresenter : ĠLand ing Activity Presenter ĊĠĠĠ Ġoverride Ġvar Ġcomponent : ĠLand ing Activity Component ? Ġ= Ġnull ĊĠĠĠ Ġoverride Ġval Ġactivity Presenter : ĠActivity Presenter < Landing Activity View > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġpresenter ĊĊĠĠĠ Ġval Ġnavigation View : ĠNavigation View Ġby Ġbind View ( R . id . nav _ view ) ĊĠĠĠ Ġval Ġgrid View : ĠGrid View Ġby Ġbind View ( R . id . grid view ) ĊĠĠĠ Ġval Ġempty View : ĠTextView Ġby Ġbind View ( R . id . empty view ) ĊĠĠĠ Ġval Ġdrawer : ĠDraw er Layout Ġby Ġbind View ( R . id . drawer _ layout ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView With Toolbar ( R . layout . activity _ landing , Ġtrue ) ĊĊĠĠĠĠĠĠĠ Ġval Ġfab Ġ= ĠfindViewById < Floating ActionButton >( R . id . fab ) ĊĠĠĠĠĠĠĠ Ġfab . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( Camera Activity . create Intent ( this )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġtoggle Ġ= ĠAction Bar Drawer Toggle ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthis , Ġdrawer , Ġtoolbar , ĠR . string . navigation _ drawer _ open , ĠR . string . navigation _ drawer _ close ) ĊĠĠĠĠĠĠĠ Ġdrawer . set Drawer Listener ( toggle ) ĊĠĠĠĠĠĠĠ Ġtoggle . sync State () ĊĠĠĠĠĠĠĠ Ġgrid View . empty View Ġ= Ġempty View ĊĊĠĠĠĠĠĠĠ Ġset D agger Component ( Landing Activity Component Assembler . assemble ( application )) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Post Create ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Post Create ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġattach Presenter ( this , Ġthis , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġnavigation View . set Navigation ItemSelected Listener ( presenter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Adapter ( adapter : ĠLand ing Gallery Adapter ) Ġ{ ĊĠĠĠĠĠĠĠ Ġgrid View . setAdapter ( adapter ) ĊĠĠĠĠĠĠĠ Ġgrid View . setOn ItemClickListener ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Item Click ( parent : ĠAdapter View < *> ?, Ġview : ĠView ?, Ġposition : ĠInt , Ġid : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter . la uch Photo Preview ( position ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ Ġpresenter . resume () ĊĠĠĠĠĠĠĠ Ġpresenter . add ListOf P ics To Adapter ( grid View ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Request Permissions Result ( request Code : ĠInt , Ġpermissions : ĠArray < out ĠString >, Ġgrant Results : ĠInt Array ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Request Permissions Result ( request Code , Ġpermissions , Ġgrant Results ) ĊĠĠĠĠĠĠĠ Ġpresenter . on Request Permissions Result ( request Code , Ġgrant Results ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġset D agger Component ( component : ĠLand ing Activity Component ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . component Ġ= Ġcomponent ĊĠĠĠĠĠĠĠ Ġthis . component ?. inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ Ġclose Drawer () ĊĠĠĠĠĠĠĠ Ġsuper . on Back Pressed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclose Drawer () Ġ{ ĊĠĠĠĠĠĠĠ Ġdrawer . close Drawer ( Gravity Compat . START ) ĊĠĠĠ Ġ} Ċ } Ċ