Fixed multi pane menu

pull/147/head
M66B 6 years ago
parent ad6711ccb1
commit 617c2cc18e

@ -118,13 +118,22 @@ public class FragmentEx extends Fragment {
super.onDestroy();
}
@Override
public void setHasOptionsMenu(boolean hasMenu) {
super.setHasOptionsMenu(!isPane() && hasMenu);
}
private void updateSubtitle() {
AppCompatActivity activity = (AppCompatActivity) getActivity();
Bundle args = getArguments();
if (activity != null && (args == null || !args.getBoolean("pane"))) {
if (activity != null && !isPane()) {
ActionBar actionbar = activity.getSupportActionBar();
if (actionbar != null)
actionbar.setSubtitle(subtitle);
}
}
private boolean isPane() {
Bundle args = getArguments();
return (args != null && args.getBoolean("pane"));
}
}

Loading…
Cancel
Save