Skip to content
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

Best way to achieve elevated sticky headers? #227

Closed
rmunk opened this issue Nov 14, 2016 · 2 comments
Closed

Best way to achieve elevated sticky headers? #227

rmunk opened this issue Nov 14, 2016 · 2 comments

Comments

@rmunk
Copy link

rmunk commented Nov 14, 2016

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.

@davideas
Copy link
Owner

@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).

@davideas
Copy link
Owner

davideas commented Nov 25, 2016

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.

  1. 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.
  2. 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.
  3. The elevation of the sticky header will come from another function OR if not specified, from the existent elevation of the itemView(contentView).
  4. 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.

I will try to put it in rc1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants