Git Product home page Git Product logo

Comments (7)

johan12345 avatar johan12345 commented on July 28, 2024

One would need to add something to this listener that then influences the blending of the text. Currently, this is done here instead depending on the scrolling position.

If you'd implement this and make the behavior switchable between the current animation and this version using a method in CollapsingToolbarLayout, we would accept that as a pull request.

from multiline-collapsingtoolbar.

dmfs avatar dmfs commented on July 28, 2024

I've implemented something that works for us. At present it can't be disabled but I think that shouldn't be hard to do. Do you have any preference for an xml attribute name to switch this behavior?

 <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
        ...
    app:collapseMode = "onScrim"
 >
...

With the values onScroll (the default) and onScrim?

from multiline-collapsingtoolbar.

johan12345 avatar johan12345 commented on July 28, 2024

Maybe something like textCollapseMode would be more clear. @raphaelm, what do you think?

from multiline-collapsingtoolbar.

raphaelm avatar raphaelm commented on July 28, 2024

Or even textCollapseOn with the values scroll and scrim?

from multiline-collapsingtoolbar.

johan12345 avatar johan12345 commented on July 28, 2024

Yeah, that's fine too.

from multiline-collapsingtoolbar.

dmfs avatar dmfs commented on July 28, 2024

My idea was to target a broader scope with that field and not just the title text. We have implemented another extension that could be affected by this setting.
The other extension allows you to specify for each child element how it behaves during content scrim. We've called it scrimMode and it's applied to the child elements. The values are none (the default) which keeps the current behavior, out which fades the element out on scrim and in which fades the element in. The transitions can be executed while scrolling or when the scrim animation is started.

We use it to switch between a white themed toolbar and a dark themed toolbar during the scrim animation. The scrim changes the appearance of our toolbar from a dark background to a white one. So we have two toolbars and x-fade them during the scrim animation (or optionally as per collapseMode, while scrolling)

from multiline-collapsingtoolbar.

dmfs avatar dmfs commented on July 28, 2024

I've just opened PR #38
As you see I've taken the orthogonal approach. I've added a flag to specify which elements should be auto-animated and which should be gradually morphed.

you apply it like this

 <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
        ...
    app:autoAnimate = "title|scrim"
 >

You can also apply this

 <net.opacapp.multilinecollapsingtoolbar.CollapsingToolbarLayout
        ...
    app:autoAnimate = "none"
 >

Which means that the scrim is now applied gradually as you scroll.

There is another value called children but it's not implemented yet as it depends on PR #36.

I have a branch called "schedjoules" which will contain the changes of all three PRs. Let me know if you'd prefer a single PR with all the enhancements (with the conflicts already being resolved).

from multiline-collapsingtoolbar.

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.