You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/30 16:12:55 UTC

[1/6] cordova-plugins git commit: Remove empty getter/setter. Use autogenerated instead.

Repository: cordova-plugins
Updated Branches:
  refs/heads/master 976fe8185 -> 58d253e17


Remove empty getter/setter. Use autogenerated instead.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/7e30d8fd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/7e30d8fd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/7e30d8fd

Branch: refs/heads/master
Commit: 7e30d8fdcd8495480c4c52fb00d091fa20bd3697
Parents: fcd495c
Author: Connor Pearson <cj...@gmail.com>
Authored: Mon Jan 12 13:38:01 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/7e30d8fd/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 3146ab4..e5cb068 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -32,7 +32,7 @@
 
 @implementation CDVKeyboard
 
-@dynamic shrinkView, hideFormAccessoryBar;
+@dynamic hideFormAccessoryBar;
 
 - (id)settingForKey:(NSString*)key
 {
@@ -159,18 +159,6 @@
 
 // //////////////////////////////////////////////////
 
-- (BOOL)shrinkView
-{
-    return _shrinkView;
-}
-
-- (void)setShrinkView:(BOOL)ashrinkView
-{
-    _shrinkView = ashrinkView;
-}
-
-// //////////////////////////////////////////////////
-
 - (NSArray*)getKeyboardViews:(UIView*)viewToSearch{
     NSArray *subViews;
     


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/6] cordova-plugins git commit: Instead of adding and removing observer when _shrinkView changes, check for _shrinkView in the method that is called. Always resize the webview if the keyboard is moving off screen. This covers the case when shrinkView i

Posted by ag...@apache.org.
Instead of adding and removing observer when _shrinkView changes, check for _shrinkView in the method that is called. Always resize the webview if the keyboard is moving off screen. This covers the case when shrinkView is disabled while the keyboard is visible. Only disable the webview push up if shrinkView is enabled. Fix regression which broke disableScrollingInShrinkView.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/12911f63
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/12911f63
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/12911f63

Branch: refs/heads/master
Commit: 12911f63f99d184124508cd860a4d393bfb49484
Parents: 2823606
Author: Connor Pearson <cj...@gmail.com>
Authored: Mon Jan 12 11:25:28 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 49 ++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/12911f63/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index f03cefa..9d557a8 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -93,7 +93,13 @@
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnHiding();"];
         }];
     
-    self.webView.scrollView.scrollEnabled = NO;
+    _shrinkViewKeyboardWillChangeFrameObserver = [nc addObserverForName:UIKeyboardWillChangeFrameNotification
+                                                                 object:nil
+                                                                  queue:[NSOperationQueue mainQueue]
+                                                             usingBlock:^(NSNotification* notification) {
+                                                                 [weakSelf performSelector:@selector(shrinkViewKeyboardWillChangeFrame:) withObject:notification afterDelay:0];
+                                                             }];
+    
     self.webView.scrollView.delegate = self;
 }
 
@@ -158,31 +164,6 @@
 
 - (void)setShrinkView:(BOOL)ashrinkView
 {
-    NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
-    __weak CDVKeyboard* weakSelf = self;
-
-    if (ashrinkView == _shrinkView) {
-        return;
-    }
-
-    // No-op on iOS7.0.  It already resizes webview by default, and this plugin is causing layout issues
-    // with fixed position elements.  We possibly should attempt to implement shringview = false on iOS7.0.
-    // iOS 7.1+ behave the same way as iOS 6
-    if (!(NSFoundationVersionNumber == NSFoundationVersionNumber_iOS_7_0)) {
-        if (ashrinkView) {
-            [nc removeObserver:_shrinkViewKeyboardWillChangeFrameObserver];
-            _shrinkViewKeyboardWillChangeFrameObserver = [nc addObserverForName:UIKeyboardWillChangeFrameNotification
-                                                              object:nil
-                                                               queue:[NSOperationQueue mainQueue]
-                                                          usingBlock:^(NSNotification* notification) {
-                    [weakSelf performSelector:@selector(shrinkViewKeyboardWillChangeFrame:) withObject:notification afterDelay:0];
-                }];
-
-        } else {
-            [nc removeObserver:_shrinkViewKeyboardWillChangeFrameObserver];
-        }
-    }
-
     _shrinkView = ashrinkView;
 }
 
