Android: Don't include autofire settings without controller set

This commit is contained in:
Connor McLaughlin 2021-06-01 22:33:05 +10:00
parent 584427e33c
commit b2447e2270
1 changed files with 25 additions and 23 deletions

View File

@ -323,6 +323,7 @@ public class ControllerSettingsCollectionFragment extends Fragment {
R.string.settings_use_analog_sticks_for_dpad, R.string.settings_summary_use_analog_sticks_for_dpad, true));
}
if (buttonNames != null) {
for (int autoFireSlot = 1; autoFireSlot <= NUM_AUTO_FIRE_BUTTONS; autoFireSlot++) {
final ListPreference autoFirePreference = new ListPreference(getContext());
autoFirePreference.setEntries(buttonNames);
@ -350,6 +351,7 @@ public class ControllerSettingsCollectionFragment extends Fragment {
mAutoFireBindingsCategory.addPreference(bindingPreference);
}
}
}
private void removePreferences() {
for (int i = 0; i < mButtonsCategory.getPreferenceCount(); i++) {