You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the best way to achieve elevated expandable sticky headers?
I tried elevating root views and adding CardView with elevation to AbstractExpandableHeaderItem layout, but I couldn't get the desired effect.
Also, I tried to make custom sticky_header_layout with elevation. For some reason I had to add background color to root FrameLayout to make it work, but again, headers were only elevated when sticky but flat when are in the list.
The text was updated successfully, but these errors were encountered:
@rmunk, interesting point.
It used to be elevated but after the new StickyHeaderHelper and a necessary fix for a bug (creation of the class ContentViewHolder) I tried to make it elevated without success, further investigation needs to be done.
There's also a method in FlexibleViewHolder to get the activation elevation. This elevation is automatic in the adapter binding method for when the view is activated (selected by the user).
I've an update regarding the header item elevation and the sticky header elevation, from the issue that I've just referenced, you can read my #228 comment.
First of all, the background is one of the requirements to elevate a view, if there's no background then it is transparent and there's nothing to elevate.
To actually give the possibility to elevate the header item, I must provide a function or I can try to retrieve it automatically from the user header layout at run time (need to verify this): header ViewHolder is a particular ViewHolder since I swap parent to make it sticky.
The elevation of the sticky header will come from another function OR if not specified, from the existent elevation of the itemView(contentView).
I need to modify the way how the sticky container is retrieved, as from that comment, it is possible to remove the layout included in the xml and to generate it at runtime. This FrameLayout will receive the elevation as I explained in the points above.
What is the best way to achieve elevated expandable sticky headers?
I tried elevating root views and adding
CardView
with elevation toAbstractExpandableHeaderItem
layout, but I couldn't get the desired effect.Also, I tried to make custom
sticky_header_layout
with elevation. For some reason I had to add background color to rootFrameLayout
to make it work, but again, headers were only elevated when sticky but flat when are in the list.The text was updated successfully, but these errors were encountered: