Giter Site home page Giter Site logo

gontovnik / dgactivityindicatorview Goto Github PK

View Code? Open in Web Editor NEW
1.8K 47.0 289.0 5.94 MB

DGActivityIndicatorView is a great way to make loading spinners in your application look nicer. It contains 32 different indicator view styles.

License: MIT License

Objective-C 99.12% Ruby 0.88%

dgactivityindicatorview's Introduction

DGActivityIndicatorView

DGActivityIndicatorView is a great way to make loading spinners in your application look nicer. It contains 32 different indicator view styles. Inspired by: http://connoratherton.com/loaders

alt tag

Requirements

  • Xcode 6 or higher
  • Apple LLVM compiler
  • iOS 8.0 or higher (May work on previous versions, just did not testit. Feel free to edit it).
  • ARC

Demo

Open and run the DGActivityIndicatorExample project in Xcode to see DGActivityIndicatorView in action.

Installation

CocoaPods

Install CocoaPods if it is not installed yet:

$ [sudo] gem install cocoapods
$ pod setup

Add DGActivityIndicatorView to Podfile:

pod 'DGActivityIndicatorView'

Call 'pod install':

pod install

Manual install

All you need to do is drop DGActivityIndicatorView folder into your project and include headers.

Example usage

DGActivityIndicatorView *activityIndicatorView = [[DGActivityIndicatorView alloc] initWithType:DGActivityIndicatorAnimationTypeDoubleBounce tintColor:[UIColor whiteColor] size:20.0f];
activityIndicatorView.frame = CGRectMake(0.0f, 0.0f, 50.0f, 50.0f);
[self.view addSubview:activityIndicatorView];
[activityIndicatorView startAnimating];

TODO

  • Add more different animations

Contact

Danil Gontovnik

License

The MIT License (MIT)

Copyright (c) 2015 Danil Gontovnik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

dgactivityindicatorview's People

Contributors

gontovnik avatar humblehacker avatar lkuczborski avatar ninjaprox avatar readmecritic avatar soffes avatar triplecc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dgactivityindicatorview's Issues

你的示例程序的控制器中写错了一个地方

`
for (int i = 0; i < activityTypes.count; i++) {

    DGActivityIndicatorView *activityIndicatorView = [[DGActivityIndicatorView alloc] initWithType:(DGActivityIndicatorAnimationType)[activityTypes[i] integerValue] tintColor:[UIColor whiteColor]];
    CGFloat width = self.view.bounds.size.width / 5.0f;
    CGFloat height = self.view.bounds.size.height / 7.0f;
    activityIndicatorView.frame = CGRectMake(width * (i % 7), height * (int)(i / 7), width, height);
    [self.view addSubview:activityIndicatorView];
    [activityIndicatorView startAnimating];

}`

宽度应该是除以7,不是除以5

setTintColor should invoke setupAnimation to prevent bugs of unchanged color

this fixed a bug where the component didn't update proper on tint color change

- (void)setTintColor:(UIColor *)tintColor {
    if (![_tintColor isEqual:tintColor]) {
        _tintColor = tintColor;
        
        [self setupAnimation];
        
//        CGColorRef tintColorRef = tintColor.CGColor;
//        for (CALayer *sublayer in _animationLayer.sublayers) {
//            sublayer.backgroundColor = tintColorRef;
//            
//            if ([sublayer isKindOfClass:[CAShapeLayer class]]) {
//                CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
//                shapeLayer.strokeColor = tintColorRef;
//                shapeLayer.fillColor = tintColorRef;
//            }
//        }
    }
}

Bad math for sample display

The display project doesn't actually show all the items because their width is /5 meanwhile you're using a %7 for the x position. The .gif in the readme (which looks like it just came from the sample project) doesn't actually display all the options.

Animations take time to stop

I tried stopAnimating and also hidden = YES but the animation continues on screen for a couple of seconds after being asked to stop.

Add type names to README graphic.

Great library! Was thinking it would be helpful for users of this library if you add the type names used for the various indicators to the graphic in the README so that it is clear which is which.

Blinking on iPhone 6S and above

We are using loader type 9 and we face issue when starting and ending loader animation is blinking the hole screen with loader animation.

Screen Rotations (even when not animated) freezes app

Not quite sure why, but if the DGActivityIndicatorView:setupAnimation is called, the app will "freeze" up (not crash) when the device/screen is rotated.

If I comment out my call to DGActivityIndicatorView:setSize: (which calls setupAnimation), the app will rotate and continue functioning correctly.

Swift

hello! I am a beginner of the iOS, I use a Swift, translation of the library, you have a problem, the last two don't know how to remove the animation in the middle of the curve. Don't know why the Objective - c: no problem, trouble you see, what's the problem? https://github.com/king129/SJActivityIndicatorView.git

DGActivityIndicatorThreeDotsAnimation Animation is wrong

The animation for DGActivityIndicatorThreeDotsAnimation is not staggered like in the gif preview. All dots grow and shrink at the same time instead of staggering the way the gif on this repository shows. The solution can be made in DGActivityIndicatorThreeDotsAnimation.m

Change: animation.beginTime = beginTime;

To: animation.beginTime = beginTime+((0.5f/3.0f)*(float)i);

Carthage

Can you please add support for installation through Carthage?

Swift

How about a Swift version?

New release with new views

Hi,

Could you please update CocoaPods with the new views? The current version has only 5 views, and I've been seen amazing new views I would like to try.

Actually, I will try to update my Podfile with the last commit here to test, but a new version would be great :)

Thanks, have a nice day!

Unable to restart animations after application has returned from background

I am using iOS 9.2, Swift 2, Cocoapods. DGActivityIndicatorView (2.0)

I am adding animation to a login process and in some cases that goes via Facebook (which backgrounds my app.) Upon return the animation is frozen, and I cannot seem to resuscitate it (despite efforts to start or stop/start in viewDidAppear.) I've tried things I've read (on Stack Overflow) such as setting setNeedsDisplay on the animation, it's superview, the main view. No success.

It there a way to help the animation know it needs to start afresh?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.