Skip to content

Commit

Permalink
updated binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed May 16, 2023
1 parent ee74d90 commit d2d8dd7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 16 deletions.
Binary file modified dist/package-nofragment/Assets/Plugins/Android/WebViewPlugin.aar
Binary file not shown.
17 changes: 9 additions & 8 deletions dist/package-nofragment/Assets/Plugins/WebViewObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class WebViewObject : MonoBehaviour
AndroidJavaObject webView;

bool mVisibility;
bool mIsKeyboardVisible;
int mKeyboardVisibleHeight;
int mWindowVisibleDisplayFrameHeight;
float mResumedTimestamp;
#if UNITYWEBVIEW_ANDROID_ENABLE_NAVIGATOR_ONLINE
Expand All @@ -97,7 +97,7 @@ void OnApplicationPause(bool paused)
{
if (webView == null)
return;
if (!paused && mIsKeyboardVisible)
if (!paused && mKeyboardVisibleHeight > 0)
{
webView.Call("SetVisibility", false);
mResumedTimestamp = Time.realtimeSinceStartup;
Expand Down Expand Up @@ -169,16 +169,17 @@ void Update()
}

/// Called from Java native plugin to set when the keyboard is opened
public void SetKeyboardVisible(string pIsVisible)
public void SetKeyboardVisible(string keyboardVisibleHeight)
{
if (BottomAdjustmentDisabled())
{
return;
}
bool isKeyboardVisible0 = mIsKeyboardVisible;
mIsKeyboardVisible = (pIsVisible == "true");
if (mIsKeyboardVisible != isKeyboardVisible0 || mIsKeyboardVisible)
var keyboardVisibleHeight0 = mKeyboardVisibleHeight;
var keyboardVisibleHeight1 = Int32.Parse(keyboardVisibleHeight);
if (keyboardVisibleHeight0 != keyboardVisibleHeight1)
{
mKeyboardVisibleHeight = keyboardVisibleHeight1;
SetMargins(mMarginLeft, mMarginTop, mMarginRight, mMarginBottom, mMarginRelative);
}
}
Expand Down Expand Up @@ -302,7 +303,7 @@ public int AdjustBottomMargin(int bottom)
{
return bottom;
}
else if (!mIsKeyboardVisible)
else if (mKeyboardVisibleHeight <= 0)
{
return bottom;
}
Expand Down Expand Up @@ -348,7 +349,7 @@ public bool IsKeyboardVisible
get
{
#if !UNITY_EDITOR && UNITY_ANDROID
return mIsKeyboardVisible;
return mKeyboardVisibleHeight > 0;
#elif !UNITY_EDITOR && UNITY_IPHONE
return TouchScreenKeyboard.visible;
#else
Expand Down
Binary file modified dist/package/Assets/Plugins/Android/WebViewPlugin.aar
Binary file not shown.
17 changes: 9 additions & 8 deletions dist/package/Assets/Plugins/WebViewObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class WebViewObject : MonoBehaviour
AndroidJavaObject webView;

bool mVisibility;
bool mIsKeyboardVisible;
int mKeyboardVisibleHeight;
int mWindowVisibleDisplayFrameHeight;
float mResumedTimestamp;
#if UNITYWEBVIEW_ANDROID_ENABLE_NAVIGATOR_ONLINE
Expand All @@ -97,7 +97,7 @@ void OnApplicationPause(bool paused)
{
if (webView == null)
return;
if (!paused && mIsKeyboardVisible)
if (!paused && mKeyboardVisibleHeight > 0)
{
webView.Call("SetVisibility", false);
mResumedTimestamp = Time.realtimeSinceStartup;
Expand Down Expand Up @@ -169,16 +169,17 @@ void Update()
}

/// Called from Java native plugin to set when the keyboard is opened
public void SetKeyboardVisible(string pIsVisible)
public void SetKeyboardVisible(string keyboardVisibleHeight)
{
if (BottomAdjustmentDisabled())
{
return;
}
bool isKeyboardVisible0 = mIsKeyboardVisible;
mIsKeyboardVisible = (pIsVisible == "true");
if (mIsKeyboardVisible != isKeyboardVisible0 || mIsKeyboardVisible)
var keyboardVisibleHeight0 = mKeyboardVisibleHeight;
var keyboardVisibleHeight1 = Int32.Parse(keyboardVisibleHeight);
if (keyboardVisibleHeight0 != keyboardVisibleHeight1)
{
mKeyboardVisibleHeight = keyboardVisibleHeight1;
SetMargins(mMarginLeft, mMarginTop, mMarginRight, mMarginBottom, mMarginRelative);
}
}
Expand Down Expand Up @@ -302,7 +303,7 @@ public int AdjustBottomMargin(int bottom)
{
return bottom;
}
else if (!mIsKeyboardVisible)
else if (mKeyboardVisibleHeight <= 0)
{
return bottom;
}
Expand Down Expand Up @@ -348,7 +349,7 @@ public bool IsKeyboardVisible
get
{
#if !UNITY_EDITOR && UNITY_ANDROID
return mIsKeyboardVisible;
return mKeyboardVisibleHeight > 0;
#elif !UNITY_EDITOR && UNITY_IPHONE
return TouchScreenKeyboard.visible;
#else
Expand Down
Binary file modified dist/unity-webview-nofragment.unitypackage
Binary file not shown.
Binary file modified dist/unity-webview-nofragment.zip
Binary file not shown.
Binary file modified dist/unity-webview.unitypackage
Binary file not shown.
Binary file modified dist/unity-webview.zip
Binary file not shown.

0 comments on commit d2d8dd7

Please sign in to comment.