Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 6 additions & 4 deletions MaterialControls/MaterialControls/MDRippleLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ - (void)removeFromSuperlayer {
}

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
if (anim == [self animationForKey:@"opacityAnim"]) {
self.opacity = 0;
} else if (flag) {
if([[anim valueForKey:@"opacityAnim"] isEqual:@"opacity"]) {
self.opacity = 0;
} else if (flag) {
if (_userIsHolding) {
_effectIsRunning = false;
if ([self.layerDelegate respondsToSelector:@selector(mdLayer:didFinishEffect:)]) {
Expand All @@ -144,6 +144,8 @@ - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
} else {
[self clearEffects];
}
} else {
[self clearEffects];
}
}

Expand Down Expand Up @@ -324,7 +326,7 @@ - (void)clearEffects {
opacityAnim.removedOnCompletion = false;
opacityAnim.fillMode = kCAFillModeForwards;
opacityAnim.delegate = self;

[opacityAnim setValue:@"opacity" forKey:@"opacityAnim"];
[self addAnimation:opacityAnim forKey:@"opacityAnim"];
}

Expand Down
34 changes: 18 additions & 16 deletions MaterialControls/MaterialControls/MDTabBarViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,24 @@ - (void)moveToPage:(NSUInteger)selectedIndex {
__unsafe_unretained typeof(self) weakSelf = self;
disableDragging = YES;
pageController.view.userInteractionEnabled = NO;
[pageController
setViewControllers:@[ viewController ]
direction:animateDirection
animated:YES
completion:^(BOOL finished) {
weakSelf->disableDragging = NO;
weakSelf->pageController.view.userInteractionEnabled = YES;
weakSelf->lastIndex = selectedIndex;

if ([weakSelf->_delegate
respondsToSelector:@selector(tabBarViewController:
didMoveToIndex:)]) {
[weakSelf->_delegate tabBarViewController:weakSelf
didMoveToIndex:selectedIndex];
}
}];
dispatch_async(dispatch_get_main_queue(), ^{
[pageController
setViewControllers:@[ viewController ]
direction:animateDirection
animated:NO
completion:^(BOOL finished) {
weakSelf->disableDragging = NO;
weakSelf->pageController.view.userInteractionEnabled = YES;
weakSelf->lastIndex = selectedIndex;

if ([weakSelf->_delegate
respondsToSelector:@selector(tabBarViewController:
didMoveToIndex:)]) {
[weakSelf->_delegate tabBarViewController:weakSelf
didMoveToIndex:selectedIndex];
}
}];
});
}

#pragma mark - PageViewController Delegate
Expand Down