Commit 5592cffc authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Switches to a block-based animation API in MemoryDebugger.

The previous non-block-based API dated back to iOS 3 and is deprecated
starting with iOS 13.

BUG=1086653

Change-Id: Id53e8f7e3b7938d056a38cc439733722179a3425
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220485Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773291}
parent 9a20398a
...@@ -400,17 +400,19 @@ const CGFloat kPadding = 10; ...@@ -400,17 +400,19 @@ const CGFloat kPadding = 10;
// convert the UIKeyboardAnimationCurveUserInfoKey's value from a // convert the UIKeyboardAnimationCurveUserInfoKey's value from a
// UIViewAnimationCurve to a UIViewAnimationOption. Awesome! // UIViewAnimationCurve to a UIViewAnimationOption. Awesome!
NSDictionary* userInfo = [notification userInfo]; NSDictionary* userInfo = [notification userInfo];
[UIView beginAnimations:nil context:nullptr]; NSTimeInterval duration =
[UIView setAnimationDuration: [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
[userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
NSInteger animationCurveKeyValue = // The keyboard notification contains a UIViewAnimationCurve, but there is no
[userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue]; // function to convert that to UIViewAnimationOptions. Use the default
UIViewAnimationCurve animationCurve = // instead, even if it doesn't exactly match the keyboard's curve.
(UIViewAnimationCurve)animationCurveKeyValue; [UIView animateWithDuration:duration
[UIView setAnimationCurve:animationCurve]; delay:0
[UIView setAnimationBeginsFromCurrentState:YES]; options:UIViewAnimationOptionBeginFromCurrentState
self.frame = CGRectOffset(self.frame, offset.x, offset.y); animations:^{
[UIView commitAnimations]; self.frame = CGRectOffset(self.frame, offset.x, offset.y);
}
completion:nil];
} }
#pragma mark Artificial memory bloat methods #pragma mark Artificial memory bloat methods
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment