GradientLoadingBar
GradientLoadingBar copied to clipboard
RoundedGradientActivityIndicatorView added
Just simple improvement to make an indicator stick to borders of a superview.
Hey @ftp27 , thanks a lot for the PR :)
I had a look at the example application, and somehow the animation looks a bit weird. The gradient doesn't look like it's rotating along the path. If you need help with this, just let me know 👍
@fxm90 It does look weird indeed but there is a reason: the centre of the circle gradient is in the top left corner of View. I tried putting it into the centre but due to the abrupt change of colour (purple to green), it looks strange. So I decided to make it unfold like a fan not to meddle with how gradient forms, that's why it might look weird to you. Any thoughts about that?
@ftp27 Okay, got your point 👍 I'll try to review your PR this weekend :)
There is a small animation glitch in case you remove the border from the button. You can see a separate color on the top of the circle. E.g. with gradientColors = [UIColor.red, .yellow, .green]
@fxm90 Please show me an example of the code with the glitch.
@fxm90 Please show me an example of the code with the glitch.
I commented out these lines in CircleBorderedButton
:
// layer.borderColor = UIColor.CustomColors.blue.cgColor
// layer.borderWidth = 1.0
I applied some "easer to see" colors in AdvancedExampleViewController
:
cirlceGradientActivityIndicatorView.gradientColors = [.red, .yellow, .green]
And finally increased the border width inside RoundedGradientActivityIndicatorView
, so it's also easier to see:
public var borderWidth: CGFloat = 10