Merge pull request #5339 from mahdihijazi/fix_edit_controls_layout

[Android] Fix edit controls layout
This commit is contained in:
Markus Wick 2017-04-30 08:46:12 +02:00 committed by GitHub
commit 721695435a
4 changed files with 20 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);
}
}
}

View File

@ -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)

View File

@ -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);
}
}
}