[Android] Add audio and video settings
This commit is contained in:
parent
9307024cf4
commit
13fb7aa8ac
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="audio_Enabled"
|
||||||
|
android:summary="@string/audioEnabled_summary"
|
||||||
|
android:title="@string/audioEnabled_title" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="Debugger_DisplaySpeed"
|
||||||
|
android:summary="@string/DisplaySpeed_summary"
|
||||||
|
android:title="@string/DisplaySpeed_title" />
|
||||||
|
<ListPreference
|
||||||
|
android:entries="@array/DisplaySpeed_list"
|
||||||
|
android:entryValues="@array/DisplaySpeed_values"
|
||||||
|
android:key="Debugger_DisplaySpeedType"
|
||||||
|
android:title="@string/DisplaySpeedDisplay" />
|
||||||
|
|
||||||
|
</PreferenceScreen>
|
|
@ -0,0 +1,28 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
package emu.project64.settings;
|
||||||
|
|
||||||
|
import emu.project64.R;
|
||||||
|
|
||||||
|
public class AudioFragment extends BaseSettingsFragment
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected int getXml()
|
||||||
|
{
|
||||||
|
return R.xml.setting_audio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getTitleId()
|
||||||
|
{
|
||||||
|
return R.string.audio_screen_title;
|
||||||
|
}
|
||||||
|
}
|
|
@ -80,7 +80,11 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceTreeClick(Preference preference)
|
public boolean onPreferenceTreeClick(Preference preference)
|
||||||
{
|
{
|
||||||
if (preference.getKey().equals("settings_audio"))
|
if (preference.getKey().equals("settings_video"))
|
||||||
|
{
|
||||||
|
loadFragment(new VideoFragment());
|
||||||
|
}
|
||||||
|
else if (preference.getKey().equals("settings_audio"))
|
||||||
{
|
{
|
||||||
loadFragment(new AudioFragment());
|
loadFragment(new AudioFragment());
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
||||||
{
|
{
|
||||||
actionbar.setHomeButtonEnabled(true);
|
actionbar.setHomeButtonEnabled(true);
|
||||||
actionbar.setDisplayHomeAsUpEnabled(true);
|
actionbar.setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
sharedPrefs.edit().clear()
|
sharedPrefs.edit().clear()
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
package emu.project64.settings;
|
||||||
|
|
||||||
|
import emu.project64.R;
|
||||||
|
|
||||||
|
public class VideoFragment extends BaseSettingsFragment
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected int getXml()
|
||||||
|
{
|
||||||
|
return R.xml.setting_video;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getTitleId()
|
||||||
|
{
|
||||||
|
return R.string.video_screen_title;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue