Android: Replaced deprecated AbsoluteLayout with RelativeLayout.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 27 Jul 2016 20:46:18 +0200
changeset 10210 1b5a21b3fa97
parent 10209 afd286e26823
child 10211 2e4c1b2fce79
Android: Replaced deprecated AbsoluteLayout with RelativeLayout. Fixes Bugzilla #2211.
android-project/src/org/libsdl/app/SDLActivity.java
--- a/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jul 20 21:01:14 2016 +0200
+++ b/android-project/src/org/libsdl/app/SDLActivity.java	Wed Jul 27 20:46:18 2016 +0200
@@ -17,7 +17,7 @@
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputConnection;
 import android.view.inputmethod.InputMethodManager;
-import android.widget.AbsoluteLayout;
+import android.widget.RelativeLayout;
 import android.widget.Button;
 import android.widget.LinearLayout;
 import android.widget.TextView;
@@ -171,7 +171,7 @@
             mJoystickHandler = new SDLJoystickHandler();
         }
 
-        mLayout = new AbsoluteLayout(this);
+        mLayout = new RelativeLayout(this);
         mLayout.addView(mSurface);
 
         setContentView(mLayout);
@@ -504,8 +504,9 @@
 
         @Override
         public void run() {
-            AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
-                    w, h + HEIGHT_PADDING, x, y);
+            RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(w, h + HEIGHT_PADDING);
+            params.leftMargin = x;
+            params.topMargin = y;
 
             if (mTextEdit == null) {
                 mTextEdit = new DummyEdit(getContext());