Comments (14)
Please tell me which version of SuperSLiM you are using. Thanks.
from superslim.
0.4.1
from superslim.
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.
from superslim.
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).
from superslim.
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.
from superslim.
Indeed, the layout is perfectly fine, but the sticky headers slip under the cards while scrolling.
from superslim.
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.
-
You can set a listener for when headers are stickied. This would give you the view and perform operations on it.
-
SuperSLiM offers configuration options to automatically adjust a headers elevation for the stickied state.
from superslim.
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.
from superslim.
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.
from superslim.
Hm.. sounds good, I will give it a try.
from superslim.
Cool, tell me how it goes.
from superslim.
Here is a detailed look at the solution.
https://github.com/TonicArtos/SuperSLiM/wiki/Sticky-elevation-proposal
from superslim.
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.
from superslim.
Thank you.
from superslim.
Related Issues (20)
- Flexbox layout
- Dynamic sticky content
- Built in elevation change for sticky content.
- Infinite scroll
- Collapsible/expandable sections
- Sticky footers weirdly wobble on horizontal scroll. HOT 1
- Toggling collapsible sections loses items.
- Prepare milestone 5 release
- Update Readme.md
- On layout a sticky footer always sits above sticky inset (section state inset parameter).
- Sticky footer HOT 2
- RecycleView scrolls over sticky header
- Crash On RecyclerView Refresh
- Does SuperSLiM supports sub headers ? HOT 10
- Mocking framework
- i cannot build the project
- NPE at LayoutManager#onItemsUpdated
- Androidx HOT 1
- Is this covered by the Apache 2.0 License?
- Scrolling issue with Sticky Headers on
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superslim.