Giter Club home page Giter Club logo

Comments (6)

tunjid avatar tunjid commented on August 15, 2024

@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.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 15, 2024

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.

tunjid avatar tunjid commented on August 15, 2024

@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.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 15, 2024

And this fixed it? can you please show a video?

from android-extensions.

tunjid avatar tunjid commented on August 15, 2024

@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.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 15, 2024

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)

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.