Comments (7)
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.
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.
Maybe something like textCollapseMode
would be more clear. @raphaelm, what do you think?
from multiline-collapsingtoolbar.
Or even textCollapseOn
with the values scroll
and scrim
?
from multiline-collapsingtoolbar.
Yeah, that's fine too.
from multiline-collapsingtoolbar.
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.
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)
- Align background with expanded text HOT 3
- Scrim color doesn't persist HOT 2
- Text get duplicated if it's not in English HOT 1
- Revert to single line when changing title text size with TextAppearance HOT 1
- Multiline not working with TextSize<21 SP HOT 4
- How to fix Toolbar Background color?
- Error HOT 2
- How to enlarge image on a backdrops HOT 1
- expandedTitleMarginEnd not working
- New line without the need HOT 5
- Failed to resolve: net.opacapp:multiline-collapsingtoolbar:1.6.0 HOT 6
- Link versions to support library dependency version HOT 3
- Update library to Support Library version 27.1.1 HOT 1
- Add subtitles HOT 1
- crash-CollapsingTextHelper#calculateUsingTextSize HOT 2
- Update library to Support Library version 28.0.0 HOT 3
- Migrating to AndroidX HOT 7
- Custom Font family HOT 1
- Duplicated title HOT 7
- JCenter migration HOT 4
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 multiline-collapsingtoolbar.