package Ġcom . in ju . day w orry android . w orry . w orry List . adapter Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . in ju . day w orry android . R Ċ import Ġcom . in ju . day w orry android . model . pojo . W orry Ċ import Ġcom . in ju . day w orry android . my page . My W orry History Activity Ċ import Ġcom . in ju . day w orry android . utils . Constants Ċ import Ġcom . in ju . day w orry android . w orry . w orry List . W orry Item ViewHolder Ċ import Ġcom . in ju . day w orry android . w orry . w orry List . W orry List Event Ċ import Ġkotlinx . android . synt hetic . main . item _ w orry . view .* Ċ Ċ class ĠMy History Adapter ( private Ġval Ġlist : ĠMutable List < W orry >, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġactivity : ĠMy W orry History Activity , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġevent : ĠMutable LiveData < W orry List Event > Ġ= ĠMutable LiveData () Ċ ) Ġ: ĊĠĠĠ ĠRecyclerView . Adapter < W orry Item ViewHolder > Ġ() Ċ { ĊĊĠĠĠ Ġprivate Ġval Ġactivity Ġ= Ġactivity ĊĠĠĠ Ġval Ġpref Ġ= Ġactivity . get SharedPreferences ( Constants . PREFER ENCE , ĠAppCompatActivity . MODE _ PRIVATE ) ĊĠĠĠ Ġprivate Ġval Ġsupport FragmentManager Ġ= Ġactivity . support FragmentManager ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠW orry Item ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠitemView Ġ= ĠLayoutInflater . from ( parent . context ). inflate ( R . layout . item _ my _ w orry _ history , Ġparent , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn ĠW orry Item ViewHolder ( item View ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠW orry Item ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . container View . title . text Ġ= Ġlist [ position ]. title ĊĠĠĠĠĠĠĠ Ġholder . container View . content . text Ġ= Ġlist [ position ]. content ĊĠĠĠĠĠĠĠ Ġholder . container View . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent . value Ġ= ĠW orry List Event . On History Item Click ( list [ position ]. post Id ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġholder . container View . w orry Item Time Text . text Ġ= Ġlist [ position ]. created Date . substring ( 0 .. 3 ) Ġ+ Ġ"." Ġ+ Ġlist [ position ]. created Date . substring ( 5 .. 6 ) Ġ+ Ġ"." Ġ+ Ġlist [ position ]. created Date . substring ( 8 .. 9 ) ĊĊĠĠĠĠĠĠĠ Ġholder . container View . comment Count Text . text Ġ= Ġlist [ position ]. comment Num . toString () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġlist . size ĊĠĠĠ Ġ} Ċ }