android fullscreen tweaks

This commit is contained in:
Tim Lancina
2014-05-02 16:57:19 -05:00
parent 7cfa3a685d
commit 3abab65351
2 changed files with 16 additions and 2 deletions

View File

@@ -23,12 +23,15 @@ ionic.keyboard = {
function keyboardInit() {
if( keyboardHasPlugin() ) {
window.addEventListener('native.showkeyboard', keyboardNativeShow);
window.addEventListener('native.hidekeyboard', keyboardFocusOut);
}
else {
document.body.addEventListener('focusout', keyboardFocusOut);
}
document.body.addEventListener('ionic.focusin', keyboardBrowserFocusIn);
document.body.addEventListener('focusin', keyboardBrowserFocusIn);
document.body.addEventListener('focusout', keyboardFocusOut);
document.body.addEventListener('orientationchange', keyboardOrientationChange);
document.removeEventListener('touchstart', keyboardInit);
@@ -86,6 +89,8 @@ function keyboardShow(element, elementTop, elementBottom, viewportHeight, keyboa
keyboardHeight: keyboardHeight
};
details.hasPlugin = keyboardHasPlugin();
details.contentHeight = viewportHeight - keyboardHeight;
console.debug('keyboardShow', keyboardHeight, details.contentHeight);

View File

@@ -640,6 +640,15 @@ ionic.views.Scroll = ionic.views.View.inherit({
//If the element is positioned under the keyboard...
if( e.detail.isElementUnderKeyboard ) {
var delay;
// Wait on android for scroll view to resize
if ( !ionic.Platform.isFullScreen && e.detail.hasPlugin ) {
delay = 350;
}
else {
delay = 80;
}
//Put element in middle of visible screen
//Wait for resize() to reset scroll position
ionic.scroll.isScrolling = true;
@@ -651,7 +660,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
ionic.tap.cloneFocusedInput(container, self);
self.scrollBy(0, scrollTop, true);
self.onScroll();
}, 80 );
}, delay);
}
//Only the first scrollView parent of the element that broadcasted this event