package Ġio . github . w ulkan owy . ui . modules . school announcement Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ import Ġio . github . w ulkan owy . R Ċ import Ġio . github . w ulkan owy . data . db . entities . School Anno uncement Ċ import Ġio . github . w ulkan owy . databinding . Fragment School Anno uncement Binding Ċ import Ġio . github . w ulkan owy . ui . base . Base Fragment Ċ import Ġio . github . w ulkan owy . ui . modules . main . MainActivity Ċ import Ġio . github . w ulkan owy . ui . modules . main . Main View Ċ import Ġio . github . w ulkan owy . ui . widgets . Divider Item Decoration Ċ import Ġio . github . w ulkan owy . utils . get Theme Attr Color Ċ import Ġjavax . inject . Inject Ċ Ċ @ Android EntryPoint Ċ class ĠSchool Anno uncement Fragment Ġ: ĊĠĠĠ ĠBase Fragment < Fragment School Anno uncement Binding >( R . layout . fragment _ school _ announcement ), ĊĠĠĠ ĠSchool Anno uncement View , ĠMain View . Title d View Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġpresenter : ĠSchool Anno uncement Presenter ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġschool Anno uncement Adapter : ĠSchool Anno uncement Adapter ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance () Ġ= ĠSchool Anno uncement Fragment () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġtitle String Id : ĠInt ĊĠĠĠĠĠĠĠ Ġget () Ġ= ĠR . string . school _ announcement _ title ĊĊĠĠĠ Ġoverride Ġval Ġis View Empty : ĠBoolean ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġschool Anno uncement Adapter . items . isEmpty () ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠFragment School Anno uncement Binding . bind ( view ) ĊĠĠĠĠĠĠĠ Ġpresenter . on Attach View ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit View () Ġ{ ĊĠĠĠĠĠĠĠ Ġwith ( binding . director Information Recycler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġschool Anno uncement Adapter . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġon ItemClickListener Ġ= Ġpresenter :: on ItemClickListener ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Item Decoration ( Divider Item Decoration ( context )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġwith ( binding ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdirector Information Swipe . setOn Refresh Listener ( presenter :: on Swipe Refresh ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdirector Information Swipe . setColor Scheme Colors ( require Context (). get Theme Attr Color ( R . attr . color Primary )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdirector Information Swipe . set Progress BackgroundColor Scheme Color ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrequire Context (). get Theme Attr Color ( R . attr . color Swipe Refresh ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdirector Information Error Retry . setOnClickListener Ġ{ Ġpresenter . on Retry () Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdirector Information Error Details . setOnClickListener Ġ{ Ġpresenter . on Details Click () Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġupdate Data ( data : ĠList < School Anno uncement >) Ġ{ ĊĠĠĠĠĠĠĠ Ġwith ( school Anno uncement Adapter ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems Ġ= Ġdata ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclear Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġwith ( school Anno uncement Adapter ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġitems Ġ= ĠlistOf () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnotify DataSet Changed () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Empty ( show : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Empty . visibility Ġ= Ġif Ġ( show ) ĠView . VISIBLE Ġelse ĠView . GONE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Error View ( show : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Error . visibility Ġ= Ġif Ġ( show ) ĠView . VISIBLE Ġelse ĠView . GONE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠsetError Details ( message : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information ErrorMessage . text Ġ= Ġmessage ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Progress ( show : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Progress . visibility Ġ= Ġif Ġ( show ) ĠView . VISIBLE Ġelse ĠView . GONE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġenable Swipe ( enable : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Swipe . isEnabled Ġ= Ġenable ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Content ( show : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Recycler . visibility Ġ= Ġif Ġ( show ) ĠView . VISIBLE Ġelse ĠView . GONE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Refresh ( show : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . director Information Swipe . is Refresh ing Ġ= Ġshow ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġopen School Anno uncement Dialog ( item : ĠSchool Anno uncement ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ( activity Ġas ? ĠMainActivity )?. show Dialog Fragment ( School Anno uncement Dialog . newInstance ( item )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġpresenter . on Detach View () ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠ Ġ} Ċ } Ċ