I thought about your task and ended up writing code that you might find useful. There is a problem at this stage.
What I did adds an element decorator to the recycler view:
recyclerView.addItemDecoration(new StickySummaryDecoration());
And here is my implementation of the main decorator (frankly, this is my first experience with item decorators, so it may not be optimal or completely correct, but I did my best):
public class StickySummaryDecoration extends RecyclerView.ItemDecoration { @Override public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { int childCount = parent.getAdapter().getItemCount(); int lastVisibleItemPosition = ((LinearLayoutManager) parent.getLayoutManager()).findLastVisibleItemPosition(); int firstVisiblePosition = ((LinearLayoutManager) parent.getLayoutManager()) .findFirstCompletelyVisibleItemPosition(); if ((firstVisiblePosition == 0) && (lastVisibleItemPosition == (childCount - 1))) { View summaryView = parent.getChildAt(parent.getChildCount() - 1); int topOffset = parent.getHeight() - summaryView.getHeight(); int leftOffset = ((RecyclerView.LayoutParams) summaryView.getLayoutParams()).leftMargin; c.save(); c.translate(leftOffset, topOffset); summaryView.draw(c); c.restore(); summaryView.setVisibility(View.GONE); } } }
So what I get with this.
The following summary in a short list:

You need to scroll down to view the summary in a long list:

Now about the problem. This side effect when scrolling back in a long list is something that I haven't decided yet.

My experiments are uploaded to github repo just in case :)
EDIT
Just now I came to me that the missing line item in the recycler view is my summary view handler, with GONE visibility. There must be a way to get it back ...
EDIT 2
I revised my first solution and slightly changed the code to account for a long list (in this case, the item decoration is disabled (I think it is closer to what you wanted to achieve)), this automatically fixes the missing line problem.
source share