Skip to content

Commit

Permalink
Merge pull request #5339 from mahdihijazi/fix_edit_controls_layout
Browse files Browse the repository at this point in the history
[Android] Fix edit controls layout
  • Loading branch information
degasus committed Apr 30, 2017
2 parents f0a89f8 + ff475a2 commit 7216954
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Expand Up @@ -468,7 +468,11 @@ public boolean onCreateOptionsMenu(Menu menu)
@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;
}

Expand Down
Expand Up @@ -62,6 +62,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
@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);
}
}
}
Expand Up @@ -54,7 +54,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
@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)
Expand Down
Expand Up @@ -62,6 +62,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
@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);
}
}
}

0 comments on commit 7216954

Please sign in to comment.