Update custom content insets when Workspace insets are set

-> Not sure if custom content can be added before insets are set,
   so this is just a speculative fix.

Bug: 11875171
Change-Id: Ia8e07f51f527f464262b7ff99e4db245fe5a7906
This commit is contained in:
Adam Cohen
2013-11-26 15:45:38 -08:00
parent 166ebd4da5
commit 6400b84d55

View File

@@ -334,6 +334,14 @@ public class Workspace extends SmoothPagedView
@Override
public void setInsets(Rect insets) {
mInsets.set(insets);
CellLayout customScreen = getScreenWithId(CUSTOM_CONTENT_SCREEN_ID);
if (customScreen != null) {
View customContent = customScreen.getShortcutsAndWidgets().getChildAt(0);
if (customContent instanceof Insettable) {
((Insettable) customContent).setInsets(mInsets);
}
}
}
// estimate the size of a widget with spans hSpan, vSpan. return MAX_VALUE for each