Permalink
Browse files

front: refactor general settings

  • Loading branch information...
fzurita committed Mar 13, 2016
1 parent 7b1aae7 commit ec656699f5d76e7175f08d4734b26de1707933e0
View
@@ -85,12 +85,67 @@
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.GlobalPrefsActivity"
android:name="paulscode.android.mupen64plusae.persistent.AudioPrefsActivity"
android:exported="false"
android:label="@string/SettingsGlobalActivity_title"
android:label="@string/categoryAudio_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.GlobalPrefsActivity" />
<action android:name=".persistent.AudioPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.DataPrefsActivity"
android:exported="false"
android:label="@string/categoryData_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.DataPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.DisplayPrefsActivity"
android:exported="false"
android:label="@string/categoryDisplay_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.DisplayPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.InputPrefsActivity"
android:exported="false"
android:label="@string/categoryInput_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.InputPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.LibraryPrefsActivity"
android:exported="false"
android:label="@string/categoryLibrary_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.LibraryPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="paulscode.android.mupen64plusae.persistent.TouchscreenPrefsActivity"
android:exported="false"
android:label="@string/categoryTouchscreen_title"
android:theme="@style/Theme.Mupen64plusaeTheme" >
<intent-filter>
<action android:name=".persistent.TouchscreenPrefsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
@@ -9,7 +9,28 @@
<item
android:id="@+id/menuItem_settings"
android:icon="@drawable/ic_settings"
android:title="@string/menuItem_settings"/>
android:title="@string/menuItem_settings">
<menu>
<item
android:id="@+id/menuItem_categoryLibrary"
android:title="@string/categoryLibrary_title"/>
<item
android:id="@+id/menuItem_categoryDisplay"
android:title="@string/categoryDisplay_title"/>
<item
android:id="@+id/menuItem_categoryAudio"
android:title="@string/categoryAudio_title"/>
<item
android:id="@+id/menuItem_categoryTouchscreen"
android:title="@string/categoryTouchscreen_title"/>
<item
android:id="@+id/menuItem_categoryInput"
android:title="@string/categoryInput_title"/>
<item
android:id="@+id/menuItem_categoryData"
android:title="@string/categoryData_title"/>
</menu>
</item>
<item
android:id="@+id/menuItem_localeOverride"
android:icon="@drawable/ic_location"
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************
RECOMMENDED PRACTICES FOR DESIGNERS & DEVELOPERS:
Wherever possible, use Android's built-in Preference framework for defining global
user settings and the menu interface that supports them:
http://developer.android.com/guide/topics/ui/settings.html
http://developer.android.com/design/patterns/settings.html
Please follow our naming convention (casing and underscores) for all Preferences:
<android.support.v7.preference.CheckBoxPreference
android:key="myKey"
android:title="@string/myKey_title"
android:summary="@string/myKey_summary"
...
/>
<paulscode.android.mupen64plusae.preference.CompatListPreference
...
android:entries="@array/myKey_entries"
android:entryValues="@array/myKey_values"
android:defaultValue="@string/myKey_default"
...
/>
<paulscode.android.mupen64plusae.MyCustomPreference
...
mupen64:myAttribute="@string/myKey_myAttribute"
...
/>
Strings should never be hard-coded into this file, with the exception perhaps of
boolean default values. Instead, define all strings as resources in:
res/values/strings.xml
To improve code readability, define all arrays as resources in:
res/values/arrays.xml
Define default array values below the arrays themselves in arrays.xml, rather than
in strings.xml. This makes it easy to keep arrays and their default values
synchronized.
To minimize app size, consider using Android's built-in resources when possible.
For example, consider icon resources in "@android:drawable/..." instead of custom
resources in "@drawable/...".
***********************************************************************************
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mupen64="http://schemas.android.com/apk/res/org.mupen64plusae.v3.alpha"
android:key="screenRoot" >
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioPlugin_default"
android:entries="@array/audioPlugin_entries"
android:entryValues="@array/audioPlugin_values"
android:key="audioPlugin"
android:summary="@string/selectedValue"
android:title="@string/audioPlugin_title" />
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioSDLBufferSize_default"
android:entries="@array/audioSDLBufferSize_entries"
android:entryValues="@array/audioSDLBufferSize_values"
android:key="audioSDLBufferSize"
android:summary="@string/selectedValue"
android:title="@string/audioSDLBufferSize_title" />
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioSLESBufferSize_default"
android:entries="@array/audioSLESBufferSize_entries"
android:entryValues="@array/audioSLESBufferSize_values"
android:key="audioSLESBufferSize"
android:summary="@string/selectedValue"
android:title="@string/audioSLESBufferSize_title" />
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/audioSLESBufferNbr_default"
android:entries="@array/audioSLESBufferNbr_entries"
android:entryValues="@array/audioSLESBufferNbr_values"
android:key="audioSLESBufferNbr"
android:summary="@string/selectedValue"
android:title="@string/audioSLESBufferNbr_title" />
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="true"
android:key="audioSynchronize"
android:summary="@string/audioSynchronize_summary"
android:title="@string/audioSynchronize_title" />
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="false"
android:key="audioSwapChannels"
android:summary="@string/audioSwapChannels_summary"
android:title="@string/audioSwapChannels_title" />
</android.support.v7.preference.PreferenceScreen>
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************
RECOMMENDED PRACTICES FOR DESIGNERS & DEVELOPERS:
Wherever possible, use Android's built-in Preference framework for defining global
user settings and the menu interface that supports them:
http://developer.android.com/guide/topics/ui/settings.html
http://developer.android.com/design/patterns/settings.html
Please follow our naming convention (casing and underscores) for all Preferences:
<android.support.v7.preference.CheckBoxPreference
android:key="myKey"
android:title="@string/myKey_title"
android:summary="@string/myKey_summary"
...
/>
<paulscode.android.mupen64plusae.preference.CompatListPreference
...
android:entries="@array/myKey_entries"
android:entryValues="@array/myKey_values"
android:defaultValue="@string/myKey_default"
...
/>
<paulscode.android.mupen64plusae.MyCustomPreference
...
mupen64:myAttribute="@string/myKey_myAttribute"
...
/>
Strings should never be hard-coded into this file, with the exception perhaps of
boolean default values. Instead, define all strings as resources in:
res/values/strings.xml
To improve code readability, define all arrays as resources in:
res/values/arrays.xml
Define default array values below the arrays themselves in arrays.xml, rather than
in strings.xml. This makes it easy to keep arrays and their default values
synchronized.
To minimize app size, consider using Android's built-in resources when possible.
For example, consider icon resources in "@android:drawable/..." instead of custom
resources in "@drawable/...".
***********************************************************************************
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mupen64="http://schemas.android.com/apk/res/org.mupen64plusae.v3.alpha"
android:key="screenRoot" >
<paulscode.android.mupen64plusae.preference.PathPreference
android:defaultValue="@string/pathGameSaves_default"
android:key="pathGameSaves"
android:title="@string/pathGameSaves_title"
mupen64:selectionMode="0" />
<paulscode.android.mupen64plusae.preference.SeekBarPreference
android:defaultValue="4"
android:key="gameAutoSaves"
android:title="@string/GameAutoSavesMax_title"
mupen64:maximumValue="10"
mupen64:minimumValue="1"
mupen64:stepSize="1"
mupen64:units="" />
<android.support.v7.preference.Preference
android:key="actionReloadAssets"
android:summary="@string/actionReloadAssets_summary"
android:title="@string/actionReloadAssets_title" />
<android.support.v7.preference.Preference
android:icon="@drawable/ic_undo"
android:key="actionResetUserPrefs"
android:summary="@string/actionResetUserPrefs_summary"
android:title="@string/actionResetUserPrefs_title" />
</android.support.v7.preference.PreferenceScreen>
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
***********************************************************************************
RECOMMENDED PRACTICES FOR DESIGNERS & DEVELOPERS:
Wherever possible, use Android's built-in Preference framework for defining global
user settings and the menu interface that supports them:
http://developer.android.com/guide/topics/ui/settings.html
http://developer.android.com/design/patterns/settings.html
Please follow our naming convention (casing and underscores) for all Preferences:
<android.support.v7.preference.CheckBoxPreference
android:key="myKey"
android:title="@string/myKey_title"
android:summary="@string/myKey_summary"
...
/>
<paulscode.android.mupen64plusae.preference.CompatListPreference
...
android:entries="@array/myKey_entries"
android:entryValues="@array/myKey_values"
android:defaultValue="@string/myKey_default"
...
/>
<paulscode.android.mupen64plusae.MyCustomPreference
...
mupen64:myAttribute="@string/myKey_myAttribute"
...
/>
Strings should never be hard-coded into this file, with the exception perhaps of
boolean default values. Instead, define all strings as resources in:
res/values/strings.xml
To improve code readability, define all arrays as resources in:
res/values/arrays.xml
Define default array values below the arrays themselves in arrays.xml, rather than
in strings.xml. This makes it easy to keep arrays and their default values
synchronized.
To minimize app size, consider using Android's built-in resources when possible.
For example, consider icon resources in "@android:drawable/..." instead of custom
resources in "@drawable/...".
***********************************************************************************
-->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mupen64="http://schemas.android.com/apk/res/org.mupen64plusae.v3.alpha"
android:key="screenRoot" >
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/displayOrientation_default"
android:entries="@array/displayOrientation_entries"
android:entryValues="@array/displayOrientation_values"
android:key="displayOrientation"
android:summary="@string/selectedValue"
android:title="@string/displayOrientation_title" />
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/displayPosition_default"
android:entries="@array/displayPosition_entries"
android:entryValues="@array/displayPosition_values"
android:key="displayPosition"
android:summary="@string/selectedValue"
android:title="@string/displayPosition_title" />
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="false"
android:key="displayImmersiveMode"
android:summary="@string/displayImmersiveMode_summary"
android:title="@string/displayImmersiveMode_title" />
<paulscode.android.mupen64plusae.preference.SeekBarPreference
android:defaultValue="80"
android:key="displayActionBarTransparency"
android:title="@string/displayActionBarTransparency_title"
mupen64:maximumValue="100"
mupen64:stepSize="10"
mupen64:units="%" />
<android.support.v7.preference.CheckBoxPreference
android:defaultValue="false"
android:key="displayFps"
android:summary="@string/displayFps_summary"
android:title="@string/displayFps_title" />
<paulscode.android.mupen64plusae.preference.CompatListPreference
android:defaultValue="@string/videoHardwareType_default"
android:entries="@array/videoHardwareType_entries"
android:entryValues="@array/videoHardwareType_values"
android:key="videoHardwareType"
android:summary="@string/selectedValue"
android:title="@string/videoHardwareType_title" />
<android.support.v7.preference.EditTextPreference
android:defaultValue="-1.5"
android:inputType="numberDecimal|numberSigned"
android:key="videoPolygonOffset"
android:summary="@string/videoPolygonOffset_summary"
android:title="@string/videoPolygonOffset_title" />
</android.support.v7.preference.PreferenceScreen>
Oops, something went wrong.

0 comments on commit ec65669

Please sign in to comment.