hierarchical: Back button to go back in drilldown menu
This patch makes it so that when a hierarchical menu is in drilldown
mode, pressing the back button navigates the menu to the previous list
instead of dismissing the menu. If the menu is at the first page, it
still dismisses the menu.
ESC key behavior is unchanged, and immediately dismisses the menu
regardless of the menu page.
To do this, we register a runnable that calls
`HierarchicalMenuController#handleBackPress()` to
`OnBackInvokedDispatcher`. We also now store the `backRunnable` in a
stack so that we can call the latest one at will instead of having to
simulate a click on the back header.
Demo: http://screencast/cast/NTEyMjQxMTY2MDgzNjg2NHwxMDY5ZjRkMy0zNw
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PTAL~!
I will ask someone else for stamp after your review, maybe Wenyu :)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think we should use BackPressHandler; here are some code references -
new OnBackPressedCallback(true) {This will leak. Make sure you store it and then clean it up later.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think we should use BackPressHandler; here are some code references -
Thank you for the pointer, I had completely missed this. Now we implement `BackPressHandler`
This will leak. Make sure you store it and then clean it up later.
Good catch!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |