Add system window inset support to DragLayer and children.
Instead of fitting system windows as before, DragLayer now lays out under the system windows. DragLayer will simply add the system window insets to each child's layout margins by default. e.g. for Hotseat, Page Indicators, QSB, Search Overlay. Children that want to use the full viewport can declare so by implementing a new Insettable interface. System window insets will be passed to Insettable#setInsets(insets) and the child can do what it wants with them. Currently, two of DragLayer's children implement Insettable: 1) Workspace (for the -1 screen). Full screen pages are given the entire viewport, paged view offsets modified to end up in the right place now that the viewport is larger (the full screen height). Non-full screen pages like the normal icon pages simply apply the insets to end up in the same place they did before. NowClientCardsView uses the full viewport, applying the insets as padding. Will want to better take advantage of this new real estate in a future CL. 2) All Apps (AppsCustomizeTabHost). Applies the insets as layout margin one level down, so that the bar area is opaque during the transition, but visually the content lands in the same place. (Also add db_files to .gitignore to ignore the output of the db tool) Bug:10687177 Bug:10652189 Change-Id: I80b25d63884d244fcf704b24dad9497ee0d8b453
This commit is contained in:
1 parent
5f92956617
commit
77e1f47520
8 files changed
+79
-10
No files matched your search
@@ -71,7 +71,8 @@ import java.util.Iterator;
|
||||
*/
|
||||
public class Workspace extends SmoothPagedView
|
||||
implements DropTarget, DragSource, DragScroller, View.OnTouchListener,
|
||||
DragController.DragListener, LauncherTransitionable, ViewGroup.OnHierarchyChangeListener {
|
||||
DragController.DragListener, LauncherTransitionable, ViewGroup.OnHierarchyChangeListener,
|
||||
Insettable {
|
||||
private static final String TAG = "Launcher.Workspace";
|
||||
|
||||
// Y rotation to apply to the workspace screens
|
||||
@@ -318,6 +319,11 @@ public class Workspace extends SmoothPagedView
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInsets(Rect insets) {
|
||||
mInsets.set(insets);
|
||||
}
|
||||
|
||||
// estimate the size of a widget with spans hSpan, vSpan. return MAX_VALUE for each
|
||||
// dimension if unsuccessful
|
||||
public int[] estimateItemSize(int hSpan, int vSpan,
|
||||
@@ -525,6 +531,9 @@ public class Workspace extends SmoothPagedView
|
||||
CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, spanX, spanY);
|
||||
lp.canReorder = false;
|
||||
lp.isFullscreen = true;
|
||||
if (customContent instanceof Insettable) {
|
||||
((Insettable)customContent).setInsets(mInsets);
|
||||
}
|
||||
customScreen.addViewToCellLayout(customContent, 0, 0, lp, true);
|
||||
|
||||
mCustomContentCallbacks = callbacks;
|
||||
|
||||
Reference in new issue
Block a user