GithubHelp home page GithubHelp logo

mdinacci / mdradialprogress Goto Github PK

View Code? Open in Web Editor NEW
949.0 949.0 159.0 572 KB

A custom UIView useful to represent progress in discrete steps.

License: Other

Objective-C 98.16% Ruby 1.84%
custom-uiview ios objective-c

mdradialprogress's People

Contributors

erduoniba avatar foo4u avatar hermanolsson avatar huguesbr avatar kaizensoze avatar marcaudefroy avatar mbuchetics avatar mdinacci avatar midea-smart avatar nicolasgoutaland avatar oduwa avatar sunkehappy avatar xuan avatar xzenon 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

mdradialprogress's Issues

Unable to animate centerColor

I've been trying to change color smoothly with this approach:

[UIView animateWithDuration:10.0 animations:^{
self.progressView.theme.centerColor = [UIColor colorWithRed:0.15 green:0.3 blue:0.45 alpha:0.1];
}];

...but instead of a gradual shift it changes the color immediately.
Do you know why this doesn't work and how I might go about getting a smooth transition?

Crash on iphone 6 plus.

On iphone 6 plus the radilProgressView crashes on drawArcInContext giving EXEC_BAD_ACCESS error. Please help me what is the matter ?

It works one first start. then after going back to the view where the radial is placed. IT crashes ono following method.

  • (void)drawArcInContext:(CGContextRef)context center:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle
    endAngle:(CGFloat)endAngle color:(CGColorRef)color clockwise:(BOOL)cgClockwise
    {
    CGContextBeginPath(context);
    CGContextMoveToPoint(context, center.x, center.y);
    CGContextAddArc(context, center.x, center.y, radius, startAngle, endAngle, cgClockwise);
    CGContextSetFillColorWithColor(context, color);

    CGContextFillPath(context); //crash on this point exc_bad_access
    }

Update with uislider

Hi,
when i connect the value of a slider and MDRadial, the view stay the same.

  • (IBAction)sliderrValue:(id)sender {
    self.radialView.progressCounter = self.slider.value;
    }

Thx.

Incorrect constructor : awakeFromNib

Hi,

thanks for your control.

I've found a bug when loading it from a XIB, and trying to initialize it in the awakeFromNib method of my cell.

In fact, you've implemented the awakeFromNib constructor. A component loaded from a XIB should implement initWithCoder: instead.

When using your control in a UICollectionViewCell for example, and trying to configure it in the awakeFromNib method of the UICollectionViewCell, the awakeFromNib method of your control is called after. So configuration aren't kept.

CustomCollecitonViewCell.h

- (void)awakeFromNib
{
    [super awakeFromNib];

    MDRadialProgressTheme *theme = _progressView.theme;
    theme.completedColor = [UIColor redColor];
    theme.centerColor = [UIColor whiteColor];
    theme.labelShadowColor = [UIColor blackColor];

    // _progressView is an outlet defined in the xib
    _progressView.theme = theme;
}

// Past this point, awakeFromNib method will be called in your MDRadialProgressView. Perhaps a change in iOS7 xib loading ?

To fix that, you have to replace your awakeFromNib method by the initWithCoder constructor.

Regards,

Redraw delay with a larger view using a NSTimer

Hi,

I am developing a countdown updating the radial progress view every millisecond and I have detected a delay when I use this component on a big UIView added from .xib file.

Can it be caused by a redraw time delay?

Here's my code:

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self initViews];
    self.timer = [NSTimer scheduledTimerWithTimeInterval: 0.01 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES];
}

-(void)updateCountdown {
    self.progressView.progressCounter -= 1;
    [self.lbCounter setText:[NSString stringWithFormat:@"%lu", (unsigned long)(self.progressView.progressCounter/100)+1]];
    if (self.progressView.progressCounter == 0) {
        [self.timer invalidate];
    }
}

I'd appreciate it if you could take a look at it,
Thanks

Purpose of MDRadialProgressTheme themeWithName:+ constructor ?

Hi,

I think this method has no purpose actually. Was it supposed to enable support for shared theme accross application ?

Are you open to a pull request ?

I think we can handle a private dictionary, allowing use to return shared instance of themes accross application, allowing use for example to modify defaultTheme ?

Regards

Make sure MDRadialProgress work with Auto Layout

MDRadialProgress must provide information about its size to the Auto Layout system.
One issue caused by failing to do so is that the label is not displayed correctly when the frame is resized,
See #33 for more details.

Can't get it to work...

Here's my code:

self.approvalGraph.completedColor = [UIColor greenColor];
self.approvalGraph.incompletedColor = [UIColor grayColor];
self.approvalGraph.thickness = 5;
self.approvalGraph.sliceDividerColor = [UIColor colorWithWhite:244./255. alpha:1.0];
// Be sure to use the same color for background and sliceDivider to simulate
// the space between one step and another.
self.approvalGraph.backgroundColor = [UIColor colorWithWhite:244./255. alpha:1.0];
self.approvalGraph.progressTotal = 100;
self.approvalGraph.sliceDividerHidden = YES;
self.approvalGraph.sliceDividerThickness = 1;
int val = 50;

and this is what I get:

screenshot_01

New feature demand

I want to set completed and incompleted thickness as different, but I don't find some property

Can not be very easy to control whether to display the percent sign

Can not be very easy to control whether to display the percent sign, your project is not through the control switch, you may be able to add a bool attributes to control, I tried, realize, and convenient.
You may see this:
Add:

MDRadialProgressView.h
// 控制是否显示显示百分号
// whether or not
@property(nonatomic,assign) BOOL isShowPercentMark;
"MDRadialProgressView.m"
 if (self.isShowPercentMark == YES) {
             text = [NSString stringWithFormat:@"%.0f%%", percentageCompleted];
        }else if (self.isShowPercentMark == NO){
        text = [NSString stringWithFormat:@"%.0f", percentageCompleted];
        }

Can't import MDRadialProgress

hello,

since I did the update to xcode 6, I can not import MDRadialProgress . Yet on my old projects that use MDRadialProgress it works . Here is my error window .

( Sorry for my English i'm french)

capture d ecran 2014-10-25 a 19 49 09

Label / Progress theme sharing

Just reread your label implementation, seems that label don't own a theme.
So label refresh should be done by progress on theme update.

Incompleted arc not drawn

If progressCounter is 0 (zero) and sliceDividerHidden is set to YES, the incompleted arc does not get drawn. It returns as soon as progressCounter > 0 (see pictures below).

I am using MDRadialProgress version 1.0.7, downloaded from GitHub.

ios simulator screen shot 15 jul 2014 10 10 31 copy
ios simulator screen shot 15 jul 2014 10 10 35 copy

Feature Request: Animate Filling

A nice feature would be to animate the progress bar

Something I could work on if I ever have time but just throwing it out there...

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.