package Ġcom . un happy choice . d roid fly er . presentation . view ĊĊ Ċ import Ġandroid . content . Context Ċ import Ġandroid . util . Attribute Set Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . github . sal om on br ys . kode in . instance Ċ import Ġcom . un happy choice . d roid fly er . extension . subscribe Next Ċ import Ġcom . un happy choice . d roid fly er . extension . subscribe On Io Ob serve On UI Ċ import Ġcom . un happy choice . d roid fly er . presentation . adapter . Order Adapter Ċ import Ġcom . un happy choice . d roid fly er . presentation . presenter . Orders Presenter Ċ import Ġcom . un happy choice . d roid fly er . presentation . view . core . Base View Ċ import Ġio . reactivex . rx kotlin . addTo Ċ import Ġkotlinx . android . synt hetic . main . orders _ view . view .* Ċ Ċ class ĠOrders View ( context : ĠContext ?, Ġattr : ĠAttributeSet ?) Ġ: ĠBase View ( context , Ġattr ) Ġ{ ĊĠĠĠ Ġval Ġpresenter : ĠOrders Presenter Ġby Ġinstance () ĊĠĠĠ Ġprivate Ġval Ġorder Adapter Ġby Ġlazy Ġ{ ĠOrder Adapter ( context ) Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Attached To Window () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Attached To Window () ĊĠĠĠĠĠĠĠ Ġpresenter . take View ( this ) ĊĊĠĠĠĠĠĠĠ Ġorder List . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( context , ĠRecyclerView . VERTICAL , Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġorder Adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġpresenter . current Status Service . orders . as Observable () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On Io Ob serve On UI () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe Next Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġorder Adapter . items . value Ġ= Ġit ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġorder Adapter . notify DataSet Changed () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}. addTo ( bag ) ĊĊĠĠĠĠĠĠĠ Ġorder Adapter . click Cancel ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe On Io Ob serve On UI () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. subscribe Next Ġ{ Ġpresenter . cancel Order ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. addTo ( bag ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Detached From Window () Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter . drop View ( this ) ĊĠĠĠĠĠĠĠ Ġsuper . on Detached From Window () ĊĠĠĠ Ġ} Ċ } Ċ