GithubHelp home page GithubHelp logo

Comments (14)

TonicArtos avatar TonicArtos commented on July 18, 2024

Please tell me which version of SuperSLiM you are using. Thanks.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

0.4.1

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

Indeed, the layout is perfectly fine, but the sticky headers slip under the cards while scrolling.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

  1. You can set a listener for when headers are stickied. This would give you the view and perform operations on it.

  2. SuperSLiM offers configuration options to automatically adjust a headers elevation for the stickied state.

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

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.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

Hm.. sounds good, I will give it a try.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Cool, tell me how it goes.

from superslim.

TonicArtos avatar TonicArtos commented on July 18, 2024

Here is a detailed look at the solution.

https://github.com/TonicArtos/SuperSLiM/wiki/Sticky-elevation-proposal

from superslim.

GoodSir42 avatar GoodSir42 commented on July 18, 2024

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.

TonicArtos avatar TonicArtos commented on July 18, 2024

Thank you.

from superslim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.