De-parent custom content view before adding to custom content screen
Bug: 11666352 Change-Id: Ief35e6e8a16ec0217e0dd27434723ee7a7d5beef
This commit is contained in:
@@ -619,6 +619,12 @@ public class Workspace extends SmoothPagedView
|
|||||||
if (customContent instanceof Insettable) {
|
if (customContent instanceof Insettable) {
|
||||||
((Insettable)customContent).setInsets(mInsets);
|
((Insettable)customContent).setInsets(mInsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify that the child is removed from any existing parent.
|
||||||
|
if (customContent.getParent() instanceof ViewGroup) {
|
||||||
|
ViewGroup parent = (ViewGroup) customContent.getParent();
|
||||||
|
parent.removeView(customContent);
|
||||||
|
}
|
||||||
customScreen.removeAllViews();
|
customScreen.removeAllViews();
|
||||||
customScreen.addViewToCellLayout(customContent, 0, 0, lp, true);
|
customScreen.addViewToCellLayout(customContent, 0, 0, lp, true);
|
||||||
mCustomContentDescription = description;
|
mCustomContentDescription = description;
|
||||||
|
|||||||
Reference in New Issue
Block a user