Set Manage button click listener using postDelayed

Bug: 223901921
Test: manual
Change-Id: If4db2a7872ead26cfd02a3e8f5f752cb6f111503
This commit is contained in:
Sergey Serokurov
2022-03-18 09:54:58 -07:00
parent fe5ac369f9
commit 7fcda60a99

View File

@@ -2795,7 +2795,14 @@ public class BubbleStackView extends FrameLayout
mExpandedViewContainer.setVisibility(View.INVISIBLE);
mExpandedViewContainer.setAlpha(0f);
mExpandedViewContainer.addView(bev);
bev.setManageClickListener((view) -> showManageMenu(!mShowingManage));
postDelayed(() -> {
// Set the Manage button click handler from postDelayed. This appears to resolve
// a race condition with adding the BubbleExpandedView view to the expanded view
// container. Due to the race condition the click handler sometimes is not set up
// correctly and is never called.
bev.setManageClickListener((view) -> showManageMenu(true /* show */));
}, 0);
if (!mIsExpansionAnimating) {
mSurfaceSynchronizer.syncSurfaceAndRun(() -> {