aboutsummaryrefslogtreecommitdiff
path: root/platform/android/java/src/org/godotengine/godot/Godot.java
diff options
context:
space:
mode:
authorRuslan Mustakov2017-10-04 15:39:31 +0700
committerRuslan Mustakov2017-10-04 17:21:05 +0700
commit275e537058ed870c4d37002f2110b7866d2ed1ae (patch)
tree150656cd97e9bae45098829d34d3fd34f1beadb0 /platform/android/java/src/org/godotengine/godot/Godot.java
parent6dc1025e6313d711939269e1578fff5ffc0cd30a (diff)
downloadgodot-275e537058ed870c4d37002f2110b7866d2ed1ae.tar.gz
godot-275e537058ed870c4d37002f2110b7866d2ed1ae.tar.zst
godot-275e537058ed870c4d37002f2110b7866d2ed1ae.zip
Diffstat (limited to 'platform/android/java/src/org/godotengine/godot/Godot.java')
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 53a90e4cf..053dfa631 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -277,6 +277,21 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
edittext.setView(mView);
io.setEdit(edittext);
+ final Godot godot = this;
+ mView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
+ @Override
+ public void onGlobalLayout() {
+ Point fullSize = new Point();
+ godot.getWindowManager().getDefaultDisplay().getSize(fullSize);
+ Rect gameSize = new Rect();
+ godot.mView.getWindowVisibleDisplayFrame(gameSize);
+
+ final int keyboardHeight = fullSize.y - gameSize.bottom;
+ Log.d("GODOT", "setVirtualKeyboardHeight: " + keyboardHeight);
+ GodotLib.setVirtualKeyboardHeight(keyboardHeight);
+ }
+ });
+
// Ad layout
adLayout = new RelativeLayout(this);
adLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));