From c1ed54832c69d2ab4fdc877b9cba74e2a07d673b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 25 Oct 2013 21:05:42 -0400 Subject: [Android] Maintain the chosen button layout when returning to the input overlay configuration menu. - Also make the overlay configuration screen fullscreen for the app. - Also force the overlay activity to be landscape, since this is the only orientation the EmulationActivity supports. --- .../settings/input/InputOverlayConfigButton.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/Android/src') diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputOverlayConfigButton.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputOverlayConfigButton.java index 39ac957234..8d95800c62 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputOverlayConfigButton.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/input/InputOverlayConfigButton.java @@ -39,6 +39,23 @@ 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()); + + // Check if this button has previous values set that aren't the default. + final float x = sharedPrefs.getFloat(buttonId+"-X", -1f); + final float y = sharedPrefs.getFloat(buttonId+"-Y", -1f); + + // 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); + setY(y); + } } @Override -- cgit v1.2.3