[Android] Fix alignment issues with the overlay config settings.

This commit is contained in:
Lioncash 2013-10-25 21:29:06 -04:00
parent 7c6caa388a
commit d9be95ed9e
2 changed files with 23 additions and 8 deletions

View File

@ -1,16 +1,23 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/inputLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_height="fill_parent"
android:clipChildren="false"
android:clipToPadding="false" >
<org.dolphinemu.dolphinemu.settings.input.InputOverlayConfigButton
android:id="@+id/button_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_alignParentStart="false"
android:layout_alignParentTop="false"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="false"
android:layout_centerInParent="false"
android:layout_centerVertical="false"
android:background="@drawable/button_a" />
@ -18,22 +25,32 @@
android:id="@+id/button_b"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_alignParentStart="false"
android:layout_alignParentTop="false"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="false"
android:layout_centerInParent="false"
android:layout_centerVertical="false"
android:layout_toRightOf="@+id/button_a"
android:background="@drawable/button_b" />
<org.dolphinemu.dolphinemu.settings.input.InputOverlayConfigButton
android:id="@+id/button_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="false"
android:layout_alignParentEnd="false"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="false"
android:layout_alignParentStart="false"
android:layout_alignParentTop="false"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="false"
android:layout_centerInParent="false"
android:layout_centerVertical="false"
android:layout_toRightOf="@+id/button_b"
android:background="@drawable/button_start" />
</RelativeLayout>

View File

@ -39,7 +39,7 @@ public final class InputOverlayConfigButton extends Button implements OnTouchLis
// Get the SharedPreferences instance.
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
// String ID of this button.
final String buttonId = getResources().getResourceEntryName(getId());
@ -49,8 +49,6 @@ public final class InputOverlayConfigButton extends Button implements OnTouchLis
// If they are not -1, then they have a previous value set.
// Thus, we set those coordinate values.
// TODO: This is not always correct placement. Fix this.
// Likely something to do with the backing layout being a relative layout.
if (x != -1f && y != -1f)
{
setX(x);