android: Recyclerview for Fragments? -
i have followed tutorial on recyclerview
here.
but wondering if build more complex behaviour using fragments
inside recyclerview
instead of plain old views
.
using fragments can make reusable item complex behaviour can placed in other places , can more flexible.
is possible , if , how ?
recyclerview view repeats lot different data, it's designed use in long scrolly lists because inflating (constructing) view object takes effort, recycling takes view scrolled off top of screen, fills new data , puts @ bottom.
i wouldn't have thought using fragment work well, whenever scroll list it'll need re-created , run various setup methods quite expensive. , if make doesn't have (setretaininstance()) you're not getting wouldn't view.
if that's you're getting @ yes create fragment, set up, mark retained , keep reference hangs around in memory re-attach other parent @ other time. if have change contents , re-build you're not gaining much.
Comments
Post a Comment