mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 985400 - Post menu changes to UIThread to avoid issues with animatinos. r=lucasr
This commit is contained in:
parent
b09904cfcc
commit
7bfd5c5542
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user