Comments (11)
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 spb_progressiveStart_activated
is set to true, that means the progressbar
will be started progressively every times it is shown. To be honest, I am really thinking about removing this attribute in the future releases.
Can you try to set the spb_progressiveStart_activated
to false
(or simply remove it), and call progressiveStart / progressiveStop.
I'll try to reproduce it,
Thanks!
from smoothprogressbar.
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.
from smoothprogressbar.
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 progressbar
(both with an instance of the listener) on top of the activity. I will try to reproduce it in the sample and let you know here.
from smoothprogressbar.
Hi, does the stop
animation of the progressbar is like SwipeRefreshLayout? i.e the ongoing animation gets completed first before making the progressbar invisible
or gone
?
I am just setting setVisiblity as gone
after my asynctask is completed. How could I make it end with a more smoother animation?
from smoothprogressbar.
@sahildave The stop
method just stops the animation. I think you are refering to the progressStop
method.
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
from smoothprogressbar.
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 progressiveStart()
. Weirdly enough, after activating it via the button, if I stop it, and try to activate it again, it can't get visible anymore. I tried to replicate my issue (with 2 activities loaded, both having a progressBar and listeners), but that doesn't seem to make a difference.
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 onCreate()
) than the XML is rendered (with visibility="gone"
), but I have too little knowledge of the render order to know this theory to be true. This also won't explain why the progressBar won't get visible anymore, after the progressiveStop()
.
Now, for my original issue, I fixed my problem. I removed spb_progressiveStart_activated
, initial visibility and all changes to visibility. The only reason I was setting visibility on start and stop, was because spb_progressiveStart_activated
made the progressBar active on resume. Now everything behaves as it should. Maybe it is a good idea to remove the spb_progressiveStart_activated
property altogether or document it better in the readme.
from smoothprogressbar.
Can you test 424e40c ?
from smoothprogressbar.
Awesome, that fixes the onStart()
method that only got called once. Any idea why it isn't visible initially in the sample (on this branch)? I expect that to be something out of the scope for your library, so you can close this issue if you want 👍 . Do you want me to try modifying the readme to make it clearer to understand and submit a pull req?
from smoothprogressbar.
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 onVisibilityChanged(View, int)
is called with a visibility = GONE/INVISIBLE, it stops the animation, which will call the SmoothProgressBar.CallBacks#onStop() method.
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.
from smoothprogressbar.
I have the same kind of issue when displaying the SmoothProgressBar in a fragment which is inside a ViewPager.
For example in my application, I have 3 pages so 3 framgents with the same type. On loading, I display the smoothscrollingbar on the 2 first fragments because they have stuff to load but not the third one. Nevertheless, when I swipe to the third page, the smoothscrollingbar is displayed (even if I put it INVISIBLE in the XML).
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.
from smoothprogressbar.
Here seems that:
android:indeterminate="true"
is the problem. When this is set
app:spb_progressiveStart_activated="true"
is totally ignored. Setting this all programmatically seems fine.
from smoothprogressbar.
Related Issues (20)
- Unable to update to CircularProgressBar 1.3.0 HOT 3
- how to set the color of the Circularprogressbar HOT 2
- Not able to build HOT 1
- Can't convert to dimension: type=0x1 HOT 1
- Determinate Mode HOT 1
- Increase the Storke Width HOT 1
- Caused by android.content.res.Resources$NotFoundException
- Error inflating class fr.castorflex.android.circularprogressbar.CircularProgressBar on AS 3.2.1
- Google Play Store link do not work HOT 2
- Df
- Support Android X HOT 1
- Gui
- Is this library deprecated because of not supporting AndroidX or someother reason is there? HOT 1
- JCenter replacement HOT 3
- Started lagging on Samsung phones HOT 1
- Release 1.4
- Determinate style for Horizontal HOT 1
- How to set background to transparent if used as non-intermediate progress bar HOT 1
- Not working after upgrading to api level 26 with android studio 3.0: Error inflating class fr.castorflex.android.circularprogressbar.CircularProgressBar HOT 10
- is it possible to use Smooth Progressbar in a Notification HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smoothprogressbar.