@@ -275,12 +256,22 @@
 
 - (void)shrinkViewKeyboardWillChangeFrame:(NSNotification*)notif
 {
+    // No-op on iOS7.0.  It already resizes webview by default, and this plugin is causing layout issues
+    // with fixed position elements.  We possibly should attempt to implement shringview = false on iOS7.0.
+    // iOS 7.1+ behave the same way as iOS 6
+    if (NSFoundationVersionNumber == NSFoundationVersionNumber_iOS_7_0){
+        return;
+    }
+    
+    self.webView.scrollView.scrollEnabled = YES;
+    
     CGRect screen = [self.viewController.view convertRect:[[UIScreen mainScreen] applicationFrame] fromView:nil];
     CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
     CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
-    if(CGRectContainsRect(screen, keyboardIntersection)){
+    if(CGRectContainsRect(screen, keyboardIntersection) && _shrinkView){
         screen.size.height -= MIN(keyboardIntersection.size.height, keyboardIntersection.size.width);
+        self.webView.scrollView.scrollEnabled = !self.disableScrollingInShrinkView;
     }
     
     __weak CDVKeyboard* weakSelf = self;
@@ -340,6 +331,8 @@
 
 #pragma mark UIScrollViewDelegate
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
-    scrollView.bounds = self.webView.bounds;
+    if(_shrinkView){
+        scrollView.bounds = self.webView.bounds;
+    }
 }
 @end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[5/6] cordova-plugins git commit: Take into account whether or not the accessory bar is showing when shrinking the webview.

Posted by ag...@apache.org.
Take into account whether or not the accessory bar is showing when shrinking the webview.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/3a12b968
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/3a12b968
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/3a12b968

Branch: refs/heads/master
Commit: 3a12b968e010cc489dfe56e477dfc0a4e72279ee
Parents: 12911f6
Author: Connor Pearson <cj...@gmail.com>
Authored: Mon Jan 12 12:15:58 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/3a12b968/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 9d557a8..7df567a 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -101,6 +101,8 @@
                                                              }];
     
     self.webView.scrollView.delegate = self;
+    
+    _accessoryBarHeight = 44;
 }
 
 // //////////////////////////////////////////////////
@@ -269,8 +271,13 @@
     CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
     CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
-    if(CGRectContainsRect(screen, keyboardIntersection) && _shrinkView){
+    if(CGRectContainsRect(screen, keyboardIntersection) && !CGRectIsEmpty(keyboardIntersection)&& _shrinkView){
         screen.size.height -= MIN(keyboardIntersection.size.height, keyboardIntersection.size.width);
+        
+        if (_hideFormAccessoryBar){
+            screen.size.height += _accessoryBarHeight;
+        }
+        
         self.webView.scrollView.scrollEnabled = !self.disableScrollingInShrinkView;
     }
     


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[6/6] cordova-plugins git commit: Remove animation. Fix issue with forcing webview under status bar. (close #18)

Posted by ag...@apache.org.
Remove animation. Fix issue with forcing webview under status bar.  (close #18)


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/58d253e1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/58d253e1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/58d253e1

Branch: refs/heads/master
Commit: 58d253e172d0f6352036183030afacdd7f46f56d
Parents: 7e30d8f
Author: Connor Pearson <cj...@gmail.com>
Authored: Fri Jan 23 14:01:12 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:36 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/58d253e1/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index e5cb068..f25e24a 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -255,7 +255,10 @@
     
     self.webView.scrollView.scrollEnabled = YES;
     
-    CGRect screen = [self.viewController.view convertRect:[[UIScreen mainScreen] applicationFrame] fromView:nil];
+    CGRect screen = self.webView.frame.origin.y > 0 ?
+    [self.viewController.view convertRect:[[UIScreen mainScreen] applicationFrame] fromView:nil]:
+    [self.viewController.view convertRect:[[UIScreen mainScreen] bounds] fromView:nil];
+
     CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
     CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
@@ -269,13 +272,7 @@
         self.webView.scrollView.scrollEnabled = !self.disableScrollingInShrinkView;
     }
     
-    __weak CDVKeyboard* weakSelf = self;
-    [UIView animateWithDuration:[notif.userInfo[@"UIKeyboardAnimationDurationUserInfoKey"] doubleValue]
-                          delay:0.0
-                        options:[notif.userInfo[@"UIKeyboardAnimationCurveUserInfoKey"] integerValue] << 16
-                     animations:^{
-                         weakSelf.webView.frame = screen;
-                     }completion:nil];
+    self.webView.frame = screen;
 }
 
 // //////////////////////////////////////////////////


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/6] cordova-plugins git commit: Handle split and undocked keyboards. They should hover over the app and not resize the webview.

