summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-08-29 13:13:44 -0400
committerLioncash <mathew1800@gmail.com>2013-08-29 13:13:44 -0400
commit335839b27f29f4020d4edf21169c4bd455252f4b (patch)
tree4abe2ac6b9a55dbadc5f3a7071b7d33b7f8b505d /Source/Android
parent01764fef67d650d36f33b4dcae3744997c2636da (diff)
[Android] Move the instantiation of the NativeGLSurfaceView into a layout file. This will allow the addition of other components in the future, such as overlays, etc.
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/res/layout/emulation_view.xml14
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java4
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java6
3 files changed, 19 insertions, 5 deletions
diff --git a/Source/Android/res/layout/emulation_view.xml b/Source/Android/res/layout/emulation_view.xml
new file mode 100644
index 0000000000..017e98602e
--- /dev/null
+++ b/Source/Android/res/layout/emulation_view.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <!-- This is what everything is rendered to during emulation -->
+ <org.dolphinemu.dolphinemu.NativeGLSurfaceView
+ android:id="@+id/emulationView"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:focusable="false"
+ android:focusableInTouchMode="false"/>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
index a4b24391fb..00aabfaf66 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java
@@ -27,7 +27,6 @@ import org.dolphinemu.dolphinemu.settings.UserPreferences;
public final class DolphinEmulator<MainActivity> extends Activity
{
- private static NativeGLSurfaceView GLview = null;
private static boolean Running = false;
private float screenWidth;
@@ -154,11 +153,10 @@ public final class DolphinEmulator<MainActivity> extends Activity
screenHeight = displayMetrics.heightPixels;
String FileName = data.getStringExtra("Select");
- GLview = new NativeGLSurfaceView(this);
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
NativeLibrary.SetFilename(FileName);
- setContentView(GLview);
+ setContentView(R.layout.emulation_view);
Running = true;
}
}
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java
index d35b8a4adb..4551e5b94c 100644
--- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java
@@ -7,6 +7,7 @@
package org.dolphinemu.dolphinemu;
import android.content.Context;
+import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
@@ -24,9 +25,10 @@ public final class NativeGLSurfaceView extends SurfaceView
*
* @param context The current {@link Context}.
*/
- public NativeGLSurfaceView(Context context)
+ public NativeGLSurfaceView(Context context, AttributeSet attribs)
{
- super(context);
+ super(context, attribs);
+
if (!Created)
{
myRun = new Thread()