Status Update
Comments
ap...@google.com <ap...@google.com> #2
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
to...@yahoo.com <to...@yahoo.com> #4
urm... that's not a proper fix?
Please may I remind you about the contract for onPrepareMenu: called when the menu is first shown
But in your code, you now simply call onPrepareMenu during the onCreateMenu phase.
I realise that Toolbar did/does not implement onPrepareMenu properly up to now, but it never promised to do, so that was ok up to now.
However, if you're adding support for MenuProvider (thank you!) then it has to be implemented such that it's contract is fulfilled. Right now, the contract of the MenuProvider is broken in Toolbar.
gr...@gmail.com <gr...@gmail.com> #5
Hello. Why do you write than the contract for onPrepareMenu
is "called when the menu is first shown"?
From documentation:
Called by the MenuHost right before the Menu is shown. This should be called when the menu has been dynamically updated.
There aren't mentions about first showing. For example ComponentActivity
implementation of MenuHost
call onPrepareMenu
before every show of menu. And, imho, this behaviour makes much more sense.
For now Toolbar
implementation is inconsistent and misleading.
to...@yahoo.com <to...@yahoo.com> #6
#5 : badly worded I guess (been a while)
but it's been fixed properly now in
gr...@gmail.com <gr...@gmail.com> #7
Great, thanks for answer!
Description
Now that the
MenuProvider
interface contains the optionalonPrepareMenu()
API to maintain 1:1 compatibility, we want to make sure thatToolbar
'sMenuHostHelper
utilizes this API in case developers choose to implement it when adding aMenuProvider
.