-
Notifications
You must be signed in to change notification settings - Fork 269
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
Set the fill level manually #4
Comments
I will keep this is mind for the next release. Thanks for the advice ;)
|
@JorgeCastilloPrz This would be an invaluable feature in order to be able to use this a loader. How difficult would it be to implement such a function? |
Not really much. Just a little bit of time. I will do it next week if i can.
|
@JorgeCastilloPrz Had a chance to look at it yet? |
This is indeed a must have for a loader, as there's a good chance that one can't predetermine that amount of time a task takes. If possible, can you provide us with an ETA on this? cheers, |
I want to work on this, but i am totally busy this month and the next one I will totally review any PRs providing this feature if you want to work on I am so sorry.
|
No bother, I totally understand. I may actually provide you with a PR within the next couple of weeks as this loader seems amazing and we want to use it Cheers, Sakis From: Jorge Castillo [mailto:notifications@github.com] I want to work on this, but i am totally busy this month and the next one I will totally review any PRs providing this feature if you want to work on I am so sorry.
— No virus found in this message. |
Thanks ;)
|
Hey Jorge. We will release an app in the next couple of weeks with your loader included. You might want to check it out once it's published. Maybe you'll get a decent list of using apps over time. Cheers |
Sounds good ;). Just get in contact again with a link to the app so I can
|
Hello, turns out I will be adding this feature right away! Are you happy with the following: When the user selects a percentage then the stroke will first be drawn for the selected amount of strokeDrawingDuration, and then the fill will be added all the way up to the percentage selected, with the specified animation. The animation will slowly fill the shape for a duration relative to the fillDuration. E.g. for a fillDuration of 10 seconds, a 50% percentage will take 5 seconds. When the percentage value defined is reached then the loading freezes. If we then move to 60% that will be another 10% loading out of 10 seconds which is 1 second, so loading will continue from 50% to 60% and will take 1 second. The view will keep drawing itself until we've reached the 100%. When that's done the shape will be filled with the same pace and finish all actions. For our example when we mark the loading bar as 100% it will slowly start filling from 60% to 100% for 4 seconds then finish. What do you think ? |
@athkalia If you're setting the percentage of fill what is the point of having duration? Wouldn't the whole point of setting the fill manually be to avoid setting any durations. You could perhaps make the first 10% for the stroke and the other 90% for the fill and whenever you setPercentage it will go from current percentage to the stated percentage in under a second that way keeping it somewhat smooth whilst quick. I think that if there is an option to set the fill manually it should not rely on any durations. |
I think the most interesting thing to do here would be doing the stroke anim with the duration stated by the user at first, but just one time. then use the percent setter to fill from the current already filled percent to the new one. Always do it using onDraw() logic , and not using animations. That would generate an interesting effect, I think. The user always has the power of setting the stroke drawing time to 0 if he do not want to animate stroke when using it as a loader. But let's not remove that possibility. |
Exactly. If the user wants to make it 100% accurate, then they can set the strokeDuration and the fillDuration to 0. Then it just follows the percentage. (First doing the whole stroke instantly, then doing the fill according to the percentage). But I doubt this will be any good on the eye. I think that the most eye catching result will be a "relaxed" loading bar that has small values for strokeDuration and the fillDuration. I'll try to make a pr today, and you guys can give it a shot and tell me what you think ! |
Ok. Keep an eye on code style. Travis Build is using it and it must pass. Use Java Square Code Styles if you want it to be easier. |
Yes ok setting the duration to 0 would be ideal as it gives flexibility. As soon as you make a PR I'll test right away and give you feedback. |
Hey, the commit is ready, but when I try to push it to a new branch it gets rejected. Are there some kind of permissions that you need to grant me with so that I can create a remote branch in your repo ? |
@athkalia Maybe try forking it and sending a PR from your repo? |
That's it. Try forking it before applying the changes and opening the PR to compare your feature branch extracted from your fork, with my master branch. |
Hey, thanks. That's what I did Made a Pull request here: |
Has the pull request been implemented? |
PR #5 was merged in so we can close this. |
Sure!
|
Already merged and working for version 1.03. Check It out and thanks for the PRs to everybody ! |
Hi,
as far as I see there is no possibility to set the fill level by hand. This would be nice in order to turn it into an actual loader. Currently you specify a time value for the loader, which is not quite the intention of a loader. Consider a process like a call against an API or database or whatever. Depending on the current status of the request one could set the fill level as a percentage scale. Another possibility would be to restart the loader once he is done (aka repeat mode). I think this is even easier to implement and usually more appropriate for loaders since one does not always have a way to get the current requests state.
Let me know if my explanation was helpful or if you need more information.
Best regards
dasheck
The text was updated successfully, but these errors were encountered: