Skip to content

Commit

Permalink
updated binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed Jun 1, 2022
1 parent 51967d4 commit 21c4efc
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 8 deletions.
Binary file not shown.
20 changes: 16 additions & 4 deletions dist/package-nofragment/Assets/Plugins/WebViewObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand All @@ -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
Expand Down
Binary file not shown.
20 changes: 16 additions & 4 deletions dist/package/Assets/Plugins/WebViewObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand All @@ -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
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 21c4efc

Please sign in to comment.