Bug 985400 - Post menu changes to UIThread to avoid issues with animatinos. r=lucasr

This commit is contained in:
Wes Johnston 2014-04-08 12:14:40 -07:00
parent b09904cfcc
commit 7bfd5c5542

View File

@ -362,15 +362,21 @@ public abstract class GeckoApp
}
@Override
public void showMenu(View menu) {
// Hide the menu before we reshow it to avoid platform specific bugs like
// bug 794581 and bug 968182.
public void showMenu(final View menu) {
// On devices using the custom menu, focus is cleared from the menu when its tapped.
// Close and then reshow it to avoid these issues. See bug 794581 and bug 968182.
closeMenu();
mMenuPanel.removeAllViews();
mMenuPanel.addView(menu);
openOptionsMenu();
// Post the reshow code back to the UI thread to avoid some optimizations Android
// has put in place for menus that hide/show themselves quickly. See bug 985400.
ThreadUtils.postToUiThread(new Runnable() {
@Override
public void run() {
mMenuPanel.removeAllViews();
mMenuPanel.addView(menu);
openOptionsMenu();
}
});
}
@Override