Android: Prevent showing mapping dialog with no device selected
This commit is contained in:
parent
a1cc19f443
commit
ea3200d4ba
|
@ -312,6 +312,15 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
|
||||
public void onInputMappingClick(final InputMappingControlSetting item, final int position)
|
||||
{
|
||||
if (item.getController().getDefaultDevice().isEmpty() && !mView.isMappingAllDevices())
|
||||
{
|
||||
new MaterialAlertDialogBuilder(mView.getActivity())
|
||||
.setMessage(R.string.input_binding_no_device)
|
||||
.setPositiveButton(R.string.ok, this)
|
||||
.show();
|
||||
return;
|
||||
}
|
||||
|
||||
final MotionAlertDialog dialog = new MotionAlertDialog(mView.getActivity(), item,
|
||||
mView.isMappingAllDevices());
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
<string name="input_binding">Input Binding</string>
|
||||
<string name="input_binding_description">Press or move an input to bind it to %1$s.</string>
|
||||
<string name="input_binding_no_device">You need to select a device first!</string>
|
||||
|
||||
<!-- Main Preference Fragment -->
|
||||
<string name="settings">Settings</string>
|
||||
|
|
Loading…
Reference in New Issue