Grav icon indicating copy to clipboard operation
Grav copied to clipboard

Animation Would Not Restart Properly After "stop" Method Call

Open jhxie opened this issue 7 years ago • 2 comments

Hello,

In the "GravSampleFragment" fragment class of the sample app, I noticed the "onPause" life-cycle method is overridden with an extra call to:

gravView.stop();

I tried to let the animation restart by adding the following code in the "GravSampleFragment" fragment class:

@Override
public void onResume() {
    super.onResume();
    if (!running) {
      running = true;
      gravView.start();
    }
}

and changed the existing two methods to the following:

private boolean running;
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ButterKnife.bind(this, view);
    running = true;
}

@Override
public void onPause() {
    super.onPause();
    gravView.stop();
    running = false;
}

But unfortunately the animation would not restart (or continue from the stopped state) despite the fact that gravView.start() is called. Could you please point out whether it is possible to restart the animation once stopped? Thank you!

jhxie avatar Apr 16 '17 03:04 jhxie

I got the same issue. Tried to call initializeRefreshAnimator of GravView before start() to reinitialize animator, but it doesn't help

ductranit avatar Apr 24 '17 15:04 ductranit

I am seeing the same issue only on older devices (4.X).

LaurieScheepers avatar Nov 21 '17 20:11 LaurieScheepers