package Ġcom . god sle w . timeline . creator Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . activity ViewModels Ċ import Ġandroidx . recyclerview . widget . Grid LayoutManager Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . god sle w . core . android . factory . ViewModel Factory Ċ import Ġcom . god sle w . core . android . presenter . Base Fragment Ċ import Ġcom . god sle w . core . component . timeline . Item Timeline Tab Ċ import Ġcom . god sle w . core . component . timeline . Timeline Tab Ċ import Ġcom . god sle w . core . java . entity . Account Ċ import Ġcom . god sle w . core . java . value . Page Type Ċ import Ġcom . god sle w . timeline . creator . databinding . Fragment Timeline Creator Binding Ċ import Ġcom . x wr ay . group ie . Group Adapter Ċ import Ġcom . x wr ay . group ie . Group ie ViewHolder Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠTimeline Creator Fragment ( account : ĠAccount ) Ġ: ĠBase Fragment () Ġ{ ĊĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠFragment Timeline Creator Binding ĊĊĠ Ġ@ Inject ĊĠ Ġinternal Ġlateinit Ġvar Ġfactory : ĠViewModel Factory < Timeline Creator ViewModel > ĊĠ Ġprivate Ġval ĠviewModel : ĠTimeline Creator ViewModel Ġby Ġactivity ViewModels Ġ{ Ġfactory Ġ} ĊĊĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠ Ġ): ĠView ? Ġ{ ĊĠĠĠ Ġsuper . onCreate View ( in flater , Ġcontainer , ĠsavedInstanceState ) ĊĠĠĠ Ġbinding Ġ= ĠFragment Timeline Creator Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġreturn Ġbinding . root ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠ Ġsetup () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġ Ġsetup () Ġ{ ĊĠĠĠ Ġval Ġcurrent Adapter Ġ= Ġbinding . list . adapter ĊĠĠĠ Ġval Ġtab Items Ġ= ĠPage Type . getPage Types (). map Ġ{ ĠItem Timeline Tab ( true , ĠTimeline Tab . getTime line Tab Resource ( it )) Ġ} ĊĠĠĠ Ġif Ġ( current Adapter Ġ!= Ġnull Ġ&& Ġcurrent Adapter Ġis ĠGroup Adapter ) Ġ{ ĊĠĠĠĠĠ Ġcurrent Adapter . update Async ( tab Items ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġadapter Ġ= ĠGroup Adapter < Group ie ViewHolder >() ĊĠĠĠ Ġval Ġmanager Ġ= ĠGrid LayoutManager ( require Context (), Ġ 2 , ĠLinearLayoutManager . VERTICAL , Ġfalse ) ĊĠĠĠ Ġbinding . list . adapter Ġ= Ġadapter ĊĠĠĠ Ġbinding . list . layout Manager Ġ= Ġmanager ĊĠĠĠ Ġadapter . update Async ( tab Items ) ĊĠ Ġ} Ċ }