-
Notifications
You must be signed in to change notification settings - Fork 1k
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
SmoothProgressBar starts on resume activity #35
Comments
Hi @thermometer. Thank you for your detailed issue! You make me realize I really have to write some doc :s ... sorry about that. If the attribute Can you try to set the I'll try to reproduce it, Thanks! |
Actually I just tried to reproduce it, and couldn't. I created a branch (named issue35) to try to reproduce your problem. Here is the commit: 2d93cd0 Can you try to install the sample app or modify the sample app code in this branch so we can reproduce your issue? Thank you. |
Awesome! Thanks for the quick reply. Yeah I think the javadoc/readme could use some work. I can help with the readme part if you want 👍 I noticed that when I only have 1 activity with the progress bar, the issue won't occur. I think it has something to do with me having another activity with a |
Hi, does the I am just setting setVisiblity as |
@sahildave The mProgressBar.setSmoothProgressDrawableCallbacks(new SmoothProgressDrawable.Callbacks() {
@Override
public void onStop() {
mPocketBar.setVisibility(View.GONE);
}
@Override
public void onStart() {
mPocketBar.setVisibility(View.VISIBLE);
}
});
mProgressBar.progressiveStop(); PS: please, create a StackOverflow post next time |
- Added listener to second activity - Set initial visibility to gone - progressiveStart the progressBar after init
Heya, I partly reproduced my issue in the sample you provided. If I add the listener, set initial visibility to gone in the XML and then start the progressBar, it stays hidden until I again activate it via the button on Now, the same implementation of the sample and my app, shows different results. In my app, only the second activity I start, won't show the progressBar. The first works fine with the same code. In the sample, both activities won't show the progressBar. I have the feeling it has something to do with my first activity having a fragment in it with the progressBar, instead of in the activity. A theory I have why the progressBar won't show in the sample, is because I may start it earlier (in Now, for my original issue, I fixed my problem. I removed |
Can you test 424e40c ? |
Awesome, that fixes the |
The ActivityThread change the visibility of the decor after onResume() is called, setting it to INVISIBLE, then to VISIBLE. This visibility change will be dispatched through the whole hierarchy, including ProgressBar. When the ProgressBar's That is why onStop() will be called just after onStart(). Unfortunately, we set the visibility to GONE in the callback, so the ProgressBar won't be shown :( I'll try to work around. |
# By Antoine Merle (4) and Subrahmanya Somayaji M (1) # Via Antoine Merle * 'master' of https://github.com/castorflex/SmoothProgressBar: Added gif in readme Updated plugins, incremented versions code/numbers... Updated Sample Added a test before scheduling the next update. Closes castorflex#35 Added screenshots
I have the same kind of issue when displaying the SmoothProgressBar in a fragment which is inside a ViewPager. It's like something is showing it in the onStart or onResume of the fragment, which is called each time you swipe to a page. |
Here seems that:
is the problem. When this is set
is totally ignored. Setting this all programmatically seems fine. |
Heya,
My compliments for this awesome library! I love the way I can customize the progress bar on so many levels.
I am running into an issue with my progress bar starting, when my activity resumes (after dismissing another activity and coming back to the progress bar activity).
I tried to handle it with the
setSmoothProgressDrawableCallbacks
, and handling hiding & showing in theonStop()
andonStart()
methods, but this doesn't give the expected result.I am initializing my progress bar in my activity's
onCreate()
:And having customized the progress bar in XML:
Without adding the
ProgressBarListener
, everything works as expected, except that when the activity comes in view, it starts again.My
ProgressBarListener
:With the listener, I don't see the progress bar at all.
Do you have any idea what I am doing wrong? I've put breakpoints in the listener, and it seems that
onStop()
is called first, thenonStart()
is called twice strangely enough.Thanks in advance!
The text was updated successfully, but these errors were encountered: