package Ġcom . example . words app Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . text . style . Clickable Span Ċ import Ġandroid . util . Log Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . example . words app . adapters . Con versations Adapter Ċ import Ġcom . example . words app . adapters . Letter Adapter Ċ import Ġcom . example . words app . databinding . Fragment Con versations Binding Ċ import Ġcom . example . words app . models . Conversation Peek Ċ import Ġjava . io . File Ċ import Ġjava . io . FileInputStream Ċ import Ġjava . io . File OutputStream Ċ Ċ // ĠTODO : ĠRename Ġparameter Ġarguments , Ġchoose Ġnames Ġthat Ġmatch Ċ // Ġthe Ġfragment Ġinitialization Ġparameters , Ġe . g . ĠARG _ ITEM _ NUMBER Ċ private Ġconst Ġval ĠARG _ PARAM 1 Ġ= Ġ" param 1 " Ċ private Ġconst Ġval ĠARG _ PARAM 2 Ġ= Ġ" param 2 " Ċ Ċ /** Ċ Ġ* ĠA Ġsimple Ġ[ Fragment ] Ġsubclass . Ċ Ġ* ĠUse Ġthe Ġ[ Con versations . newInstance ] Ġfactory Ġmethod Ġto Ċ Ġ* Ġcreate Ġan Ġinstance Ġof Ġthis Ġfragment . Ċ Ġ*/ Ċ class ĠCon versations Ġ: ĠFragment () Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġ_ binding Ġ: ĠFragment Con versations Binding ? Ġ= Ġnull ĊĊĠĠĠ Ġprivate Ġval Ġbinding Ġget () Ġ= Ġ_ binding !! ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġre cyclerView : ĠRecyclerView ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġset Has Options Menu ( true ) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠInf late Ġthe Ġlayout Ġfor Ġthis Ġfragment ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= ĠFragment Con versations Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġbinding . root ĊĠĠĠĠĠĠĠ Ġreturn Ġview ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġre cyclerView Ġ= Ġbinding . re cyclerView ĊĠĠĠĠĠĠĠ Ġre cyclerView . layout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . adapter Ġ= ĠCon versations Adapter () ĊĊĠĠĠ Ġ} ĊĊĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĊĊĊ Ċ }