[Android] Fix edit controls layout
Not checking the none existing key in the buttonsActionsMap leads to break the sub menu of the configure controls menu on Android phones.
This commit is contained in:
parent
ecf5f7d5f4
commit
ff475a2c02
|
@ -468,7 +468,11 @@ public final class EmulationActivity extends AppCompatActivity
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item)
|
||||
{
|
||||
handleMenuAction(buttonsActionsMap.get(item.getItemId()));
|
||||
int action = buttonsActionsMap.get(item.getItemId(), -1);
|
||||
if (action >= 0)
|
||||
{
|
||||
handleMenuAction(action);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,6 +62,10 @@ public final class LoadStateFragment extends Fragment implements View.OnClickLis
|
|||
@Override
|
||||
public void onClick(View button)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId()));
|
||||
int action = buttonsActionsMap.get(button.getId(), -1);
|
||||
if (action >= 0)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,11 @@ public final class MenuFragment extends Fragment implements View.OnClickListener
|
|||
@Override
|
||||
public void onClick(View button)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId()));
|
||||
int action = buttonsActionsMap.get(button.getId());
|
||||
if (action >= 0)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTitleText(String title)
|
||||
|
|
|
@ -62,6 +62,10 @@ public final class SaveStateFragment extends Fragment implements View.OnClickLis
|
|||
@Override
|
||||
public void onClick(View button)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(buttonsActionsMap.get(button.getId()));
|
||||
int action = buttonsActionsMap.get(button.getId(), -1);
|
||||
if (action >= 0)
|
||||
{
|
||||
((EmulationActivity) getActivity()).handleMenuAction(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue