diff --git a/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView b/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView index 619fa897..c27e42cf 100755 Binary files a/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView and b/dist/package-nofragment/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView differ diff --git a/dist/package-nofragment/Assets/Plugins/WebViewObject.cs b/dist/package-nofragment/Assets/Plugins/WebViewObject.cs index 48ae4ca3..47a0cf87 100644 --- a/dist/package-nofragment/Assets/Plugins/WebViewObject.cs +++ b/dist/package-nofragment/Assets/Plugins/WebViewObject.cs @@ -144,12 +144,12 @@ void Update() /// Called from Java native plugin to set when the keyboard is opened public void SetKeyboardVisible(string pIsVisible) { - bool isKeyboardVisible0 = mIsKeyboardVisible; - mIsKeyboardVisible = (pIsVisible == "true"); - if (!Screen.fullScreen) + if (BottomAdjustmentDisabled()) { return; } + bool isKeyboardVisible0 = mIsKeyboardVisible; + mIsKeyboardVisible = (pIsVisible == "true"); if (mIsKeyboardVisible != isKeyboardVisible0 || mIsKeyboardVisible) { SetMargins(mMarginLeft, mMarginTop, mMarginRight, mMarginBottom, mMarginRelative); @@ -158,7 +158,11 @@ public void SetKeyboardVisible(string pIsVisible) public int AdjustBottomMargin(int bottom) { - if (!mIsKeyboardVisible || !Screen.fullScreen) + if (BottomAdjustmentDisabled()) + { + return bottom; + } + else if (!mIsKeyboardVisible) { return bottom; } @@ -177,6 +181,14 @@ public int AdjustBottomMargin(int bottom) return (bottom > keyboardHeight) ? bottom : keyboardHeight; } } + + private bool BottomAdjustmentDisabled() + { + return + !Screen.fullScreen + || ((Screen.autorotateToLandscapeLeft || Screen.autorotateToLandscapeRight) + && (Screen.autorotateToPortrait || Screen.autorotateToPortraitUpsideDown)); + } #else IntPtr webView; #endif diff --git a/dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView b/dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView index 619fa897..c27e42cf 100755 Binary files a/dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView and b/dist/package/Assets/Plugins/WebView.bundle/Contents/MacOS/WebView differ diff --git a/dist/package/Assets/Plugins/WebViewObject.cs b/dist/package/Assets/Plugins/WebViewObject.cs index 48ae4ca3..47a0cf87 100644 --- a/dist/package/Assets/Plugins/WebViewObject.cs +++ b/dist/package/Assets/Plugins/WebViewObject.cs @@ -144,12 +144,12 @@ void Update() /// Called from Java native plugin to set when the keyboard is opened public void SetKeyboardVisible(string pIsVisible) { - bool isKeyboardVisible0 = mIsKeyboardVisible; - mIsKeyboardVisible = (pIsVisible == "true"); - if (!Screen.fullScreen) + if (BottomAdjustmentDisabled()) { return; } + bool isKeyboardVisible0 = mIsKeyboardVisible; + mIsKeyboardVisible = (pIsVisible == "true"); if (mIsKeyboardVisible != isKeyboardVisible0 || mIsKeyboardVisible) { SetMargins(mMarginLeft, mMarginTop, mMarginRight, mMarginBottom, mMarginRelative); @@ -158,7 +158,11 @@ public void SetKeyboardVisible(string pIsVisible) public int AdjustBottomMargin(int bottom) { - if (!mIsKeyboardVisible || !Screen.fullScreen) + if (BottomAdjustmentDisabled()) + { + return bottom; + } + else if (!mIsKeyboardVisible) { return bottom; } @@ -177,6 +181,14 @@ public int AdjustBottomMargin(int bottom) return (bottom > keyboardHeight) ? bottom : keyboardHeight; } } + + private bool BottomAdjustmentDisabled() + { + return + !Screen.fullScreen + || ((Screen.autorotateToLandscapeLeft || Screen.autorotateToLandscapeRight) + && (Screen.autorotateToPortrait || Screen.autorotateToPortraitUpsideDown)); + } #else IntPtr webView; #endif diff --git a/dist/unity-webview-nofragment.unitypackage b/dist/unity-webview-nofragment.unitypackage index 7ed6b44f..011646a9 100644 Binary files a/dist/unity-webview-nofragment.unitypackage and b/dist/unity-webview-nofragment.unitypackage differ diff --git a/dist/unity-webview-nofragment.zip b/dist/unity-webview-nofragment.zip index b4539a37..f109ef95 100644 Binary files a/dist/unity-webview-nofragment.zip and b/dist/unity-webview-nofragment.zip differ diff --git a/dist/unity-webview.unitypackage b/dist/unity-webview.unitypackage index 3c8c1393..e705cb64 100644 Binary files a/dist/unity-webview.unitypackage and b/dist/unity-webview.unitypackage differ diff --git a/dist/unity-webview.zip b/dist/unity-webview.zip index ea8e3919..0f58be59 100644 Binary files a/dist/unity-webview.zip and b/dist/unity-webview.zip differ