This commit is contained in:
2020-07-15 23:35:13 +08:00
parent 2092e4ef94
commit 17d9f47d49
27 changed files with 790 additions and 767 deletions

View File

@@ -296,17 +296,25 @@ public class ApplicationChrome
public const int ADJUST_PAN = 0x20;
public const int ADJUST_NOTHING= 0x30;
public const int ADJUST_UNSPECIFIED = 0x00;
static int softInputMode = 0;
public static void setSoftInputMode(int mode)
{
#if USE_ANDROID
//Debug.Log("FLAGS: " + flagsValue);
softInputMode = mode;
runOnAndroidUiThread(_setSoftInputMode);
#endif
}
private static void _setSoftInputMode()
{
#if USE_ANDROID
using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
{
using (var window = activity.Call<AndroidJavaObject>("getWindow"))
{
window.Call("setSoftInputMode", mode); // (int)0x7FFFFFFF
window.Call("setSoftInputMode", softInputMode); // (int)0x7FFFFFFF
}
}
}