Files
odfstudio/android/source
Michael Weghorn 8d015346d0 android: Have a single method for menu item (de)activation
Instead of having one method that enables/disables a menu
item and one that shows/hides it, let
ToolbarController.setItemVisible take care of both.
Use that method also where ToolbarController.enableMenuItem
was used before and drop that now unused method.

The way that hiding/disabling menu items was and is used
is to do that when they are not applicable, in which case
it seems reasonable to consistently both hide and disable
them at the same time.

Quoting from the MenuItem.setVisible doc [1]:

> Sets the visibility of the menu item. Even if a menu item is not
> visible, it may still be invoked via its shortcut (to completely disable
> an item, set it to invisible and disabled).

[1] https://developer.android.com/reference/android/view/MenuItem#setVisible(boolean)

Change-Id: I5d05f5324a1fb5c69e38302b59b2ad56a45342ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194533
Tested-by: Jenkins
Code-Style: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2025-11-26 06:27:04 +01:00
..