Android: Support more than one controller

This commit is contained in:
Connor McLaughlin 2021-03-14 17:21:39 +10:00
parent 1839bfab3b
commit c8a029c5cb
15 changed files with 234 additions and 143 deletions

View File

@ -43,9 +43,9 @@
android:value="com.github.stenzek.duckstation.MainActivity" />
</activity>
<activity
android:name=".ControllerMappingActivity"
android:name=".ControllerSettingsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_settings"
android:label="@string/controller_mapping_activity_title"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"

View File

@ -16,11 +16,12 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentFactory;
import androidx.preference.ListPreference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreferenceCompat;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
@ -29,7 +30,7 @@ import com.google.android.material.tabs.TabLayoutMediator;
import java.util.ArrayList;
public class ControllerMappingActivity extends AppCompatActivity {
public class ControllerSettingsActivity extends AppCompatActivity {
private static final int NUM_CONTROLLER_PORTS = 2;
@ -109,7 +110,7 @@ public class ControllerMappingActivity extends AppCompatActivity {
doLoadProfile(profileNames[choice]);
dialog.dismiss();
})
.setNegativeButton("Cancel", ((dialog, which) -> dialog.dismiss()))
.setNegativeButton(R.string.controller_mapping_activity_cancel, ((dialog, which) -> dialog.dismiss()))
.create()
.show();
}
@ -140,7 +141,7 @@ public class ControllerMappingActivity extends AppCompatActivity {
return;
}
Toast.makeText(ControllerMappingActivity.this, String.format(ControllerMappingActivity.this.getString(R.string.controller_mapping_activity_input_profile_saved), name),
Toast.makeText(ControllerSettingsActivity.this, String.format(ControllerSettingsActivity.this.getString(R.string.controller_mapping_activity_input_profile_saved), name),
Toast.LENGTH_LONG).show();
});
builder.setNegativeButton(R.string.controller_mapping_activity_cancel, (dialog, which) -> dialog.dismiss());
@ -159,57 +160,150 @@ public class ControllerMappingActivity extends AppCompatActivity {
pref.updateValue();
}
public static class ControllerPortFragment extends PreferenceFragmentCompat {
private ControllerMappingActivity activity;
private int controllerIndex;
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.controllers_preferences, rootKey);
}
}
public ControllerPortFragment(ControllerMappingActivity activity, int controllerIndex) {
public static class ControllerPortFragment extends PreferenceFragmentCompat {
private ControllerSettingsActivity activity;
private int controllerIndex;
private PreferenceCategory mButtonsCategory;
private PreferenceCategory mAxisCategory;
private PreferenceCategory mSettingsCategory;
public ControllerPortFragment(ControllerSettingsActivity activity, int controllerIndex) {
this.activity = activity;
this.controllerIndex = controllerIndex;
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
final PreferenceScreen ps = getPreferenceManager().createPreferenceScreen(getContext());
setPreferenceScreen(ps);
createPreferences();
}
private SwitchPreferenceCompat createTogglePreference(String key, int title, int summary, boolean defaultValue) {
final SwitchPreferenceCompat pref = new SwitchPreferenceCompat(getContext());
pref.setKey(key);
pref.setTitle(title);
pref.setSummary(summary);
pref.setIconSpaceReserved(false);
pref.setDefaultValue(defaultValue);
return pref;
}
private void createPreferences() {
final PreferenceScreen ps = getPreferenceScreen();
final SharedPreferences sp = getPreferenceManager().getSharedPreferences();
final String defaultControllerType = controllerIndex == 0 ? "DigitalController" : "None";
final String controllerType = sp.getString(String.format("Controller%d/Type", controllerIndex), defaultControllerType);
final String controllerTypeKey = String.format("Controller%d/Type", controllerIndex);
final String controllerType = sp.getString(controllerTypeKey, defaultControllerType);
final String[] controllerButtons = AndroidHostInterface.getControllerButtonNames(controllerType);
final String[] axisButtons = AndroidHostInterface.getControllerAxisNames(controllerType);
final int vibrationMotors = AndroidHostInterface.getControllerVibrationMotorCount(controllerType);
final ListPreference typePreference = new ListPreference(getContext());
typePreference.setEntries(R.array.settings_controller_type_entries);
typePreference.setEntryValues(R.array.settings_controller_type_values);
typePreference.setKey(controllerTypeKey);
typePreference.setTitle(R.string.settings_controller_type);
typePreference.setSummaryProvider(ListPreference.SimpleSummaryProvider.getInstance());
typePreference.setIconSpaceReserved(false);
typePreference.setOnPreferenceChangeListener((pref, value) -> {
removePreferences();
createPreferences(value.toString());
return true;
});
ps.addPreference(typePreference);
mButtonsCategory = new PreferenceCategory(getContext());
mButtonsCategory.setTitle(getContext().getString(R.string.controller_settings_category_button_bindings));
mButtonsCategory.setIconSpaceReserved(false);
ps.addPreference(mButtonsCategory);
mAxisCategory = new PreferenceCategory(getContext());
mAxisCategory.setTitle(getContext().getString(R.string.controller_settings_category_axis_bindings));
mAxisCategory.setIconSpaceReserved(false);
ps.addPreference(mAxisCategory);
mSettingsCategory = new PreferenceCategory(getContext());
mSettingsCategory.setTitle(getContext().getString(R.string.controller_settings_category_settings));
mSettingsCategory.setIconSpaceReserved(false);
ps.addPreference(mSettingsCategory);
createPreferences(controllerType);
}
private void createPreferences(String controllerType) {
final PreferenceScreen ps = getPreferenceScreen();
final SharedPreferences sp = getPreferenceManager().getSharedPreferences();
final String[] controllerButtons = AndroidHostInterface.getControllerButtonNames(controllerType);
final String[] axisButtons = AndroidHostInterface.getControllerAxisNames(controllerType);
final int vibrationMotors = AndroidHostInterface.getControllerVibrationMotorCount(controllerType);
final PreferenceScreen ps = getPreferenceManager().createPreferenceScreen(getContext());
if (controllerButtons != null) {
for (String buttonName : controllerButtons) {
final ControllerBindingPreference cbp = new ControllerBindingPreference(getContext(), null);
cbp.initButton(controllerIndex, buttonName);
ps.addPreference(cbp);
mButtonsCategory.addPreference(cbp);
activity.mPreferences.add(cbp);
}
}
if (axisButtons != null) {
for (String axisName : axisButtons) {
final ControllerBindingPreference cbp = new ControllerBindingPreference(getContext(), null);
cbp.initAxis(controllerIndex, axisName);
ps.addPreference(cbp);
mAxisCategory.addPreference(cbp);
activity.mPreferences.add(cbp);
}
}
if (vibrationMotors > 0) {
final ControllerBindingPreference cbp = new ControllerBindingPreference(getContext(), null);
cbp.initVibration(controllerIndex);
ps.addPreference(cbp);
mSettingsCategory.addPreference(cbp);
activity.mPreferences.add(cbp);
}
setPreferenceScreen(ps);
if (controllerType.equals("AnalogController")) {
mSettingsCategory.addPreference(
createTogglePreference(String.format("Controller%d/ForceAnalogOnReset", controllerIndex),
R.string.settings_use_analog_sticks_for_dpad, R.string.settings_summary_enable_analog_mode_on_reset, true));
mSettingsCategory.addPreference(
createTogglePreference(String.format("Controller%d/AnalogDPadInDigitalMode", controllerIndex),
R.string.settings_enable_analog_mode_on_reset, R.string.settings_summary_use_analog_sticks_for_dpad, true));
}
}
private void removePreferences() {
for (int i = 0; i < mButtonsCategory.getPreferenceCount(); i++) {
activity.mPreferences.remove(mButtonsCategory.getPreference(i));
}
mButtonsCategory.removeAll();
for (int i = 0; i < mAxisCategory.getPreferenceCount(); i++) {
activity.mPreferences.remove(mAxisCategory.getPreference(i));
}
mAxisCategory.removeAll();
for (int i = 0; i < mSettingsCategory.getPreferenceCount(); i++) {
activity.mPreferences.remove(mSettingsCategory.getPreference(i));
}
mSettingsCategory.removeAll();
}
}
public static class HotkeyFragment extends PreferenceFragmentCompat {
private ControllerMappingActivity activity;
private ControllerSettingsActivity activity;
private HotkeyInfo[] mHotkeyInfo;
public HotkeyFragment(ControllerMappingActivity activity) {
public HotkeyFragment(ControllerSettingsActivity activity) {
this.activity = activity;
this.mHotkeyInfo = AndroidHostInterface.getInstance().getHotkeyInfoList();
}
@ -231,56 +325,65 @@ public class ControllerMappingActivity extends AppCompatActivity {
}
public static class SettingsCollectionFragment extends Fragment {
private ControllerMappingActivity activity;
private ControllerSettingsActivity activity;
private SettingsCollectionAdapter adapter;
private ViewPager2 viewPager;
private String[] controllerPortNames;
public SettingsCollectionFragment(ControllerMappingActivity activity) {
public SettingsCollectionFragment(ControllerSettingsActivity activity) {
this.activity = activity;
controllerPortNames = new String[] { "Port 1", "Port 2" };
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_controller_mapping, container, false);
return inflater.inflate(R.layout.fragment_controller_settings, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
adapter = new SettingsCollectionAdapter(activity, this);
adapter = new SettingsCollectionAdapter(activity, this, controllerPortNames.length);
viewPager = view.findViewById(R.id.view_pager);
viewPager.setAdapter(adapter);
TabLayout tabLayout = view.findViewById(R.id.tab_layout);
new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {
if (position == NUM_CONTROLLER_PORTS)
tab.setText("Hotkeys");
if (position == 0)
tab.setText(R.string.controller_settings_tab_settings);
else if (position <= controllerPortNames.length)
tab.setText(controllerPortNames[position - 1]);
else
tab.setText(String.format("Port %d", position + 1));
tab.setText(R.string.controller_settings_tab_hotkeys);
}).attach();
}
}
public static class SettingsCollectionAdapter extends FragmentStateAdapter {
private ControllerMappingActivity activity;
private ControllerSettingsActivity activity;
private int controllerPorts;
public SettingsCollectionAdapter(@NonNull ControllerMappingActivity activity, @NonNull Fragment fragment) {
public SettingsCollectionAdapter(@NonNull ControllerSettingsActivity activity, @NonNull Fragment fragment, int controllerPorts) {
super(fragment);
this.activity = activity;
this.controllerPorts = controllerPorts;
}
@NonNull
@Override
public Fragment createFragment(int position) {
if (position != NUM_CONTROLLER_PORTS)
return new ControllerPortFragment(activity, position + 1);
if (position == 0)
return new SettingsFragment();
else if (position <= controllerPorts)
return new ControllerPortFragment(activity, position);
else
return new HotkeyFragment(activity);
}
@Override
public int getItemCount() {
return NUM_CONTROLLER_PORTS + 1;
return NUM_CONTROLLER_PORTS + 2;
}
}
}

View File

@ -1,16 +1,11 @@
package com.github.stenzek.duckstation;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Property;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -20,7 +15,6 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.ListFragment;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
@ -28,8 +22,6 @@ import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import java.util.ArrayList;
public class GamePropertiesActivity extends AppCompatActivity {
PropertyListAdapter mPropertiesListAdapter;
GameListEntry mGameListEntry;
@ -183,7 +175,7 @@ public class GamePropertiesActivity extends AppCompatActivity {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_controller_mapping, container, false);
return inflater.inflate(R.layout.fragment_controller_settings, container, false);
}
@Override

View File

@ -26,8 +26,6 @@ import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentFactory;
import androidx.preference.PreferenceManager;
import java.io.ByteArrayOutputStream;
@ -237,8 +235,8 @@ public class MainActivity extends AppCompatActivity {
Intent intent = new Intent(this, SettingsActivity.class);
startActivityForResult(intent, REQUEST_SETTINGS);
return true;
} else if (id == R.id.action_controller_mapping) {
Intent intent = new Intent(this, ControllerMappingActivity.class);
} else if (id == R.id.action_controller_settings) {
Intent intent = new Intent(this, ControllerSettingsActivity.class);
startActivity(intent);
return true;
} else if (id == R.id.action_switch_view) {

View File

@ -107,13 +107,10 @@ public class SettingsActivity extends AppCompatActivity {
case 3: // Enhancements
return new SettingsFragment(R.xml.enhancements_preferences);
case 4: // Controllers
return new SettingsFragment(R.xml.controllers_preferences);
case 5: // Achievements
case 4: // Achievements
return new AchievementSettingsFragment();
case 6: // Advanced
case 5: // Advanced
return new SettingsFragment(R.xml.advanced_preferences);
default:
@ -123,7 +120,7 @@ public class SettingsActivity extends AppCompatActivity {
@Override
public int getItemCount() {
return 7;
return 6;
}
}
}

View File

@ -10,7 +10,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextAppearance="@style/TabTextAppearance"
app:tabMode="fixed" />
app:tabMinWidth="150dp"
app:tabMode="scrollable" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"

View File

@ -21,12 +21,14 @@
android:id="@+id/action_switch_view"
android:icon="@drawable/ic_baseline_settings_24"
android:orderInCategory="100"
android:title="@string/action_settings"
android:title="Switch View"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_controller_mapping"
android:id="@+id/action_controller_settings"
android:icon="@drawable/ic_baseline_gamepad_24"
android:title="@string/action_controller_mapping" />
android:orderInCategory="102"
android:title="@string/action_controller_mapping"
app:showAsAction="ifRoom" />
<item
android:id="@+id/action_edit_game_directories"
android:title="@string/menu_main_edit_game_directories" />

View File

@ -69,8 +69,11 @@
<item>xBR (Sin unión de bordes)</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Control Digital (Mando)</item>
<item>Control Analógico (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>Sin tarjeta de memoria</item>
@ -139,7 +142,6 @@
<item>Pantalla</item>
<item>Audio</item>
<item>Mejoras</item>
<item>Controles</item>
<item>Achievements</item>
<item>Avanzado</item>
</string-array>

View File

@ -69,8 +69,11 @@
<item>xBR (No Blending Bordi)</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Controller Digitale (Gamepad)</item>
<item>Controller Analogico (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>No Memory Card</item>
@ -139,7 +142,6 @@
<item>Display</item>
<item>Audio</item>
<item>Miglioramenti</item>
<item>Controller</item>
<item>Achievements</item>
<item>Avanzate</item>
</string-array>

View File

@ -69,8 +69,11 @@
<item>xBR (Geen Edge Blending)</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Digitale Controller (Gamepad)</item>
<item>Analoge Controller (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>Geen Geheugenkaart</item>
@ -139,7 +142,6 @@
<item>Weergave</item>
<item>Audio</item>
<item>Verbeteringen</item>
<item>Controllers</item>
<item>Achievements</item>
<item>Geavanceerd</item>
</string-array>

View File

@ -69,8 +69,11 @@
<item>xBR (Sem ajustes laterais)</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Controle Digital (Gamepad)</item>
<item>Controle Analógico (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>Sem Cartão de Memória</item>
@ -139,7 +142,6 @@
<item>Vídeo</item>
<item>Áudio</item>
<item>Melhorias</item>
<item>Controles</item>
<item>Achievements</item>
<item>Avançado</item>
</string-array>

View File

@ -69,8 +69,11 @@
<item>xBR (без сглаживания краёв)</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Цифровой</item>
<item>Аналоговый (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>Без карты памяти</item>
@ -145,7 +148,6 @@
<item>Экран</item>
<item>Звук</item>
<item>Улучшения</item>
<item>Контроллеры</item>
<item>Достижения</item>
<item>Расширенные</item>
</string-array>

View File

@ -138,12 +138,18 @@
<item>xBRBinAlpha</item>
</string-array>
<string-array name="settings_controller_type_entries">
<item>None</item>
<item>Digital Controller (Gamepad)</item>
<item>Analog Controller (DualShock)</item>
<item>Analog Joystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_controller_type_values">
<item>None</item>
<item>DigitalController</item>
<item>AnalogController</item>
<item>AnalogJoystick</item>
<item>NeGcon</item>
</string-array>
<string-array name="settings_memory_card_mode_entries">
<item>No Memory Card</item>
@ -265,7 +271,6 @@
<item>Display</item>
<item>Audio</item>
<item>Enhancements</item>
<item>Controllers</item>
<item>Achievements</item>
<item>Advanced</item>
</string-array>

View File

@ -1,7 +1,7 @@
<resources>
<string name="app_name">DuckStation</string>
<string name="action_settings">Settings</string>
<string name="action_controller_mapping">Controller Mapping</string>
<string name="action_controller_mapping">Controller Settings</string>
<string name="title_activity_settings">Settings</string>
<string name="settings_console_region">Console Region</string>
<string name="settings_console_tty_output">Enable TTY Output</string>
@ -167,7 +167,7 @@
<string name="controller_binding_dialog_no_binding"><![CDATA[<No Binding>]]></string>
<string name="controller_binding_dialog_cancel">Cancel</string>
<string name="controller_binding_dialog_clear">Clear</string>
<string name="controller_mapping_activity_title">Controller Mapping</string>
<string name="controller_mapping_activity_title">Controller Settings</string>
<string name="controller_mapping_activity_no_profiles_found">No profiles found.</string>
<string name="controller_mapping_activity_select_input_profile">Select Input Profile</string>
<string name="controller_mapping_activity_failed_to_load_profile">Failed to load profile \'%s\'</string>
@ -267,4 +267,11 @@
<string name="settings_achievements_confirm_logout_title">Confirm Logout</string>
<string name="settings_achievements_confirm_logout_message">After logging out, no more achievements will be unlocked until you log back in again. Achievements already unlocked will not be lost.</string>
<string name="controller_binding_device_for_vibration">Device for Vibration</string>
<string name="controller_settings_tab_settings">Settings</string>
<string name="controller_settings_tab_hotkeys">Hotkeys</string>
<string name="controller_settings_category_button_bindings">Button Bindings</string>
<string name="controller_settings_category_axis_bindings">Axis Bindings</string>
<string name="controller_settings_category_settings">Settings</string>
<string name="controller_settings_category_touchscreen_controller">Touchscreen Controller</string>
<string name="controller_settings_category_memory_cards">Memory Cards</string>
</resources>

View File

@ -14,88 +14,64 @@
~ limitations under the License.
-->
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="Controller1/Type"
app:title="@string/settings_controller_type"
app:entries="@array/settings_controller_type_entries"
app:entryValues="@array/settings_controller_type_values"
app:defaultValue="DigitalController"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="Controller1/TouchscreenControllerView"
app:title="@string/settings_touchscreen_controller_view"
app:entries="@array/settings_touchscreen_controller_view_entries"
app:entryValues="@array/settings_touchscreen_controller_view_values"
app:defaultValue="digital"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<Preference
app:title="@string/settings_controller_mapping"
app:summary="@string/settings_controller_mapping_summary"
app:iconSpaceReserved="false">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="com.github.stenzek.duckstation.ControllerMappingActivity"
android:targetPackage="com.github.stenzek.duckstation" />
</Preference>
<SwitchPreferenceCompat
app:key="Controller1/ForceAnalogOnReset"
app:title="@string/settings_enable_analog_mode_on_reset"
app:summary="@string/settings_summary_enable_analog_mode_on_reset"
app:defaultValue="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/AnalogDPadInDigitalMode"
app:title="@string/settings_use_analog_sticks_for_dpad"
app:summary="@string/settings_summary_use_analog_sticks_for_dpad"
app:defaultValue="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/AutoHideTouchscreenController"
app:title="@string/settings_auto_hide_touchscreen_controller"
app:defaultValue="false"
app:summary="@string/settings_summary_auto_hide_touchscreen_controller"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/HapticFeedback"
app:title="@string/settings_vibrate_on_press"
app:defaultValue="false"
app:summary="@string/settings_summary_vibrate_on_press"
app:iconSpaceReserved="false" />
<PreferenceCategory
app:iconSpaceReserved="false"
app:title="@string/controller_settings_category_touchscreen_controller">
<ListPreference
app:defaultValue="digital"
app:entries="@array/settings_touchscreen_controller_view_entries"
app:entryValues="@array/settings_touchscreen_controller_view_values"
app:iconSpaceReserved="false"
app:key="Controller1/TouchscreenControllerView"
app:title="@string/settings_touchscreen_controller_view"
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="Controller1/AutoHideTouchscreenController"
app:summary="@string/settings_summary_auto_hide_touchscreen_controller"
app:title="@string/settings_auto_hide_touchscreen_controller" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="Controller1/TouchGliding"
app:summary="@string/settings_summary_touch_gliding"
app:title="@string/settings_touch_gliding" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="Controller1/HapticFeedback"
app:summary="@string/settings_summary_vibrate_on_press"
app:title="@string/settings_vibrate_on_press" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="Controller1/Vibration"
app:summary="@string/settings_summary_enable_vibration"
app:title="@string/settings_enable_vibration" />
</PreferenceCategory>
<SwitchPreferenceCompat
app:key="Controller1/Vibration"
app:title="@string/settings_enable_vibration"
app:defaultValue="false"
app:summary="@string/settings_summary_enable_vibration"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="Controller1/TouchGliding"
app:title="@string/settings_touch_gliding"
app:defaultValue="false"
app:summary="@string/settings_summary_touch_gliding"
app:iconSpaceReserved="false" />
<ListPreference
app:key="MemoryCards/Card1Type"
app:title="@string/settings_memory_card_1_type"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:defaultValue="PerGameTitle"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="MemoryCards/Card2Type"
app:title="@string/settings_memory_card_2_type"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:defaultValue="None"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<PreferenceCategory
app:iconSpaceReserved="false"
app:title="@string/controller_settings_category_memory_cards">
<ListPreference
app:defaultValue="PerGameTitle"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:iconSpaceReserved="false"
app:key="MemoryCards/Card1Type"
app:title="@string/settings_memory_card_1_type"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="None"
app:entries="@array/settings_memory_card_mode_entries"
app:entryValues="@array/settings_memory_card_mode_values"
app:iconSpaceReserved="false"
app:key="MemoryCards/Card2Type"
app:title="@string/settings_memory_card_2_type"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
</PreferenceScreen>