package Ġio . github . gus and rian os . fox for reddit . utilities Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroid . widget . TextView Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġio . github . gus and rian os . fox for reddit . R Ċ import Ġio . github . gus and rian os . fox for reddit . data . models . Rules Item Ċ import Ġio . not ies . mark won . Mark won Ċ import Ġio . not ies . mark won . ext . tables . Table Plugin Ċ import Ġio . not ies . mark won . link ify . Link ify Plugin Ċ import Ġorg . apache . commons . text . String Escape Utils Ċ Ċ class ĠRules ListAdapter ( private Ġval Ġrules : ĠList < Rules Item >) Ġ: ĠRecyclerView . Adapter < Rules ListAdapter . ViewHolder >() Ġ{ ĊĠĠĠ Ġclass ĠViewHolder ( view : ĠView ) Ġ: ĠRecyclerView . ViewHolder ( view ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġvar Ġrule Title Ġ= Ġview . findViewById ( R . id . text _ rule _ title ) Ġas ĠTextView ĊĠĠĠĠĠĠĠ Ġvar Ġrule Body Ġ= Ġview . findViewById ( R . id . text _ rule _ body ) Ġas ĠTextView ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠViewHolder ( LayoutInflater . from ( parent . context ). inflate ( R . layout . item _ rules , Ġparent , Ġfalse )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmark won Ġ= ĠMark won . builder ( holder . item View . context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. use Plugin ( Table Plugin . create ( holder . item View . context )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. use Plugin ( Link ify Plugin . create ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ Ġholder . rule Title . text Ġ= ĠString Escape Utils . un escape Xml ( rules [ position ]. short Name ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( rules [ position ]. description . isNull OrEmpty ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmark won . set Markdown ( holder . rule Body , Ġ"") ĊĠĠĠĠĠĠĠ Ġelse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmark won . set Markdown ( holder . rule Body , ĠString Escape Utils . un escape Xml ( rules [ position ]. description !! )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrules . size ĊĠĠĠ Ġ} Ċ } Ċ