-
Notifications
You must be signed in to change notification settings - Fork 65
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
Update progress function #18
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
==========================================
- Coverage 93.42% 91.34% -2.09%
==========================================
Files 6 6
Lines 350 358 +8
==========================================
Hits 327 327
- Misses 23 31 +8
Continue to review full report at Codecov.
|
Sorry, somehow I did not get a notification for this PR. |
@@ -100,7 +100,7 @@ open class GradientLoadingBarController { | |||
gradientActivityIndicatorView.heightAnchor.constraint(equalToConstant: height), | |||
|
|||
gradientActivityIndicatorView.leadingAnchor.constraint(equalTo: superview.leadingAnchor), | |||
gradientActivityIndicatorView.trailingAnchor.constraint(equalTo: superview.trailingAnchor) | |||
gradientActivityIndicatorView.widthAnchor.constraint(equalToConstant: superview.frame.size.width) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work correctly in case the user rotates the device.
We would need to setup a constraint with a multiplier to the superview, so something like:
gradientActivityIndicatorView.widthAnchor.constraint(equalTo: superview.widthAnchor, multiplier: progress)
|
||
let widthConstraint = widthConstraints[0] | ||
widthConstraint.constant = progress | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer having this logic on a subclass, as there are cases where the width doesn't reflect the progress, e.g. here #19
@@ -211,3 +217,5 @@ GradientLoadingBar is available under the MIT license. See the LICENSE file for | |||
|
|||
[advanced-example]: Assets/advanced-example.png | |||
[advanced-example--thumbnail]: Assets/advanced-example--thumbnail.png | |||
|
|||
[progress-example]: Assets/progress-example.gif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for providing an example asset 👍
This reverts commit 11241ba.
# Conflicts: # Example/Pods/Pods.xcodeproj/project.pbxproj # GradientLoadingBar/Classes/GradientLoadingBarController.swift # GradientLoadingBar/Classes/NotchGradientLoadingBarController.swift
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
==========================================
- Coverage 93.42% 91.34% -2.09%
==========================================
Files 6 6
Lines 350 358 +8
==========================================
Hits 327 327
- Misses 23 31 +8
Continue to review full report at Codecov.
|
Add ProgressLoadingBar description. Add setProgress() description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make ProgressLoadingBar (Subclassing NotchGradientLoadingBarController)
And Now we can support Landspcape mode.
Codecov Report
@@ Coverage Diff @@
## main #18 +/- ##
==========================================
- Coverage 93.42% 91.34% -2.09%
==========================================
Files 6 6
Lines 350 358 +8
==========================================
Hits 327 327
- Misses 23 31 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I have added a method to update the current progress value.
You can preview [progress-example.gif] in the asset folder.
Please check.