package Ġuk . co . ian field . dev stat . widget Ċ Ċ import Ġandroid . content . Clip Data Ċ import Ġandroid . content . Clipboard Manager Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġcom . google . android . material . sn ackbar . Snackbar Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġuk . co . ian field . dev stat . R Ċ import Ġuk . co . ian field . dev stat . Stat Item Adapter Ċ import Ġuk . co . ian field . dev stat . databinding . Fragment Information Page Binding Ċ import Ġuk . co . ian field . dev stat . model . Stat Item Ċ import Ġjava . util .* Ċ Ċ class ĠInformation Page Fragment Ġ: ĠFragment () Ġ{ ĊĠĠĠ Ġprivate Ġvar Ġ_ binding : ĠFragment Information Page Binding ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġbinding Ġget () Ġ= Ġ_ binding !! ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġitems : ĠArrayList < Stat Item > ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ binding Ġ= ĠFragment Information Page Binding . inflate ( in flater , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView . set Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠ Ġval Ġlayout Manager Ġ= ĠLinearLayoutManager ( activity ) ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView . layout Manager Ġ= Ġlayout Manager ĊĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠStat Item Adapter ( require Context (), Ġitems ) Ġ{ Ġposition : ĠInt Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġclipboard Ġ= Ġcontext ?. getSystem Service ( Context . CLIP BOARD _ SERVICE ) Ġas ĠClip board Manager ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġclip Ġ= ĠClip Data . new Plain Text (" text Ġlabel ", Ġitems [ position ]. toString ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclipboard . set Primary Clip ( clip ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠSn ackbar . make ( binding . re cyclerView , ĠR . string . copied _ to _ clipboard , ĠSn ackbar . LENGTH _ SHORT ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView . adapter Ġ= Ġadapter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Items ( items : ĠArrayList < Stat Item >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . items Ġ= Ġitems ĊĠĠĠ Ġ} Ċ } Ċ