Add an override for the native interface to be user disabled
This commit is contained in:
parent
4b148a7055
commit
40c4570271
|
@ -15,6 +15,34 @@
|
|||
android:layout_marginLeft="6dp"
|
||||
android:stretchColumns="*" >
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/native_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:ems="10"
|
||||
android:gravity="center_vertical|left"
|
||||
android:text="@string/select_native" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<de.ankri.views.Switch
|
||||
android:id="@+id/native_option"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical" >
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
<string name="folder_select">SELECT CURRENT FOLDER</string>
|
||||
|
||||
<string name="optimization_opts">Optimization and Debugging Options</string>
|
||||
<string name="experimental_opts">Experimental (May cause widespread panic)</string>
|
||||
<string name="experimental_opts">Expert (May cause widespread panic)</string>
|
||||
<string name="select_native">Disable Native Interface</string>
|
||||
<string name="select_dynarec">Dynarec Options</string>
|
||||
<string name="select_unstable">Unstable Optimisations</string>
|
||||
<string name="select_region">DC Region</string>
|
||||
|
|
|
@ -31,6 +31,7 @@ import android.widget.TextView;
|
|||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
|
||||
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu.OnOpenListener;
|
||||
import com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity;
|
||||
import com.reicast.emulator.config.Config;
|
||||
import com.reicast.emulator.config.ConfigureFragment;
|
||||
import com.reicast.emulator.config.InputFragment;
|
||||
import com.reicast.emulator.config.OptionsFragment;
|
||||
|
@ -413,9 +414,9 @@ public class MainActivity extends SlidingFragmentActivity implements
|
|||
// show it
|
||||
alertDialog.show();
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD && !Config.nonative) {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNINative.class));
|
||||
GL2JNINative.class));
|
||||
} else {
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, uri, getBaseContext(),
|
||||
GL2JNIActivity.class));
|
||||
|
|
|
@ -24,6 +24,7 @@ public class Config {
|
|||
public static int frameskip = 0;
|
||||
public static boolean pvrrender = false;
|
||||
public static String cheatdisk = "null";
|
||||
public static boolean nonative = false;
|
||||
|
||||
private SharedPreferences mPrefs;
|
||||
|
||||
|
@ -48,6 +49,7 @@ public class Config {
|
|||
Config.frameskip = mPrefs.getInt("frame_skip", frameskip);
|
||||
Config.pvrrender = mPrefs.getBoolean("pvr_render", pvrrender);
|
||||
Config.cheatdisk = mPrefs.getString("cheat_disk", cheatdisk);
|
||||
Config.nonative = mPrefs.getBoolean("native_override", nonative);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -78,6 +78,19 @@ public class ConfigureFragment extends Fragment {
|
|||
|
||||
// Generate the menu options and fill in existing settings
|
||||
|
||||
OnCheckedChangeListener native_options = new OnCheckedChangeListener() {
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView,
|
||||
boolean isChecked) {
|
||||
mPrefs.edit().putBoolean("native_override", isChecked).commit();
|
||||
Config.nonative = isChecked;
|
||||
}
|
||||
};
|
||||
Switch native_opt = (Switch) getView().findViewById(
|
||||
R.id.native_option);
|
||||
native_opt.setChecked(Config.nonative);
|
||||
native_opt.setOnCheckedChangeListener(native_options);
|
||||
|
||||
OnCheckedChangeListener dynarec_options = new OnCheckedChangeListener() {
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView,
|
||||
|
|
Loading…
Reference in New Issue