[Android] Add audio and video settings

This commit is contained in:
zilmar 2016-10-02 13:45:48 +11:00
parent 9307024cf4
commit 13fb7aa8ac
6 changed files with 85 additions and 2 deletions

View File

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

View File

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

View File

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

View File

@ -80,7 +80,11 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat
@Override
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());
}

View File

@ -47,7 +47,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
{
actionbar.setHomeButtonEnabled(true);
actionbar.setDisplayHomeAsUpEnabled(true);
}
}
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
sharedPrefs.edit().clear()

View File

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