Posted by ag...@apache.org.
Handle split and undocked keyboards. They should hover over the app and not resize the webview.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/fcd495cb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/fcd495cb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/fcd495cb

Branch: refs/heads/master
Commit: fcd495cb9614edba6c55dbfc57d7b0deca5d3172
Parents: 3a12b96
Author: Connor Pearson <cj...@gmail.com>
Authored: Mon Jan 12 13:27:58 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/fcd495cb/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 7df567a..3146ab4 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -70,14 +70,12 @@
                                              queue:[NSOperationQueue mainQueue]
                                         usingBlock:^(NSNotification* notification) {
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnShow();"];
-            weakSelf.keyboardIsVisible = YES;
         }];
     _keyboardHideObserver = [nc addObserverForName:UIKeyboardDidHideNotification
                                             object:nil
                                              queue:[NSOperationQueue mainQueue]
                                         usingBlock:^(NSNotification* notification) {
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnHide();"];
-            weakSelf.keyboardIsVisible = NO;
         }];
 
     _keyboardWillShowObserver = [nc addObserverForName:UIKeyboardWillShowNotification
@@ -85,12 +83,14 @@
                                              queue:[NSOperationQueue mainQueue]
                                         usingBlock:^(NSNotification* notification) {
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnShowing();"];
+            weakSelf.keyboardIsVisible = YES;
         }];
     _keyboardWillHideObserver = [nc addObserverForName:UIKeyboardWillHideNotification
                                             object:nil
                                              queue:[NSOperationQueue mainQueue]
                                         usingBlock:^(NSNotification* notification) {
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnHiding();"];
+            weakSelf.keyboardIsVisible = NO;
         }];
     
     _shrinkViewKeyboardWillChangeFrameObserver = [nc addObserverForName:UIKeyboardWillChangeFrameNotification
@@ -271,7 +271,7 @@
     CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
     CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
-    if(CGRectContainsRect(screen, keyboardIntersection) && !CGRectIsEmpty(keyboardIntersection)&& _shrinkView){
+    if(CGRectContainsRect(screen, keyboardIntersection) && !CGRectIsEmpty(keyboardIntersection) && _shrinkView && self.keyboardIsVisible){
         screen.size.height -= MIN(keyboardIntersection.size.height, keyboardIntersection.size.width);
         
         if (_hideFormAccessoryBar){


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/6] cordova-plugins git commit: Change KeyboardShrinkView to use KeyboardFrameWillChange notification instead. Have animation match the keyboard animation. Support external keyboards.

Posted by ag...@apache.org.
Change KeyboardShrinkView to use KeyboardFrameWillChange notification instead. Have animation match the keyboard animation. Support external keyboards.


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugins/commit/28236065
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugins/tree/28236065
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugins/diff/28236065

Branch: refs/heads/master
Commit: 2823606527937952b05cd83c21d63e1e2e1b0699
Parents: 976fe81
Author: Connor Pearson <cj...@gmail.com>
Authored: Fri Jan 9 12:24:53 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 30 10:12:23 2015 -0400

----------------------------------------------------------------------
 keyboard/src/ios/CDVKeyboard.h |   4 +-
 keyboard/src/ios/CDVKeyboard.m | 100 +++++++++++-------------------------
 2 files changed, 31 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/28236065/keyboard/src/ios/CDVKeyboard.h
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.h b/keyboard/src/ios/CDVKeyboard.h
index 6049dbe..0b243ad 100644
--- a/keyboard/src/ios/CDVKeyboard.h
+++ b/keyboard/src/ios/CDVKeyboard.h
@@ -21,8 +21,6 @@
 
 @interface CDVKeyboard : CDVPlugin {
     @protected
-    CGRect _savedWebViewFrame;
-    @protected
     BOOL _shrinkView;
     @protected
     BOOL _hideFormAccessoryBar;
@@ -31,7 +29,7 @@
     @protected
     id _hideFormAccessoryBarKeyboardShowObserver, _hideFormAccessoryBarKeyboardHideObserver;
     @protected
-    id _shrinkViewKeyboardShowObserver, _shrinkViewKeyboardHideObserver;
+    id _shrinkViewKeyboardWillChangeFrameObserver;
     @protected
     CGFloat _accessoryBarHeight;
 }

http://git-wip-us.apache.org/repos/asf/cordova-plugins/blob/28236065/keyboard/src/ios/CDVKeyboard.m
----------------------------------------------------------------------
diff --git a/keyboard/src/ios/CDVKeyboard.m b/keyboard/src/ios/CDVKeyboard.m
index 32a9624..f03cefa 100644
--- a/keyboard/src/ios/CDVKeyboard.m
+++ b/keyboard/src/ios/CDVKeyboard.m
@@ -24,7 +24,7 @@
 #warning "The keyboard plugin is only supported in Cordova 3.2 or greater, it may not work properly in an older version. If you do use this plugin in an older version, make sure the HideKeyboardFormAccessoryBar and KeyboardShrinksView preference values are false."
 #endif
 
-@interface CDVKeyboard ()
+@interface CDVKeyboard () <UIScrollViewDelegate>
 
 @property (nonatomic, readwrite, assign) BOOL keyboardIsVisible;
 
@@ -92,6 +92,9 @@
                                         usingBlock:^(NSNotification* notification) {
             [weakSelf.commandDelegate evalJs:@"Keyboard.fireOnHiding();"];
         }];
+    
+    self.webView.scrollView.scrollEnabled = NO;
+    self.webView.scrollView.delegate = self;
 }
 
 // //////////////////////////////////////////////////
@@ -162,39 +165,21 @@
         return;
     }
 
-    // No-op on iOS7.  It already resizes webview by default, and this plugin is causing layout issues
-    // with fixed position elements.  We possibly should attempt to implement shringview = false on iOS7.
-    if (!IsAtLeastiOSVersion(@"7.0")) {
+    // No-op on iOS7.0.  It already resizes webview by default, and this plugin is causing layout issues
+    // with fixed position elements.  We possibly should attempt to implement shringview = false on iOS7.0.
+    // iOS 7.1+ behave the same way as iOS 6
+    if (!(NSFoundationVersionNumber == NSFoundationVersionNumber_iOS_7_0)) {
         if (ashrinkView) {
-            [nc removeObserver:_shrinkViewKeyboardShowObserver];
-            _shrinkViewKeyboardShowObserver = [nc addObserverForName:UIKeyboardWillShowNotification
+            [nc removeObserver:_shrinkViewKeyboardWillChangeFrameObserver];
+            _shrinkViewKeyboardWillChangeFrameObserver = [nc addObserverForName:UIKeyboardWillChangeFrameNotification
                                                               object:nil
                                                                queue:[NSOperationQueue mainQueue]
                                                           usingBlock:^(NSNotification* notification) {
-                    [weakSelf performSelector:@selector(shrinkViewKeyboardWillShow:) withObject:notification afterDelay:0];
+                    [weakSelf performSelector:@selector(shrinkViewKeyboardWillChangeFrame:) withObject:notification afterDelay:0];
                 }];
 
-            [nc removeObserver:_shrinkViewKeyboardHideObserver];
-            _shrinkViewKeyboardHideObserver = [nc addObserverForName:UIKeyboardWillHideNotification
-                                                              object:nil
-                                                               queue:[NSOperationQueue mainQueue]
-                                                          usingBlock:^(NSNotification* notification) {
-                    [weakSelf performSelector:@selector(shrinkViewKeyboardWillHide:) withObject:notification afterDelay:0];
-                }];
         } else {
-            [nc removeObserver:_shrinkViewKeyboardShowObserver];
-            [nc removeObserver:_shrinkViewKeyboardHideObserver];
-
-            // if a keyboard is already visible (and keyboard was shrunk), hide observer will NOT be called, so we observe it once
-            if (self.keyboardIsVisible && _shrinkView) {
-                _shrinkViewKeyboardHideObserver = [nc addObserverForName:UIKeyboardWillHideNotification
-                                                                  object:nil
-                                                                   queue:[NSOperationQueue mainQueue]
-                                                              usingBlock:^(NSNotification* notification) {
-                        [weakSelf shrinkViewKeyboardWillHideHelper:notification];
-                        [[NSNotificationCenter defaultCenter] removeObserver:_shrinkViewKeyboardHideObserver];
-                    }];
-            }
+            [nc removeObserver:_shrinkViewKeyboardWillChangeFrameObserver];
         }
     }
 
@@ -288,51 +273,23 @@
 
 // //////////////////////////////////////////////////
 
-- (void)shrinkViewKeyboardWillShow:(NSNotification*)notif
+- (void)shrinkViewKeyboardWillChangeFrame:(NSNotification*)notif
 {
-    if (!_shrinkView) {
-        return;
-    }
-
-    if (CGRectIsEmpty(_savedWebViewFrame)) {
-        _savedWebViewFrame = self.webView.frame;
-    }
-
-    CGRect keyboardFrame = [notif.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
-    keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil];
-
-    CGRect newFrame = _savedWebViewFrame;
-    CGFloat actualKeyboardHeight = (keyboardFrame.size.height - _accessoryBarHeight);
-    newFrame.size.height -= actualKeyboardHeight;
-
-    self.webView.frame = newFrame;
-    self.webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
-
-    if (self.disableScrollingInShrinkView) {
-        self.webView.scrollView.scrollEnabled = NO;
-    }
-}
+    CGRect screen = [self.viewController.view convertRect:[[UIScreen mainScreen] applicationFrame] fromView:nil];
+    CGRect keyboard = [self.viewController.view convertRect: ((NSValue*)notif.userInfo[@"UIKeyboardFrameEndUserInfoKey"]).CGRectValue fromView: nil];
+    CGRect keyboardIntersection = CGRectIntersection(screen, keyboard);
 
-- (void)shrinkViewKeyboardWillHide:(NSNotification*)notif
-{
-    if (!_shrinkView) {
-        return;
+    if(CGRectContainsRect(screen, keyboardIntersection)){
+        screen.size.height -= MIN(keyboardIntersection.size.height, keyboardIntersection.size.width);
     }
-    [self shrinkViewKeyboardWillHideHelper:notif];
-}
-
-- (void)shrinkViewKeyboardWillHideHelper:(NSNotification*)notif
-{
-    self.webView.scrollView.scrollEnabled = YES;
-
-    CGRect keyboardFrame = [notif.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
-    keyboardFrame = [self.viewController.view convertRect:keyboardFrame fromView:nil];
-
-    CGRect newFrame = _savedWebViewFrame;
-    self.webView.scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
-    self.webView.frame = newFrame;
-
-    _savedWebViewFrame = CGRectNull;
+    
+    __weak CDVKeyboard* weakSelf = self;
+    [UIView animateWithDuration:[notif.userInfo[@"UIKeyboardAnimationDurationUserInfoKey"] doubleValue]
+                          delay:0.0
+                        options:[notif.userInfo[@"UIKeyboardAnimationCurveUserInfoKey"] integerValue] << 16
+                     animations:^{
+                         weakSelf.webView.frame = screen;
+                     }completion:nil];
 }
 
 // //////////////////////////////////////////////////
@@ -381,5 +338,8 @@
     self.hideFormAccessoryBar = [value boolValue];
 }
 
-
+#pragma mark UIScrollViewDelegate
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
+    scrollView.bounds = self.webView.bounds;
+}
 @end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org