Skip to content

Commit 08eb04d

Browse files
committed
。。。动画
1 parent 7c5d850 commit 08eb04d

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

Coding_iOS/Controllers/RootControllers/Project_RootViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ -(void)addItemClicked:(id)sender{
234234
break;
235235
}
236236
};
237-
[_myPopMenu showMenuAtView:kKeyWindow startPoint:CGPointMake(0, -100) endPoint:CGPointMake(0, kScreen_Height +100)];
237+
[_myPopMenu showMenuAtView:kKeyWindow startPoint:CGPointMake(0, -100) endPoint:CGPointMake(0, -100)];
238238

239239
// if ([KxMenu isShowingInView:self.view]) {
240240
// [KxMenu dismissMenu:YES];

Coding_iOS/Vendor/PopMenu/PopMenu.m

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define MenuButtonHeight 110
1515
#define MenuButtonVerticalPadding 10
1616
#define MenuButtonHorizontalMargin 10
17-
#define MenuButtonAnimationTime 0.5
17+
#define MenuButtonAnimationTime 0.1
1818
#define MenuButtonAnimationInterval (MenuButtonAnimationTime / 5)
1919

2020
#define kMenuButtonBaseTag 100
@@ -59,7 +59,7 @@ - (void)setup {
5959
_realTimeBlur = [[XHRealTimeBlur alloc] initWithFrame:self.bounds];
6060
_realTimeBlur.blurStyle = XHBlurStyleTranslucentWhite;
6161
_realTimeBlur.showDuration = 0.3;
62-
_realTimeBlur.disMissDuration = 1.0;
62+
_realTimeBlur.disMissDuration = 0.5;
6363
_realTimeBlur.willShowBlurViewcomplted = ^(void) {
6464
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
6565
weakSelf.isShowed = YES;
@@ -172,8 +172,8 @@ - (void)showButtons {
172172
menuButton.frame = fromRect;
173173
}
174174

175-
double delayInSeconds = index * MenuButtonAnimationInterval;
176-
175+
double delayInSeconds = (items.count - index) * MenuButtonAnimationInterval;
176+
// NSLog(@"showButtons delayInSeconds:%d - %.3f", index, delayInSeconds);
177177
[self initailzerAnimationWithToPostion:toRect formPostion:fromRect atView:menuButton beginTime:delayInSeconds];
178178
}
179179
}
@@ -192,7 +192,7 @@ - (void)hidenButtons {
192192

193193
switch (self.menuAnimationType) {
194194
case kPopMenuAnimationTypeSina:
195-
toRect.origin.y = self.endPoint.y;
195+
toRect.origin.y = self.endPoint.y ;
196196
break;
197197
case kPopMenuAnimationTypeNetEase:
198198
toRect.origin.x = self.endPoint.x - CGRectGetMidX(menuButton.bounds);
@@ -201,9 +201,10 @@ - (void)hidenButtons {
201201
default:
202202
break;
203203
}
204-
// double delayInSeconds = (items.count - index) * MenuButtonAnimationInterval;
205-
double delayInSeconds = (items.count - index) * 0.05;
204+
double delayInSeconds = index * MenuButtonAnimationInterval;
206205

206+
// NSLog(@"hidenButtons delayInSeconds:%d - %.3f", index, delayInSeconds);
207+
207208
[self initailzerAnimationWithToPostion:toRect formPostion:fromRect atView:menuButton beginTime:delayInSeconds];
208209
}
209210
}
@@ -254,10 +255,12 @@ - (void)initailzerAnimationWithToPostion:(CGRect)toRect formPostion:(CGRect)from
254255
springAnimation.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame];
255256
springAnimation.removedOnCompletion = YES;
256257
springAnimation.beginTime = beginTime + CACurrentMediaTime();
257-
CGFloat springBounciness = 15 - beginTime * 2;
258+
// CGFloat springBounciness = 6 - beginTime * 2;
259+
CGFloat springBounciness = 6;
258260
springAnimation.springBounciness = springBounciness; // value between 0-20
259261

260-
CGFloat springSpeed = 6 - beginTime * 2;
262+
// CGFloat springSpeed = 6 - beginTime * 2;
263+
CGFloat springSpeed = 2;
261264
springAnimation.springSpeed = springSpeed; // value between 0-20
262265
springAnimation.toValue = [NSValue valueWithCGRect:toRect];
263266
springAnimation.fromValue = [NSValue valueWithCGRect:fromRect];

Coding_iOS/Vendor/XHRealTimeBlur/XHRealTimeBlur.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ - (void)hiddenAnimationCompletion:(void (^)(BOOL finished))completion {
9090
self.willDismissBlurViewCompleted();
9191
}
9292

93-
[UIView animateWithDuration:self.disMissDuration delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
93+
[UIView animateWithDuration:self.disMissDuration delay:0.3 options:UIViewAnimationOptionCurveEaseInOut animations:^{
9494
self.alpha = 0.0;
9595
} completion:^(BOOL finished) {
9696
if (completion) {

0 commit comments

Comments
 (0)