package Ġcom . example . k dot di . common . extensions Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . graphics . Rect Ċ import Ġandroid . graphics . drawable . Drawable Ċ import Ġandroid . graphics . drawable . Inset Drawable Ċ import Ġandroidx . core . content . Context Compat Ċ import Ġandroidx . recyclerview . widget . Divider Item Decoration Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġcom . example . k dot di . common . R Ċ Ċ fun ĠRecyclerView . apply Divider ( context : ĠContext , Ġrect : ĠRect ) Ġ{ ĊĠĠĠ ĠContext Compat ĊĠĠĠĠĠĠĠ Ġ. get Drawable ( context , ĠR . drawable . drawable _ separator ) ĊĠĠĠĠĠĠĠ Ġ? . let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinset Divider Ġ= Ġcreate Inset Divider ( it , Ġrect ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġdivider Ġ= ĠDiv ider Item Decoration ( context , ĠLinearLayoutManager . VERTICAL ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdivider . set Drawable ( in set Divider ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . addItem Decoration ( divider ) ĊĠĠĠĠĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġcreate Inset Divider ( it : ĠDrawable , Ġrect : ĠRect ): ĠIn set Drawable Ġ= ĊĠĠĠ ĠIn set Drawable ( it , Ġrect . left , Ġrect . top , Ġrect . right , Ġrect . bottom )