bluelinelabs / bluelinelabs/Conductor
Provide a getHasOptionsMenu function
- Dominant language
- Java
- Stars
- 3.9k
- Forks
- 338
- PR merge metrics
- No merged PRs in 30d
Description
I want to use following functions in a derived controller:
@Override
protected void onChangeStarted(@NonNull ControllerChangeHandler changeHandler, @NonNull ControllerChangeType changeType)
{
super.onChangeStarted(changeHandler, changeType);
if (getHasOptionsMenu())
{
if (getRouter().getBackstack().size() > 1 /* keep menu visible when exiting the app */ && changeType == ControllerChangeType.POP_EXIT || changeType == ControllerChangeType.PUSH_EXIT)
setOptionsMenuHidden(true);
else
setOptionsMenuHidden(false);
}
}
@Override
protected void onChangeEnded(@NonNull ControllerChangeHandler changeHandler, @NonNull ControllerChangeType changeType)
{
super.onChangeEnded(changeHandler, changeType);
if (getHasOptionsMenu())
setOptionsMenuHidden(false);
}
I need this, so that the menu is hidden between my animations. Could you add a `getHasOptionsMenu()` function to the controller (protected visibility would be enough) to be able to access the private field? Otherwise I would have to track myself if the menu is enabled in my derived controller (although the default controller only does it) and I want to avoid that...
Contributor guide
Research direction
Start in the controller class that owns the private options-menu state and inspect the existing setOptionsMenuHidden behavior. Add the requested protected getter so derived controllers can read that state, then verify that a derived controller can use it during the change callbacks shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100