Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ProgressView] Backward animation support #1138

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change ProgressViewExample with new enum name.
  • Loading branch information
ajsecord authored Jan 5, 2017
commit a639babd3628afa3dd92bd50d98fab25386b4bfd
6 changes: 3 additions & 3 deletions components/ProgressView/examples/ProgressViewExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ - (void)setupProgressViews {

_backwardProgressAnimateView = [[MDCProgressView alloc] init];
_backwardProgressAnimateView.translatesAutoresizingMaskIntoConstraints = NO;
_backwardProgressAnimateView.backwardProgressAnimationMode = MDCProgressViewBackwardProgressAnimationModeBackward;
_backwardProgressAnimateView.backwardProgressAnimationMode = MDCProgressViewBackwardAnimationModeAnimate;
[self.view addSubview:_backwardProgressAnimateView];
// Have a non-zero progress at setup time.
_backwardProgressAnimateView.progress = 0.5;
_backwardProgressAnimateView.progress = 0.33;
}

@end
Expand Down Expand Up @@ -251,7 +251,7 @@ - (void)animateBackwardProgressResetView {
- (void)animateBackwardProgressAnimateView {
__weak ProgressViewExample *weakSelf = self;

[_backwardProgressAnimateView setProgress:fmod((_backwardProgressAnimateView.progress + 0.5), 1)
[_backwardProgressAnimateView setProgress:1 - _backwardProgressResetView.progress
animated:YES
completion:^(BOOL finished) {
[weakSelf performSelector:@selector(animateBackwardProgressAnimateView)
Expand Down