You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug with android margin adjustment for keyboard. #926
Hi there! I have been using the Unity WebView plugin in my project, and overall it has been a great tool. However, I have encountered an issue with the Android margin adjustment for the keyboard, which is not working as stated in the issue #300.
Expected Behavior:
When an input field receives focus and the keyboard appears, the WebView content should be adjusted to ensure the input field remains visible without being obscured by the keyboard.
Actual Behavior:
The Android margin adjustment for the keyboard does not seem to work as intended. The WebView content does not properly adjust, resulting in the keyboard partially or completely obscuring the focused input field.
Thank you for your effort in developing this plugin. It has been a valuable addition to my project, and I appreciate your dedication to maintaining it.
Please let me know if there are any further details or information I can provide to help resolve this issue.
Update: upon further investigating this piece of code is always false even if the keyboard is shown.
/// Called from Java native plugin to set when the keyboard is opened
public void SetKeyboardVisible(string pIsVisible)
{
Debug.Log("SetKeyboardVisible: " + pIsVisible);
if (BottomAdjustmentDisabled())
{
return;
}
bool isKeyboardVisible0 = mIsKeyboardVisible;
mIsKeyboardVisible = (pIsVisible == "true");
if (mIsKeyboardVisible != isKeyboardVisible0 || mIsKeyboardVisible)
{
SetMargins(mMarginLeft, mMarginTop, mMarginRight, mMarginBottom, mMarginRelative);
}
}
Thank you for reporting and investigating the issue. I modified the keyboard detection logic in #928 and updated binaries. Could you please try the latest?
Hello, i tried it and it seems issue is still there, i tried to import unity-webview.unitypackage in new clean project to test. @pinnakkkk does fix work for you?
Activity
pinnakkkk commentedon May 15, 2023
Update: upon further investigating this piece of code is always false even if the keyboard is shown.
KojiNakamaru commentedon May 16, 2023
Thank you for reporting and investigating the issue. I modified the keyboard detection logic in #928 and updated binaries. Could you please try the latest?
pinnakkkk commentedon May 17, 2023
Absolutely! thankyou so much!
wa1kb0y commentedon May 26, 2023
Hello, i tried it and it seems issue is still there, i tried to import
unity-webview.unitypackagein new clean project to test. @pinnakkkk does fix work for you?x-ishi commentedon Jun 21, 2023
こちらの問題について対応中になりますでしょうか。
書き込み時点のmasterブランチのunity-webview.unitypackageをインポートして確認しましたが、同じように入力エリアがキーボードに隠れる現象が発生するようでした。
確認環境
・Unity2020.3.43f1
・google pixel3(android os12)
KojiNakamaru commentedon Jun 21, 2023
@x-ishi
その後、特に調査は進めておりませんが、テストがしやすいよう、改めてサンプルを整えました。キーボード周りについてWebViewObject.csにXXXで始まるログを仕込んであります。
https://github.com/gree/unity-webview/tree/example-for-926/sample
028f13f...51ef618
OSCAL Pad 8 (Android 11)やPixel 4a (Android 12)で確認する限りでは、再現しないようです。なお、おそらく該当しないだろうと思いますが、
9c53747
により、フルスクリーンでない場合や、ポートレイトとランドスケープの両方をサポートする場合は、この調整が無効になっています。
x-ishi commentedon Jun 22, 2023
ご確認ありがとうございます。
ポートレイトの設定をしたところ問題なく動作いたしました。
x-ishi commentedon Jun 23, 2023
Project Settings > Resolution and Presentatin > Hide Navigation Bar
サンプルについて確認していまして上記のチェックをオフにすると調整が無効になるようでした。
チェックをオフにした上で動作するように改善していただくことは可能でしょうか。
KojiNakamaru commentedon Jun 23, 2023
@x-ishi #938 で
UNITYWEBVIEW_ANDROID_FORCE_MARGIN_ADJUSTMENT_FOR_KEYBOARDを定義した場合に、常に調整を行うようにしました。 #729 の問題は、現時点の手元の端末で試した限りは起こらないようです。なお、別件ですが、 #890 (comment) を参考にさせていただいて、最新のバイナリには #937 も含まれています。
x-ishi commentedon Jun 29, 2023
@KojiNakamaru
ご対応ありがとうございます。
アプリに組み込んで確認しまして大丈夫そうでした。