Search in sources :

Example 1 with ToolbarDescribing

use of com.faltenreich.diaguard.feature.navigation.ToolbarDescribing in project Diaguard by Faltenreich.

the class BaseFragment method onCreateOptionsMenu.

@Override
public void onCreateOptionsMenu(Menu menu, @NonNull MenuInflater inflater) {
    menu.clear();
    if (this instanceof ToolbarDescribing) {
        try {
            ToolbarDescribing describing = (ToolbarDescribing) this;
            int menuResId = describing.getToolbarProperties().getMenuResId();
            inflater.inflate(menuResId, menu);
        } catch (Resources.NotFoundException ignored) {
        }
    }
    super.onCreateOptionsMenu(menu, inflater);
}
Also used : ToolbarDescribing(com.faltenreich.diaguard.feature.navigation.ToolbarDescribing) Resources(android.content.res.Resources)

Aggregations

Resources (android.content.res.Resources)1 ToolbarDescribing (com.faltenreich.diaguard.feature.navigation.ToolbarDescribing)1