package Ġcom . v 2 ray . ang . ui Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . graphics . Color Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . v 2 ray . ang . databinding . Item Recycler Sub Setting Binding Ċ Ċ class ĠSub Setting Recycler Adapter ( val Ġactivity : ĠSub Setting Activity ) Ġ: ĠRecyclerView . Adapter < Sub Setting Recycler Adapter . Main ViewHolder >() Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġm Activity : ĠSub Setting Activity Ġ= Ġactivity ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count () Ġ= Ġm Activity . subscriptions . size ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠMain ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsub Id Ġ= Ġm Activity . subscriptions [ position ]. first ĊĠĠĠĠĠĠĠ Ġval Ġsub Item Ġ= Ġm Activity . subscriptions [ position ]. second ĊĠĠĠĠĠĠĠ Ġholder . item Sub Setting Binding . tv Name . text Ġ= Ġsub Item . remarks ĊĠĠĠĠĠĠĠ Ġholder . item Sub Setting Binding . tv Url . text Ġ= Ġsub Item . url ĊĠĠĠĠĠĠĠ Ġholder . item View . set BackgroundColor ( Color . TRANSP ARENT ) ĊĊĠĠĠĠĠĠĠ Ġholder . item Sub Setting Binding . layout Edit . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Activity . startActivity ( Intent ( m Activity , ĠSub Edit Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. putExtra (" sub Id ", Ġsub Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠMain ViewHolder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMain ViewHolder ( Item Recycler Sub Setting Binding . inflate ( LayoutInflater . from ( parent . context ), Ġparent , Ġfalse )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠMain ViewHolder ( val Ġitem Sub Setting Binding : ĠItem Recycler Sub Setting Binding ) Ġ: ĠRecyclerView . ViewHolder ( item Sub Setting Binding . root ) Ċ } Ċ