Comments (6)
@AndroidDeveloperLB thanks for pointing out the issue! It happens when the shared element transition starts before the recyclerview scrolls to make sure the item is in the proper place. I should fixe this by postponing the transition, I just haven't gotten around to it yet.
from android-extensions.
Please show in code why it occurs, and how you fix it.
I want to see if I can learn from it.
from android-extensions.
@AndroidDeveloperLB it is fixed in the linked PR. Since there is a shared element transition between fragments, in onCreateView
I call postponeEnterTransition()
to make sure the image has been loaded with Picasso
before the transition runs.
Also, since the user may be returning to an image that is offscreen, I use scrollToPosition()
to make sure the image shows fully on the screen for animating.
Sometimes, the image will have loaded before the RecyclerView has scrolled (Image was cached). To fix this, I need to wait till the RecyclerView
has scrolled before starting the transition. The fix is to call view?.doOnLayout
to start the transition after the RecyclerView
has scrolled.
Thanks again for pointing out the bug!
override fun onDoggoImageLoaded(doggo: Doggo) {
if (doggo == Doggo.transitionDoggo) view?.doOnLayout { startPostponedEnterTransition() }
}
from android-extensions.
And this fixed it? can you please show a video?
from android-extensions.
@AndroidDeveloperLB sorry I missed this, yes it did fix it. I can't quite record a video right now, but you can run it to verify.
from android-extensions.
OK tried now.
Seems to still has an issue:
The RecyclerView scrolls while I'm on the new screen.
See attached video:
2020-02-12_23-30-34.zip
from android-extensions.
Related Issues (13)
- Wrong order of selected tabs during back press? HOT 7
- StackNavigator shared element transition between activities HOT 3
- Minimal steps needed to implement speed dial HOT 1
- version 1.2.1 no definition for MultiStackNaviagor HOT 2
- Is this a property delegation in the declaration of the multiStackNavigator? HOT 2
- BackStackType Unlimited/Restricted in version 1.2.1 not working correctly HOT 4
- Example of Instagram-Like Navigation HOT 6
- How to integrate Material Search Bar with RecyclerView? HOT 2
- How to add multiple viewholders in recyclerview? HOT 4
- Can't perform this action after onSaveInstanceState HOT 5
- Kotlin-gradle-publin declared twice with different versions HOT 1
- How to use MaterialFadeThrough Transition as StackTransactionModifier? HOT 6
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 android-extensions.