Disable virtual keyboard focus adjustment on Android

Fixes #37190

The default adjustment setting was causing the view to pan down in order
to adjust the focus on the text content.

We don't need any focus adjustment since we're using a fixed size window
for our application.

Documentation:
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING
This commit is contained in:
PouleyKetchoupp 2020-07-18 09:10:21 +02:00
parent d14932aeca
commit d7aaec8ffe

View file

@ -467,6 +467,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
final Activity activity = getActivity(); final Activity activity = getActivity();
Window window = activity.getWindow(); Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
mClipboard = (ClipboardManager)activity.getSystemService(Context.CLIPBOARD_SERVICE); mClipboard = (ClipboardManager)activity.getSystemService(Context.CLIPBOARD_SERVICE);
pluginRegistry = GodotPluginRegistry.initializePluginRegistry(this); pluginRegistry = GodotPluginRegistry.initializePluginRegistry(this);