package Ġru . o zh . android . recycler . decorator . sample . chat . decor Ċ Ċ import Ġandroid . graphics .* Ċ import Ġandroidx . annotation . Float Range Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġru . o zh . android . recycler . decorator . lib . Decorator Ċ Ċ abstract Ġclass ĠScroll Progress Decor Ġ: ĠDecor ator . RecyclerView Decor Ġ{ ĊĊĠĠĠ Ġabstract Ġfun Ġdraw ( canvas : ĠCanvas , Ġre cyclerView : ĠRecyclerView , Ġstate : ĠRecyclerView . State , Ġ@ Float Range ( from Ġ= Ġ. 0 , Ġto Ġ= Ġ 1 . 0 ) Ġprogress : ĠFloat ) ĊĊĠĠĠ Ġoverride Ġfun Ġdraw ( canvas : ĠCanvas , Ġre cyclerView : ĠRecyclerView , Ġstate : ĠRecyclerView . State ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Offset Ġ= Ġre cyclerView . compute Vertical Scroll Offset () ĊĠĠĠĠĠĠĠ Ġval Ġmax Offset Ġ= Ġre cyclerView . compute Vertical Scroll Range () Ġ- Ġre cyclerView . compute Vertical Scroll Extent () ĊĠĠĠĠĠĠĠ Ġval Ġscroll Progress Ġ= Ġcurrent Offset . toFloat () Ġ/ Ġmax Offset ĊĠĠĠĠĠĠĠ Ġdraw ( canvas , Ġre cyclerView , Ġstate , Ġscroll Progress ) ĊĠĠĠ Ġ} Ċ }