Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +4 −3 Original line number Diff line number Diff line Loading @@ -372,6 +372,7 @@ public class BubbleExpandedView extends LinearLayout { // ==> activity view // ==> manage button bringChildToFront(mManageButton); setManageClickListener(); applyThemeAttrs(); Loading Loading @@ -502,6 +503,7 @@ public class BubbleExpandedView extends LinearLayout { R.layout.bubble_manage_button, this /* parent */, false /* attach */); addView(mManageButton); mManageButton.setVisibility(visibility); setManageClickListener(); post(() -> { int touchAreaHeight = getResources().getDimensionPixelSize( Loading Loading @@ -646,9 +648,8 @@ public class BubbleExpandedView extends LinearLayout { } } // TODO: Could listener be passed when we pass StackView / can we avoid setting this like this void setManageClickListener(OnClickListener manageClickListener) { mManageButton.setOnClickListener(manageClickListener); private void setManageClickListener() { mManageButton.setOnClickListener(v -> mStackView.onManageBubbleClicked()); } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +2 −16 Original line number Diff line number Diff line Loading @@ -1374,7 +1374,6 @@ public class BubbleStackView extends FrameLayout // The menu itself should respect locale direction so the icons are on the correct side. mManageMenu.setLayoutDirection(LAYOUT_DIRECTION_LOCALE); addView(mManageMenu); updateManageButtonListener(); } /** Loading Loading @@ -3375,14 +3374,6 @@ public class BubbleStackView extends FrameLayout mExpandedViewContainer.setAlpha(0f); mExpandedViewContainer.addView(bev); 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. updateManageButtonListener(); }, 0); if (!mIsExpansionAnimating) { mIsBubbleSwitchAnimating = true; mSurfaceSynchronizer.syncSurfaceAndRun(() -> { Loading @@ -3392,13 +3383,8 @@ public class BubbleStackView extends FrameLayout } } private void updateManageButtonListener() { BubbleExpandedView bev = getExpandedView(); if (mIsExpanded && bev != null) { bev.setManageClickListener((view) -> { void onManageBubbleClicked() { showManageMenu(true /* show */); }); } } /** Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java +4 −3 Original line number Diff line number Diff line Loading @@ -372,6 +372,7 @@ public class BubbleExpandedView extends LinearLayout { // ==> activity view // ==> manage button bringChildToFront(mManageButton); setManageClickListener(); applyThemeAttrs(); Loading Loading @@ -502,6 +503,7 @@ public class BubbleExpandedView extends LinearLayout { R.layout.bubble_manage_button, this /* parent */, false /* attach */); addView(mManageButton); mManageButton.setVisibility(visibility); setManageClickListener(); post(() -> { int touchAreaHeight = getResources().getDimensionPixelSize( Loading Loading @@ -646,9 +648,8 @@ public class BubbleExpandedView extends LinearLayout { } } // TODO: Could listener be passed when we pass StackView / can we avoid setting this like this void setManageClickListener(OnClickListener manageClickListener) { mManageButton.setOnClickListener(manageClickListener); private void setManageClickListener() { mManageButton.setOnClickListener(v -> mStackView.onManageBubbleClicked()); } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +2 −16 Original line number Diff line number Diff line Loading @@ -1374,7 +1374,6 @@ public class BubbleStackView extends FrameLayout // The menu itself should respect locale direction so the icons are on the correct side. mManageMenu.setLayoutDirection(LAYOUT_DIRECTION_LOCALE); addView(mManageMenu); updateManageButtonListener(); } /** Loading Loading @@ -3375,14 +3374,6 @@ public class BubbleStackView extends FrameLayout mExpandedViewContainer.setAlpha(0f); mExpandedViewContainer.addView(bev); 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. updateManageButtonListener(); }, 0); if (!mIsExpansionAnimating) { mIsBubbleSwitchAnimating = true; mSurfaceSynchronizer.syncSurfaceAndRun(() -> { Loading @@ -3392,13 +3383,8 @@ public class BubbleStackView extends FrameLayout } } private void updateManageButtonListener() { BubbleExpandedView bev = getExpandedView(); if (mIsExpanded && bev != null) { bev.setManageClickListener((view) -> { void onManageBubbleClicked() { showManageMenu(true /* show */); }); } } /** Loading