GithubHelp home page GithubHelp logo

rounak / rjimageloader Goto Github PK

View Code? Open in Web Editor NEW
833.0 833.0 89.0 361 KB

A recreation of the image loader animation created by Michael Villar for iOS

License: MIT License

Ruby 1.66% C 1.12% Objective-C 93.07% Shell 4.15%

rjimageloader's People

Contributors

bguidolim avatar rounak 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

rjimageloader's Issues

Image flicker

After the reveal animation is done, there is a quick flicker. Is there a way to remove this flicker?

Bugs

  1. pod try RJImageLoader opens broken project.
  2. trying out pod in app, animation runs once, then on second run it is inversed and finally after that it's completely gone.

I made a small video: http://cl.ly/1y0G1p050o0M. I think the problem is in SDWebImage:

    self.photoImageView.image = nil;

    [self.photoImageView startLoaderWithTintColor:[UIColor blueColor]];
    NSLog(@"Start loader");

    __weak typeof(self) weakSelf = self;
    [self.photoImageView sd_setImageWithURL:url
                           placeholderImage:nil
                                    options:SDWebImageRetryFailed | SDWebImageRefreshCached
                                   progress:^(NSInteger receivedSize, NSInteger expectedSize) {
                                       dispatch_async(dispatch_get_main_queue(), ^{
                                           CGFloat percent = (CGFloat)receivedSize / expectedSize;
                                           [weakSelf.photoImageView updateImageDownloadProgress:percent];
                                           NSLog(@"Update progress = %f", percent);
                                       });
                                   }
                                  completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
                                    [weakSelf.photoImageView reveal];
                                    NSLog(@"Reveal loader");
                                  }];

I posted couple of issues in SDWebImage related to this problem. SDWebImage/SDWebImage#1090

Since SDWebImage is a wreck, we can avoid completion handler and run all animations in progress block:

    self.photoImageView.image = nil;

    [self.photoImageView startLoaderWithTintColor:[UIColor blueColor]];
    NSLog(@"Start loader");

    __weak typeof(self) weakSelf = self;
    [self.photoImageView sd_setImageWithURL:url
                           placeholderImage:nil
                                    options:SDWebImageRetryFailed | SDWebImageRefreshCached
                                   progress:^(NSInteger receivedSize, NSInteger expectedSize) {
                                       dispatch_async(dispatch_get_main_queue(), ^{
                                           CGFloat percent = (CGFloat)receivedSize / expectedSize;
                                           [weakSelf.photoImageView updateImageDownloadProgress:percent];
                                           NSLog(@"Update progress = %f", percent);

                                           if(receivedSize == expectedSize) {
                                               [weakSelf.photoImageView reveal];
                                           }
                                       });
                                   }
                                  completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
                                  }];

But then it's all broken after I run it twice, see video: http://cl.ly/2U192i321D1N

every time loading in tableview cell?

Hi I am working with the RJImage Loader using podfile.working fine. I am using in Tableview Cell for image loading but when i scroll then every time it is showing loader and tableview not moving smoothly
below code i am using in cellForRowAtIndexPath

_imageview =cell.mediaImageView;
[_imageview startLoaderWithTintColor:[UIColor redColor]];
// [self indicatore];
__weak typeof(self)weakSelf = self;
urlString = messageString;
[weakSelf.imageview sd_setImageWithURL:[NSURL URLWithString:urlString] placeholderImage:nil options:SDWebImageRetryFailed | SDWebImageRefreshCached progress:^(NSInteger receivedSize, NSInteger expectedSize) {
[weakSelf.imageview updateImageDownloadProgress:(CGFloat)receivedSize/expectedSize];
} completed:^(UIImage image, NSError error, SDImageCacheType cacheType, NSURL *imageURL) {
[weakSelf.imageview reveal];
}];

where i am missing please help me

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.