view items by date?
I need to group my recycler-view data based on a date and show some dividers in between each group as shown below.
--Item #1--
--Item #2--
-- January 2016(Divider)--
--item #3--
--item #4--
--item #5--
-- December 2015(Divider)--
--item #6--
--item #7--
.... ....
how I can accomplish this?
Sounds like you just want to have two ViewTypes like explained here
You might also want to take a look at this library and if you want it to be expandable and sexy you could take a look at Advanced RecyclerView library.
You need to first sort them based on the date.
then use either view_type (Is there an addHeaderView equivalent for RecyclerView?) as @GK mentioned or use any recycler header library to set them as sticky headers.
try this : https://github.com/ShamylZakariya/StickyHeaders
链接地址: http://www.djcxy.com/p/91954.html上一篇: 带内联样式的关键帧ReactJS
下一篇: 按日期查看项目?