-
Notifications
You must be signed in to change notification settings - Fork 295
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
Headers are displayed underneath the regular cards #48
Comments
Please tell me which version of SuperSLiM you are using. Thanks. |
0.4.1 |
Okay thanks, I was hoping it was margins related. I wonder if it is caused by the child index ordering? I don't know much about how Android 5 does its elevation trick. |
I guess it's because the cards get an elevation property which makes them display with a shadow... I was hoping this did not affect the headers, but apparently I have to solve this myself then (as it's not necessarily related to your framework). |
Well, it looks like the cards are intruding on the headers layout. I thought the cards should have margins to prevent that. I am going to take a look at it, but as far as I am aware, I've done everything I should to properly measure and layout views. |
Indeed, the layout is perfectly fine, but the sticky headers slip under the cards while scrolling. |
Oh, I understand now. Things are fine until the headers are in their stickied state. This makes perfect sense since elevation in android 5 changes the drawing order. I don't see why SuperSLiM shouldn't be able to handle this. What do you think of these ideas.
|
The second one sounds perfect, but the first will also allow some workarounds. Although I guess I am getting a shadow if the elevation is changed, so changing the drawing order may be more reasonable. I can't imagine any reason why a sticky header should not always be on top. |
I am not sure I can override the drawing order. Also, in my understanding of the material design spec, the headers should probably get elevation and shadow if content is to pass underneath. You can disable the shadows using setOutlineProvider(null) on the header views. Maybe this could also be done automatically per the LayoutManager configuration. |
Hm.. sounds good, I will give it a try. |
Cool, tell me how it goes. |
Here is a detailed look at the solution. https://github.com/TonicArtos/SuperSLiM/wiki/Sticky-elevation-proposal |
My first results: setting an elevation works perfectly fine. A card has a default elevation of 2dp (which is the minimum value for the header then). If I set teh outline provider to null I get no shadow. I think you don't really have to take a specific action for this, just leave this post as a documentation and link to it. |
Thank you. |
Hi again!
I found another issue: Sticky headers are somehow displayed below my cards. this may have something to do with the elevation level of a card on Android 5, but I am really not sure.. Could you have a look at it and make sure that headers are always on top? (telling me what may be wrong is also an option ;) )
The text was updated successfully, but these errors were encountered: