Fixed
Status Update
Comments
ow...@google.com <ow...@google.com>
al...@google.com <al...@google.com>
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
to...@yahoo.com <to...@yahoo.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 723f2ef10ea1de61e94de16b917cc6e939bfc211
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Aug 02 17:05:42 2022
Fix Toolbar onPrepareMenu timing with MenuHost
Instead of unconditionally calling onPrepareMenu() when Toolbar executes
onCreateMenu(), it should wait until the menu is about to be shown to
make the call.
This will ensure that Toolbar properly fulfills the MenuHost contract.
RelNote: "Toolbar will now call `onPrepareMenu()` before the menu is shown
instead of unconditionally when the menu is created."
Test: modified the ToolbarMenuHostTest
Bug: 232206677
Change-Id: I2a58df0064c08b9ae87962a41d87e7bc60073df0
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarMenuHostTest.kt
https://android-review.googlesource.com/2172951
Branch: androidx-main
commit 723f2ef10ea1de61e94de16b917cc6e939bfc211
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Aug 02 17:05:42 2022
Fix Toolbar onPrepareMenu timing with MenuHost
Instead of unconditionally calling onPrepareMenu() when Toolbar executes
onCreateMenu(), it should wait until the menu is about to be shown to
make the call.
This will ensure that Toolbar properly fulfills the MenuHost contract.
RelNote: "Toolbar will now call `onPrepareMenu()` before the menu is shown
instead of unconditionally when the menu is created."
Test: modified the ToolbarMenuHostTest
Bug: 232206677
Change-Id: I2a58df0064c08b9ae87962a41d87e7bc60073df0
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarMenuHostTest.kt
jb...@google.com <jb...@google.com> #5
This has been fixed internally and will be available in the AppCompat 1.6.0-beta01
release.
ju...@gmail.com <ju...@gmail.com> #6
Me hakearon y me robaron mi privacidad eyos se encuentran en amarillo tz
yu...@gmail.com <yu...@gmail.com> #7
Delete all old
Description
Please see https://issuetracker.google.com/227376894
and the earlier related issue(s)
This needs to be re-opened as the fix mentioned in
is itself introducing a new bug; please the source code for that 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.