From a8240f73511ec90614d9b394fa36763c00808c32 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Tue, 18 Aug 2020 16:51:31 -0700 Subject: [PATCH] Fix issue causing the textedit to move upward --- platform/android/java/lib/res/values/dimens.xml | 4 ++++ .../android/java/lib/src/org/godotengine/godot/Godot.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 platform/android/java/lib/res/values/dimens.xml diff --git a/platform/android/java/lib/res/values/dimens.xml b/platform/android/java/lib/res/values/dimens.xml new file mode 100644 index 00000000000..9034dbbcc1f --- /dev/null +++ b/platform/android/java/lib/res/values/dimens.xml @@ -0,0 +1,4 @@ + + + 48dp + diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index 0760d3130d7..9c37e35775b 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -160,8 +160,7 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe private void setButtonPausedState(boolean paused) { mStatePaused = paused; - int stringResourceID = paused ? R.string.text_button_resume : - R.string.text_button_pause; + int stringResourceID = paused ? R.string.text_button_resume : R.string.text_button_pause; mPauseButton.setText(stringResourceID); } @@ -318,7 +317,8 @@ public abstract class Godot extends FragmentActivity implements SensorEventListe // GodotEditText layout GodotEditText edittext = new GodotEditText(this); - edittext.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); + edittext.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.MATCH_PARENT, + (int)getResources().getDimension(R.dimen.text_edit_height))); // ...add to FrameLayout layout.addView(edittext);