Only populate activity view when we're showing it
Follow up comments from ag/6274141
Test: manual - expand and collapse some activity view based bubbles
atest BubbleTestController
Bug: 123543995
Change-Id: I9024f074bdf91e9d2955bdb1007fb55c48e35c21
This commit is contained in:
@@ -107,8 +107,10 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
|
||||
private ActivityView.StateCallback mStateCallback = new ActivityView.StateCallback() {
|
||||
@Override
|
||||
public void onActivityViewReady(ActivityView view) {
|
||||
mActivityViewReady = true;
|
||||
mActivityView.startActivity(mBubbleIntent);
|
||||
if (!mActivityViewReady) {
|
||||
mActivityViewReady = true;
|
||||
mActivityView.startActivity(mBubbleIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -262,6 +264,12 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
|
||||
updateHeaderView();
|
||||
updatePermissionView();
|
||||
updateExpandedView();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets activity view know it should be shown / populated.
|
||||
*/
|
||||
public void populateActivityView() {
|
||||
mActivityView.setCallback(mStateCallback);
|
||||
}
|
||||
|
||||
|
||||
@@ -707,6 +707,7 @@ public class BubbleStackView extends FrameLayout implements BubbleTouchHandler.F
|
||||
mExpandedViewContainer.removeAllViews();
|
||||
if (mExpandedBubble != null && mIsExpanded) {
|
||||
mExpandedViewContainer.addView(mExpandedBubble.expandedView);
|
||||
mExpandedBubble.expandedView.populateActivityView();
|
||||
mExpandedViewContainer.setVisibility(mIsExpanded ? VISIBLE : GONE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user