Created
October 15, 2022 23:32
-
-
Save angusholder/944a34d942cc367d52c785ca63181530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final Handler uiHandler = new Handler(Looper.getMainLooper()); | |
private void startAnimation() { | |
animateBallRestart(firstBall); | |
uiHandler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
animateBallRestart(secondBall); | |
uiHandler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
animateBallRestart(thirdBall); | |
} | |
}, Constants.ANIMATION_DELAY_MILLIS); | |
} | |
}, Constants.ANIMATION_DELAY_MILLIS); | |
} | |
@Override | |
public void onDestroyView() { | |
super.onDestroyView(); | |
// Cancels any currently queued calls to Handler.postDelayed | |
uiHandler.removeCallbacksAndMessages(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment