loadtoast icon indicating copy to clipboard operation
loadtoast copied to clipboard

Add support for getting toast animation status/callback

Open lwasyl opened this issue 10 years ago • 2 comments

Currently it's a bit ugly to for example show loadtoast, and on success finish activity - toast's animation plays together with activity's. It would be nice to have LoadToast#isShowing() method, as well as LoadToast#setOnAnimationCompleteListener, to be able to wait until animation finishes to do stuff.

I'm willing to issue a pull request with this change - only please let me know if you're willing to merge it later, and if there's preferred place to put animation listeners (LoadToast class or LoadToastView), and if there's anything special I should consider?

lwasyl avatar Sep 08 '15 09:09 lwasyl

I know this is a bit late (Github stopped emailing me issues for some odd reason) but I'm fully against isShowing() as that basically implies your code is so bad you aren't even able to keep track of a damn toast. For the animationlistener, sure why not, BUT it should be a fully featured one that triggers on start and on stop of the animation imo.

The listener should be inside LoadToast as that handles the sliding up and down which are the first and last animations to trigger.

code-mc avatar Sep 23 '15 14:09 code-mc

I'm fully against isShowing() as that basically implies your code is so bad you aren't even able to keep track of a damn toast.

Well, it would, if toast wouldn't be visible for X time after a call to hide it. I meant isShowing as in is it still visible to the user, for example during hiding animation. Although I can agree it's not prettiest API and I won't insist on it.

Start and stop of animation makes sense. I'll see when I can code something. Thanks for reply!

lwasyl avatar Sep 23 '15 15:09 lwasyl