iOS: add oldBottomMargin, oldHeight & bottomMargin
This commit is contained in:
		| @@ -46,11 +46,14 @@ - (void)subscribe:(NSString *)callbackId withPromise:(DoricPromise *)promise { | |||||||
|         CGRect beginFrame = [[note.userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; |         CGRect beginFrame = [[note.userInfo valueForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; | ||||||
|         CGRect endFrame = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; |         CGRect endFrame = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; | ||||||
|          |          | ||||||
|         BOOL isOpen = endFrame.origin.y < beginFrame.origin.y; |         CGFloat oldBottomMargin = [[UIScreen mainScreen] bounds].size.height - beginFrame.origin.y - beginFrame.size.height; | ||||||
|         int heightDiff = isOpen ? beginFrame.origin.y - endFrame.origin.y : 0; |         CGFloat bottomMargin = [[UIScreen mainScreen] bounds].size.height - endFrame.origin.y - endFrame.size.height; | ||||||
|          |          | ||||||
|         NSDictionary *dict = @{ |         NSDictionary *dict = @{ | ||||||
|             @"height": @(heightDiff), |             @"oldBottomMargin": @(oldBottomMargin), | ||||||
|  |             @"oldHeight": @(beginFrame.size.height), | ||||||
|  |             @"bottomMargin": @(bottomMargin), | ||||||
|  |             @"height": @(endFrame.size.height), | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         DoricPromise *currentPromise = [[DoricPromise alloc] initWithContext:self.doricContext callbackId:callbackId]; |         DoricPromise *currentPromise = [[DoricPromise alloc] initWithContext:self.doricContext callbackId:callbackId]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user