-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different type of view for the Sticky header section, other than normal header. How to do that? #128
Comments
@venkyg88, in a recent fix I had to add a new parameter for the FlexibleViewHolder Constructor, did you pass I will have to replicate your case later today when i will be at home. However, did you try to use the XML layout instead to inflate yours? |
@davideas yes, i am passing true to that FlexibleViewHolder Constructor and i used XML layout also . with these it works fine. but my requirement is to have a separate view[layout] for sticky header and other view[layout] for normal headers . Can you help me in achieving these requirement ? |
@venkyg88, if you use xml layout, you can still have different header types with same layout representation. I've tested that the line in NPE is because params object is null, so you have to initialize the view group with layout params before returning the ViewGroup. It's not properly a bug because you need to provide this info anyway. ViewGroup.LayoutParams params = mStickyHolderLayout.getLayoutParams(); //params is null!!
params.width = view.getMeasuredWidth(); //view is ok! Done the initialization, I think, you then need to attach the layout to its parent ( If you want, because I didn't experiment too much on this customization, you can try and see if it works, then would you like to add a short description of how to achieve it programmatically? I gave you the indications already. |
I had tried sub classing the Flexible Adapter and Implementing the getStickySectionHeadersHolder , Inside these method i had inflated a Layout , and returning the view group which is present in that view.
But view is null and throws exception,
The text was updated successfully, but these errors were encountered: