mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 23:59:27 +01:00
[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.
This commit is contained in:
parent
01764fef67
commit
335839b27f
14
Source/Android/res/layout/emulation_view.xml
Normal file
14
Source/Android/res/layout/emulation_view.xml
Normal file
@ -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>
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user