A new way to use the header view moving to API 23.2.1
jjhesk opened this issue · 5 comments
Sometime if you adding ur custom view as the header view and it will not be recycled because it is not the same view type as the other normal views in the recycler view. I have read about the implementation today and hopefully i can adding this into the library so that there we will have TWO ways to implement header for different situation.
- The simple way. Using the old traditional way.
listview.setNormalHeader(View your_initialized_custom_view);
But this will cause exception issue from the recycler view.
- The more complex Views.
Here is my work in progress
Now I am current looking for the implementation of ignoreView
because i still trying to understand more of when to use this call.
/**
* Flags a view so that it will not be scrapped or recycled.
* <p>
* Scope of ignoring a child is strictly restricted to position tracking, scrapping and
* recyling. Methods like {@link #removeAndRecycleAllViews(Recycler)} will ignore the child
* whereas {@link #removeAllViews()} or {@link #offsetChildrenHorizontal(int)} will not
* ignore the child.
* <p>
* Before this child can be recycled again, you have to call
* {@link #stopIgnoringView(View)}.
* <p>
* You can call this method only if your LayoutManger is in onLayout or onScroll callback.
*
* @param view View to ignore.
* @see #stopIgnoringView(View)
*/
As I read from the currently status it is not gonna solve the header issue. This is commented from the dev team in google.
This is recently updated in the new library on 23.2.0 and they have discussion around this issue from the updates
we are about to upgrade ultimaterecycler view to depending on V23.2.1. hopefully it will solved all the issues all the way from the past.
v0.5.0 important updates
- v23.2.1 will be used for the support library which fixed alot of bugs from the previous threads and discussions.
- swipe layout is now working
- added stagger layout manager demonstration and the sample code. Using prewritten bases such as
staggerHolder
and stagger adapter. Remember to check out the sample code to see how it works. - not more
getViewHolder
instead there will be two complete separated callsnewHeaderHolder
andnewFooterHolder
for custom binding. - alot of sample codes are back in working now.
Great!