package Ġweb k ul . openc art . mob ik ul . adapter Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . support . constraint . Constraint Layout Ċ import Ġandroid . support . v 7 . widget . RecyclerView Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . ViewGroup Ċ import Ġweb k ul . openc art . mob ik ul . handlers . Recent Search Handler Ċ import Ġweb k ul . openc art . mob ik ul . helper . Utils Ċ import Ġweb k ul . openc art . mob ik ul . room database . Recent Search Table Ċ import Ġweb k ul . openc art . mob ik ul . databinding . Recent Search Item Layout Binding Ċ Ċ class ĠRecent Search Word ListAdapter ( val ĠmContext : ĠContext , Ġprivate Ġval Ġrecent Search List : ĠList < Recent Search Table >) Ġ: ĊĠĠĠĠĠĠĠ ĠRecyclerView . Adapter < Recent Search Word ListAdapter . My ViewHolder >() Ġ{ ĊĠĠĠ Ġoverride Ġfun ĠonCreate ViewHolder ( parent : ĠViewGroup , Ġview Type : ĠInt ): ĠMy ViewHolder Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġlayout Binding Ġ= ĠRecent Search Item Layout Binding . inflate ( LayoutInflater . from ( parent . context ), parent , false ) ĊĠĠĠĠĠĠĠ Ġreturn ĠMy ViewHolder ( layout Binding ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrecent Search List . size ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Bind ViewHolder ( holder : ĠMy ViewHolder , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġholder . layout Binding . data Ġ= Ġrecent Search List [ position ] ĊĠĠĠĠĠĠĠ Ġholder . layout Binding . handler Ġ= ĠRecent Search Handler ( mContext ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠMy ViewHolder ( val Ġlayout Binding : ĠRecent Search Item Layout Binding ) Ġ: ĠRecyclerView . ViewHolder ( layout Binding . root ){ ĊĠĠĠĠĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Binding . main Layout . layout Params = ĠConstraint Layout . LayoutParams ( Utils . getDevice Screen Width ()/ 4 , Utils . getDevice Screen Width ()/ 4 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }