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

Update progress function #18

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Update progress function #18

wants to merge 23 commits into from

Conversation

wowpotato
Copy link

I have added a method to update the current progress value.
You can preview [progress-example.gif] in the asset folder.
Please check.

@codecov-commenter
Copy link

Codecov Report

Merging #18 into master will decrease coverage by 2.08%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
...dingBar/Classes/GradientLoadingBarController.swift 71.42% <11.11%> (-11.91%) ⬇️
...ar/Classes/NotchGradientLoadingBarController.swift 95.52% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c8a345...8754a51. Read the comment docs.

@fxm90
Copy link
Owner

fxm90 commented Nov 20, 2020

Sorry, somehow I did not get a notification for this PR.
Will look at this now ✌️

@@ -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)
Copy link
Owner

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
}
Copy link
Owner

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
Copy link
Owner

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 👍

@codecov-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

Merging #18 (8754a51) into master (5c8a345) will decrease coverage by 2.08%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
...dingBar/Classes/GradientLoadingBarController.swift 71.42% <11.11%> (-11.91%) ⬇️
...ar/Classes/NotchGradientLoadingBarController.swift 95.52% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5c8a345...3e53f26. Read the comment docs.

Copy link
Author

@wowpotato wowpotato left a 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.

@wowpotato wowpotato requested a review from fxm90 August 20, 2021 00:11
@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2022

Codecov Report

Merging #18 (8754a51) into main (5c8a345) will decrease coverage by 2.08%.
The diff coverage is 20.00%.

❗ Current head 8754a51 differs from pull request most recent head 74caee7. Consider uploading reports for the commit 74caee7 to get more accurate results

@@            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     
Impacted Files Coverage Δ
...dingBar/Classes/GradientLoadingBarController.swift 71.42% <11.11%> (-11.91%) ⬇️
...ar/Classes/NotchGradientLoadingBarController.swift 95.52% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

Successfully merging this pull request may close these issues.

4 participants