Skip to content

Commit

Permalink
updated binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
KojiNakamaru committed Nov 19, 2023
1 parent 32f1bf1 commit 6c6f2f6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void OnPostGenerateGradleAndroidProject(string basePath) {
}
}
changed = (androidManifest.SetExported(true) || changed);
changed = (androidManifest.SetWindowSoftInputMode("adjustPan") || changed);
changed = (androidManifest.SetHardwareAccelerated(true) || changed);
#if UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC
changed = (androidManifest.SetUsesCleartextTraffic(true) || changed);
Expand Down Expand Up @@ -163,6 +164,7 @@ public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
}
}
}
changed = (androidManifest.SetWindowSoftInputMode("adjustPan") || changed);
changed = (androidManifest.SetHardwareAccelerated(true) || changed);
#if UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC
changed = (androidManifest.SetUsesCleartextTraffic(true) || changed);
Expand Down Expand Up @@ -314,6 +316,16 @@ internal bool SetExported(bool enabled) {
return changed;
}

internal bool SetWindowSoftInputMode(string mode) {
bool changed = false;
var activity = GetActivityWithLaunchIntent() as XmlElement;
if (activity.GetAttribute("windowSoftInputMode", AndroidXmlNamespace) != mode) {
activity.SetAttribute("windowSoftInputMode", AndroidXmlNamespace, mode);
changed = true;
}
return changed;
}

internal bool SetHardwareAccelerated(bool enabled) {
bool changed = false;
var activity = GetActivityWithLaunchIntent() as XmlElement;
Expand Down
12 changes: 12 additions & 0 deletions dist/package/Assets/Plugins/Editor/UnityWebViewPostprocessBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void OnPostGenerateGradleAndroidProject(string basePath) {
}
}
changed = (androidManifest.SetExported(true) || changed);
changed = (androidManifest.SetWindowSoftInputMode("adjustPan") || changed);
changed = (androidManifest.SetHardwareAccelerated(true) || changed);
#if UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC
changed = (androidManifest.SetUsesCleartextTraffic(true) || changed);
Expand Down Expand Up @@ -163,6 +164,7 @@ public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
}
}
}
changed = (androidManifest.SetWindowSoftInputMode("adjustPan") || changed);
changed = (androidManifest.SetHardwareAccelerated(true) || changed);
#if UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC
changed = (androidManifest.SetUsesCleartextTraffic(true) || changed);
Expand Down Expand Up @@ -314,6 +316,16 @@ internal bool SetExported(bool enabled) {
return changed;
}

internal bool SetWindowSoftInputMode(string mode) {
bool changed = false;
var activity = GetActivityWithLaunchIntent() as XmlElement;
if (activity.GetAttribute("windowSoftInputMode", AndroidXmlNamespace) != mode) {
activity.SetAttribute("windowSoftInputMode", AndroidXmlNamespace, mode);
changed = true;
}
return changed;
}

internal bool SetHardwareAccelerated(bool enabled) {
bool changed = false;
var activity = GetActivityWithLaunchIntent() as XmlElement;
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 6c6f2f6

Please sign in to comment.