Update view from normal header to sticky header
See original GitHub issueIn my app, the sticky headers have an extra view added to them over the basic header. How can I do this?
I tried forking the library and adding the sticky header position to the IFlexible onBindView method: bindViewHolder(FlexibleAdapter adapter, VH holder, int position, int stickyPosition, List payloads)
This way I can update the sticky header, but the changes are not reverted when the sticky header is changed, because the header is not bound again.
Congratulations for the library! It is very powerful, but the FlexibleAdapter class is huge. It’s size should be reduced. Maybe more helper classes like StickyHeaderHelper
could be made.
Any help is welcome, thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Sticky Headers: 5 Ways to Make Them Better
Sticky headers (or persistent headers) are a common pattern for keeping the header of a website or app in the same place on...
Read more >How to create a sticky website header | Layout - Flywheel
Declare the distance from the “sticky edge,” i.e. 10px for a header that becomes sticky when it is 10px away from scroll area....
Read more >How To Create the Perfect Sticky Header for Your Site With ...
1. Sticky Menu & Sticky Header. Webfactory's Sticky Menu & Sticky Header plugin is a good first choice, due to its wealth of...
Read more >Better Headers: How to Configure Sticky Headers - YouTube
Sticky header controls left you scratching your head? ... 2.5K views 2 years ago ... Never miss a life-changing Themeco update again!
Read more >How to Add a Sticky Header or On-scroll Fixed Header with ...
In the customizer under Header > Sticky Header all options are available. If you have a sticky primary header, respective options will appear....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davideas Thanks for the help, you are 100% right. The alpha animation was caused by the
DefaultItemAnimator
.Both of your suggestions fix the issue. I had gone with the first, using
notifyItemChanged(mStickyHeaderPosition, payload);
to keep the add/remove animations.The final code:
UpdateHeaderEvent
is an empty POJO.The second solution, in bindViewHolder you have the
position
andadapter.getStickyPosition()
.