package Ġru . ter r ak ok . gitlab client . ui . libraries Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . h ann es dor fm ann . adapter deleg ates 4 . List Deleg ation Adapter Ċ import Ġkotlinx . android . synt hetic . main . fragment _ libraries .* Ċ import Ġm oxy . presenter . Inject Presenter Ċ import Ġm oxy . presenter . Provide Presenter Ċ import Ġru . ter r ak ok . gitlab client . R Ċ import Ġru . ter r ak ok . gitlab client . di . DI Ċ import Ġru . ter r ak ok . gitlab client . presentation . libraries . Libraries Presenter Ċ import Ġru . ter r ak ok . gitlab client . presentation . libraries . Libraries View Ċ import Ġru . ter r ak ok . gitlab client . system . App Library Ċ import Ġru . ter r ak ok . gitlab client . ui . global . Base Fragment Ċ import Ġru . ter r ak ok . gitlab client . ui . global . list . App Library Adapter Delegate Ċ import Ġru . ter r ak ok . gitlab client . util . add System Bottom Padding Ċ import Ġru . ter r ak ok . gitlab client . util . add System Top Padding Ċ import Ġru . ter r ak ok . gitlab client . util . try Open Link Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠKon st ant in ĠT sk h ov re bo v Ġ( aka Ġ@ ter r ak ok ) Ġon Ġ 2 4 . 1 2 . 1 7 . Ċ Ġ*/ Ċ class ĠLibraries Fragment Ġ: ĠBase Fragment (), ĠLibraries View Ġ{ ĊĠĠĠ Ġoverride Ġval Ġlayout Res Ġ= ĠR . layout . fragment _ libraries ĊĊĠĠĠ Ġoverride Ġval Ġparent Scope Name Ġ= ĠDI . APP _ SCOPE ĊĊĠĠĠ Ġprivate Ġval Ġadapter : ĠLibrary Adapter Ġby Ġlazy Ġ{ ĠLibrary Adapter () Ġ} ĊĊĠĠĠ Ġ@ Inject Presenter ĊĠĠĠ Ġlateinit Ġvar Ġpresenter : ĠLibraries Presenter ĊĊĠĠĠ Ġ@ Provide Presenter ĊĠĠĠ Ġfun Ġprovide Presenter (): ĠLibraries Presenter Ġ= ĊĠĠĠĠĠĠĠ Ġscope . getInstance ( Libraries Presenter :: class . java ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Created ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġtoolbar . set Navigation OnClickListener Ġ{ Ġpresenter . on Back Pressed () Ġ} ĊĠĠĠĠĠĠĠ Ġtoolbar . add System Top Padding () ĊĊĠĠĠĠĠĠĠ Ġwith ( re cyclerView ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd System Bottom Padding () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġthis @ Libraries Fragment . adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Libraries ( libraries : ĠList < App Library >) Ġ{ ĊĠĠĠĠĠĠĠ Ġadapter . setData ( libraries ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter . on Back Pressed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġinner Ġclass ĠLibrary Adapter Ġ: ĠList Deleg ation Adapter < Mutable List < Any >>() Ġ{ ĊĠĠĠĠĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems Ġ= Ġmutable ListOf () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdeleg ates Manager . add Delegate ( App Library Adapter Delegate ({ Ġtry Open Link ( it . url ) Ġ})) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun ĠsetData ( libraries : ĠList < App Library >) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems . clear () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems . addAll ( libraries ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