Giter Club home page Giter Club logo

Comments (7)

shreelakshmijoshi avatar shreelakshmijoshi commented on May 20, 2024

Hi @amazingvoice !
I am a new open source contributor and would like to solve this issue, could you help me understand the issue better by providing some extra references ?
Is this is issue open to contribute ?

from animation-samples.

amazingvoice avatar amazingvoice commented on May 20, 2024

Hi @shreelakshmijoshi! Just run the demo DrawableAnimations on any android phone or emulator, follow the steps I provided:

start the app DrawableAnimations -> click AnimatedVectorDrawableCompat -> click START -> back press before the animation is done,

then check the logcat to find the stacktrace, you can set some breakpoints to help you understand how it works.

from animation-samples.

shreelakshmijoshi avatar shreelakshmijoshi commented on May 20, 2024

The animated fragment is set to null after the animation is completed. When we press the back button , the view gets destroyed but the animated fragment which is bound to the view is still running. We should also destroy the object associated with the view when back button is pressed.
That's why OnBackPressedCallback function is added which implements the operation of the stop button

 override fun onAttach(context: Context){
       super.onAttach(context)
       val callback: OnBackPressedCallback =object:OnBackPressedCallback(
       true
       ){
           override fun handleOnBackPressed(){
               binding.stop.performClick()
               activity?.supportFragmentManager?.popBackStack()
           }
       }
       requireActivity().onBackPressedDispatcher.addCallback(
           this,
           callback
       )
   }

from animation-samples.

shreelakshmijoshi avatar shreelakshmijoshi commented on May 20, 2024

@amazingvoice please review my pull request link

from animation-samples.

amazingvoice avatar amazingvoice commented on May 20, 2024

@shreelakshmijoshi Sorry I'm not the maintainer of this project.
@ggfan Please help review this PR. Thanks!

from animation-samples.

shreelakshmijoshi avatar shreelakshmijoshi commented on May 20, 2024

oh okay..

from animation-samples.

shreelakshmijoshi avatar shreelakshmijoshi commented on May 20, 2024

@ggfan
Can you or someone else help me review and merge the pull request ?
Thank You!

from animation-samples.

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.