[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.
This commit is contained in:
Lioncash 2013-10-25 21:05:42 -04:00
parent c8cf71c913
commit c1ed54832c
2 changed files with 25 additions and 4 deletions

View File

@ -35,10 +35,14 @@
<activity android:name="org.dolphinemu.dolphinemu.gamelist.GameListActivity"/>
<activity android:name="org.dolphinemu.dolphinemu.emulation.EmulationActivity"
<activity
android:name="org.dolphinemu.dolphinemu.emulation.EmulationActivity"
android:screenOrientation="landscape" />
<activity android:name="org.dolphinemu.dolphinemu.settings.input.InputOverlayConfigActivity"/>
<activity
android:name="org.dolphinemu.dolphinemu.settings.input.InputOverlayConfigActivity"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity
android:name="org.dolphinemu.dolphinemu.settings.PrefsActivity"

View File

@ -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