package Ġcom . example . complete adapter view Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import ĠdataSource . DataSource Class Ċ import Ġkotlinx . android . synt hetic . main . linear _ vertical .* Ċ import Ġre cycler view adapters . RecyclerView Vertical Adapter Ċ import Ġandroid . widget . Toast Ċ import Ġdata Modal . Contacts Ċ Ċ late init Ġvar Ġre cyclerView Vertical Adapter : RecyclerView Vertical Adapter Ċ class ĠRecyclerView Vertical : AppCompatActivity (), RecyclerView Vertical Adapter . On Linear Contact ClickListener { ĊĠĊĠ ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . linear _ vertical ) ĊĠĠĠĠĠĠĠ Ġinit RecyclerView Vertical () ĊĠĠĠĠĠĠĠ Ġadd DataSet () ĊĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġprivate Ġfun Ġadd DataSet (){ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠDataSource Class . create DataSet () ĊĠĠĠĠĠĠĠ Ġre cyclerView Vertical Adapter . submit List ( data ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġfun Ġinit RecyclerView Vertical (){ ĊĠĠĠĠĠĠĠ Ġval Ġre cyclerView Horizontal : RecyclerView ? Ġ= ĠfindViewById ( R . id . re cyclerView Vertical ) ĊĠĠĠĠĠĠĠ Ġre cyclerView Vertical ?. apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( this @ RecyclerView Vertical ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( layout Manager Ġas ĠLinearLayoutManager ). orientation Ġ= ĠLinearLayoutManager . VERTICAL ĊĠĠĠĠĠĠĠĠĠĠĠ Ġre cyclerView Vertical Adapter Ġ= ĠRecyclerView Vertical Adapter ( this @ RecyclerView Vertical ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġre cyclerView Vertical Adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Item Clicked ( contacts : ĠContact s , position : Int ) Ġ{ ĊĠĠĠĠĠĠĠ ĠToast . makeText ( this ," User Ġname Ġ${ contacts . p Name } ĠPosition Ġ$ position ", ĠToast . LENGTH _ LONG ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. show () ĊĠĠĠ Ġ} Ċ Ċ } ĊĊ