Merge "Update all home screen widgets size upon workspace inset change" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4c96d446a5
@@ -329,6 +329,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
}
|
||||
|
||||
updateWorkspaceScreensPadding();
|
||||
updateWorkspaceWidgetsSizes();
|
||||
}
|
||||
|
||||
private void updateWorkspaceScreensPadding() {
|
||||
@@ -360,6 +361,25 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWorkspaceWidgetsSizes() {
|
||||
int numberOfScreens = mScreenOrder.size();
|
||||
for (int i = 0; i < numberOfScreens; i++) {
|
||||
ShortcutAndWidgetContainer shortcutAndWidgetContainer =
|
||||
mWorkspaceScreens.get(mScreenOrder.get(i)).getShortcutsAndWidgets();
|
||||
int shortcutsAndWidgetCount = shortcutAndWidgetContainer.getChildCount();
|
||||
for (int j = 0; j < shortcutsAndWidgetCount; j++) {
|
||||
View view = shortcutAndWidgetContainer.getChildAt(j);
|
||||
if (view instanceof LauncherAppWidgetHostView
|
||||
&& view.getTag() instanceof LauncherAppWidgetInfo) {
|
||||
LauncherAppWidgetInfo launcherAppWidgetInfo =
|
||||
(LauncherAppWidgetInfo) view.getTag();
|
||||
WidgetSizes.updateWidgetSizeRanges((LauncherAppWidgetHostView) view,
|
||||
mLauncher, launcherAppWidgetInfo.spanX, launcherAppWidgetInfo.spanY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Estimates the size of an item using spans: hSpan, vSpan.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user