Comments (16)
@bret-fears thanks a lot for approving and merging! Could you create a new release version from the updated master branch so this change is available as gradle dependency?
from spruce-android.
Fix has been merged and is available in patch version 1.0.3
https://github.com/willowtreeapps/spruce-android/releases/tag/1.0.3
from spruce-android.
The current example for recycler is calling the animation start in onLayoutChildren which, as you can see, is applying the animation to the children rather than when they are added. The proper path to take is to run the animation from a RecyclerView.ItemAnimator#animateAdd() call so the children are animated when they are added.
The drawback to using animateAdd is it'd apply the animations one at a time rather than to the group.
The path moving forward is to add native RecyclerView.ItemAnimator support which will hopefully be available in an upcoming release.
Thank you for calling this out!
from spruce-android.
I think I found an easier solution for that problem than #79 is.
In Spruce.java:71
the animation will be delayed using setStartDelay()
. This also delays the "setup" of the items which means the initial hiding.
If I change now
animatorCopy.setStartDelay(childView.getTimeOffset());
to
animatorCopy.start();
animatorCopy.cancel();
animatorCopy.setStartDelay(childView.getTimeOffset());
the animation starts (items will be hidden) but the actual animation is cancelled immediately. After that I can add the start delay and the full animation will be played as expected.
What do you think about that?
CC: @bret-fears
PS: Looks like this change only affects the initial recycler view animation, all other animations (recycler view onClick animation, all sort animations) still work fine and as previously in the sample app.
from spruce-android.
@tfonfara cheers! good work.
from spruce-android.
+1
I look forward to this new version
from spruce-android.
@bret-fears We could probably label this as an Enhancement
from spruce-android.
+1 looking forward to that!
from spruce-android.
@tfonfara I like it! It's simple and solves the issue described by @lokither
from spruce-android.
@bret-fears I'm pleased to hear that :) I noticed that you declined your pr, will you integrate my approach into the main code? ;)
from spruce-android.
@tfonfara you're welcome to submit a pull request. Otherwise, I'll gladly add that suggested change when I have time to.
from spruce-android.
@bret-fears there you go ;)
from spruce-android.
Closing this issue for now. Feel free to leave feedback here or open new issues as appropriate.
from spruce-android.
Hey @bret-fears I don't think this is fixed in version 1.0.2. In the Recycler Example, I still see what @16meyrat commented: RecyclerView is animated is first almost fully displayed, then disappears, and then the animation starts. It's quick but clearly visible...which is not ideal.
Is there anything I am missing? Attached video of the sample app
Screenrecorder-2021-01-13-15-18-23-263.mp4
from spruce-android.
Also, @tfonfara fix makes children's setStartDelay to stop working. I added the fix manually, and now all RecyclerView children animate at the same time, instead of one by one!
Spruce.mp4
Edited for adding video.
@bret-fears I see this issue is quite old, maybe there is another way to fix this in the latest version?
from spruce-android.
@amanzan I have completely forgotten about this. I will re-open and investigate possible options around it so it doesn't interfere with other types of set animations.
from spruce-android.
Related Issues (20)
- Port SortFunction
- How do I use other animations which are present in IOS and not Android?
- interObjectDelay not affecting Android 8+ HOT 4
- AndroidX support HOT 1
- Port WeightedContinuousSortFunction HOT 1
- Version 1.0.2 doesn't seem to work HOT 12
- Set up basic demo app HOT 1
- Polish SortFunction selection HOT 2
- Polish duration selection
- Add extensibility test(s) HOT 1
- Add contributing.md file
- Update README
- Lock rotation in example app
- Clean up Javadoc documentation
- Port RadialSortFunction HOT 1
- Create a new version HOT 4
- Port RandomSortFunction HOT 1
- RecyclerActivity finally several items no animation HOT 2
- how to use in listview HOT 1
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 spruce-android.