JakeWharton/ActionBarSherlock — pull request #963 by ksperling (2013-06-06 00:00:58+00:00)
Title: Improve handling of popup menus and expose PopupMenu

This should fix #752.

- Work around PopupWindow's leaking of listeners into the ViewRoot VTO
when the anchor view is detached before the popup is dismissed.
- Apply similar changes to MenuPopupHelper. This also means that support for
OnAttachStateChangeListener is not required for correct operation of the
popup window anymore. OnAttachStateChangeListener is still used in case
the popup anchor view is not attached when the popup is shown, even though
this seems unlikely to happen in practice as positioning of the popup is
pretty meaningless in that case. It would be possible to remove the entire
OnAttachStateChangeListener shim as a second step.
- Included PopupMenu from AOSP. I'm aware this has been previously declined as a feature request as technically it's not part of the ActionBar, However, ABS uses popup menus internally and all the plumbing and resources are already in place, so adding this single class to actually expose what's already there saves a lot of duplication and hassle.