Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling .hide() on an infinite crouton does not allow any future .show()'s #123

Closed
joepetrakovich opened this issue Sep 5, 2013 · 8 comments
Milestone

Comments

@joepetrakovich
Copy link

After calling hide() on an infinite crouton, and then later trying to show() it again, nothing is displayed.

It seems the only way to do it is to re-make() the infinite crouton EVERY time I need it, and then cancel() it (losing the nice animation feature).

@keyboardsurfer
Copy link
Owner

This seems a bit odd and I'll have to look into this before it can be confirmed.

@joepetrakovich
Copy link
Author

I actually think this might be a duplicate. It only seems to break when I call hide soon after show. AND calling show of a different, non-infinite crouton right after that last hide.

The sequence is:

User wants to load data from the web. Infinite loading crouton is shown. There is no network connection so it is immediately hidden with hide. A regular ALERT crouton is shown in the same view_group.

It will either do some strange animation where the infinite is blipping out at the same time the ALERT is jerking in.
Or my application will just crash at OnGlobalLayout at the call to startAnimation with a null pointer.

@TeknoloGenie
Copy link

same here

i have a bunch of activities and everyone of them contain a statement in the onCreate(), when visiting another activity it pops in really fast then goes out. Doesn't allow the crouton to be displayed again, maybe my scenario is a little different, but same issue. Same end result.

Boolean connected = teknoloGenie.isNetworkConnected(getApplicationContext());
if (!connected) {
String needToActivateAlert = "No internet connection";
showCrouton(needToActivateAlert, Style.ALERT, CONFIGURATION_INFINITE);
}

@keyboardsurfer
Copy link
Owner

Are you sure to use the workaround described in #24 ?

@TeknoloGenie
Copy link

Sorry @keyboardsurfer but that didn't fix my issue, i have done that on all of my activity's

@keyboardsurfer
Copy link
Owner

@TeknoloGenie no problem I was just checking.

@TeknoloGenie
Copy link

I found my reason, somehow the onDestroy() isn't getting called right away, even though I'm calling finish on my Intents, so my workaround isn't putting Crouton.clearCroutonsForActivity(this); in the onDestroy(), its putting it right before all of my startActivity()

@MasterGroosha
Copy link

Same problem here (in a single activity).
When first using .hide(), no future alert croutons will be shown.

Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants