GradientLoadingBar icon indicating copy to clipboard operation
GradientLoadingBar copied to clipboard

RoundedGradientActivityIndicatorView added

Open ftp27 opened this issue 3 years ago • 6 comments

Just simple improvement to make an indicator stick to borders of a superview.

Example

ftp27 avatar Nov 15 '20 10:11 ftp27

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 avatar Nov 20 '20 14:11 fxm90

@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 avatar Nov 20 '20 21:11 ftp27

@ftp27 Okay, got your point 👍 I'll try to review your PR this weekend :)

fxm90 avatar Nov 21 '20 13:11 fxm90

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]

appVideo

fxm90 avatar Nov 22 '20 14:11 fxm90

@fxm90 Please show me an example of the code with the glitch.

ftp27 avatar Nov 23 '20 08:11 ftp27

@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

fxm90 avatar Nov 25 '20 08:11 fxm90