package Ġcom . ab . v accine . feature . summary . presentation . details Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġandroidx . navigation . fragment . nav Args Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . ab . v accine . core . delegate . view Binding Ċ import Ġcom . ab . v accine . core . extensions . getString Resource ByName Ċ import Ġcom . ab . v accine . core . presentation . extensions . observe Ċ import Ġcom . ab . v accine . feature . summary . R Ċ import Ġcom . ab . v accine . feature . summary . databinding . Fragment Details Summary Binding Ċ import Ġcom . ab . v accine . feature . summary . di . Summary Component Ċ import Ġcom . ab . v accine . feature . summary . di . Summary Injector Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠSummary Details Fragment Ġ@ Inject Ġconstructor () Ġ: ĠFragment ( R . layout . fragment _ details _ summary ) Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar ĠviewModel Factory : ĠViewModel Provider . Factory ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm ViewModel : ĠSummary Details ViewModel ĊĊĠĠĠ Ġoverride Ġfun Ġon Attach ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Attach ( context ) ĊĠĠĠĠĠĠĠ ĠSummary Injector . initialize ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġapplication Context Ġ= Ġrequire Activity (). application ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ ĠSummary Component . INSTANCE . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġinternal Ġlateinit Ġvar Ġregistry Range Adapter : ĠRegistry Range Adapter ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġinternal Ġlateinit Ġvar Ġcategory Adapter : ĠCategory Adapter ĊĊĠĠĠ Ġval Ġargs : ĠSummary Details Fragment Args Ġby Ġnav Args () ĊĊĠĠĠ Ġprivate Ġval Ġbinding Ġby Ġview Binding ( Fragment Details Summary Binding :: bind ) ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġm ViewModel Ġ= ĠViewModel Providers . of ( this , ĠviewModel Factory )[ Summary Details ViewModel :: class . java ] ĊĠĠĠĠĠĠĠ Ġobserve ( m ViewModel . state LiveData , Ġ:: on StateChange ) ĊĊĠĠĠĠĠĠĠ Ġbinding . rv Registry Range . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Nested Scrolling Enabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( context , ĠLinearLayoutManager . VERTICAL , Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġregistry Range Adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbinding . rv Category . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Nested Scrolling Enabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( context , ĠLinearLayoutManager . HORIZONTAL , Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġcategory Adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġm ViewModel . getData ( args . area ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon StateChange ( state : ĠSummary Details ViewModel . ViewState ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġbinding . tv Title . text Ġ= Ġstate . area . getString Resource ByName ( context ) ĊĠĠĠĠĠĠĠ Ġbinding . tv Registry Range Title . visibility Ġ= Ġif Ġ( state . isLoading ) ĠView . IN VISIBLE Ġelse ĠView . VISIBLE ĊĠĠĠĠĠĠĠ Ġbinding . tv Category Title . visibility Ġ= Ġif Ġ( state . isLoading ) ĠView . IN VISIBLE Ġelse ĠView . VISIBLE ĊĊĠĠĠĠĠĠĠ Ġregistry Range Adapter . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmax Ġ= Ġstate . details . registry Range Max ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdata Ġ= Ġstate . details . registry Range ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġcategory Adapter . data Ġ= Ġstate . details . categories ĊĠĠĠ Ġ} Ċ } Ċ