Merge changes from topic "am-bff10332-1442-4951-99d1-cf3964693329" into ub-launcher3-master
* changes:
[automerger] Add padding between hotseat and insets in multiwindow landscape am: 1eeffbee01
Add padding between hotseat and insets in multiwindow landscape
This commit is contained in:
commit
977905f680
|
@ -185,7 +185,7 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
|
||||||
if (dp.isVerticalBarLayout()) {
|
if (dp.isVerticalBarLayout()) {
|
||||||
Rect targetInsets = dp.getInsets();
|
Rect targetInsets = dp.getInsets();
|
||||||
int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
|
int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
|
||||||
return dp.hotseatBarSizePx + dp.hotseatBarSidePaddingPx + hotseatInset;
|
return dp.hotseatBarSizePx + hotseatInset;
|
||||||
} else {
|
} else {
|
||||||
int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
|
int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
|
||||||
// Track slightly below the top of the shelf (between top and content).
|
// Track slightly below the top of the shelf (between top and content).
|
||||||
|
@ -448,7 +448,7 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
|
||||||
if (dp.isVerticalBarLayout()) {
|
if (dp.isVerticalBarLayout()) {
|
||||||
Rect targetInsets = dp.getInsets();
|
Rect targetInsets = dp.getInsets();
|
||||||
int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
|
int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
|
||||||
return dp.hotseatBarSizePx + dp.hotseatBarSidePaddingPx + hotseatInset;
|
return dp.hotseatBarSizePx + hotseatInset;
|
||||||
} else {
|
} else {
|
||||||
return dp.heightPx - outRect.rect.bottom;
|
return dp.heightPx - outRect.rect.bottom;
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,9 @@ public class DeviceProfile {
|
||||||
public int hotseatBarSizePx;
|
public int hotseatBarSizePx;
|
||||||
public final int hotseatBarTopPaddingPx;
|
public final int hotseatBarTopPaddingPx;
|
||||||
public final int hotseatBarBottomPaddingPx;
|
public final int hotseatBarBottomPaddingPx;
|
||||||
public final int hotseatBarSidePaddingPx;
|
// Start is the side next to the nav bar, end is the side next to the workspace
|
||||||
|
public final int hotseatBarSidePaddingStartPx;
|
||||||
|
public final int hotseatBarSidePaddingEndPx;
|
||||||
|
|
||||||
// All apps
|
// All apps
|
||||||
public int allAppsCellHeightPx;
|
public int allAppsCellHeightPx;
|
||||||
|
@ -178,10 +180,14 @@ public class DeviceProfile {
|
||||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding);
|
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding);
|
||||||
hotseatBarBottomPaddingPx =
|
hotseatBarBottomPaddingPx =
|
||||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding);
|
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding);
|
||||||
hotseatBarSidePaddingPx =
|
hotseatBarSidePaddingEndPx =
|
||||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_side_padding);
|
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_side_padding);
|
||||||
|
// Add a bit of space between nav bar and hotseat in multi-window vertical bar layout.
|
||||||
|
hotseatBarSidePaddingStartPx = isMultiWindowMode && isVerticalBarLayout()
|
||||||
|
? edgeMarginPx : 0;
|
||||||
hotseatBarSizePx = isVerticalBarLayout()
|
hotseatBarSizePx = isVerticalBarLayout()
|
||||||
? Utilities.pxFromDp(inv.iconSize, dm)
|
? Utilities.pxFromDp(inv.iconSize, dm) + hotseatBarSidePaddingStartPx
|
||||||
|
+ hotseatBarSidePaddingEndPx
|
||||||
: res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_size)
|
: res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_size)
|
||||||
+ hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx;
|
+ hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx;
|
||||||
|
|
||||||
|
@ -326,7 +332,8 @@ public class DeviceProfile {
|
||||||
|
|
||||||
// Hotseat
|
// Hotseat
|
||||||
if (isVerticalLayout) {
|
if (isVerticalLayout) {
|
||||||
hotseatBarSizePx = iconSizePx;
|
hotseatBarSizePx = iconSizePx + hotseatBarSidePaddingStartPx
|
||||||
|
+ hotseatBarSidePaddingEndPx;
|
||||||
}
|
}
|
||||||
hotseatCellHeightPx = iconSizePx;
|
hotseatCellHeightPx = iconSizePx;
|
||||||
|
|
||||||
|
@ -425,14 +432,12 @@ public class DeviceProfile {
|
||||||
if (isVerticalBarLayout()) {
|
if (isVerticalBarLayout()) {
|
||||||
padding.top = 0;
|
padding.top = 0;
|
||||||
padding.bottom = edgeMarginPx;
|
padding.bottom = edgeMarginPx;
|
||||||
padding.left = hotseatBarSidePaddingPx;
|
|
||||||
padding.right = hotseatBarSidePaddingPx;
|
|
||||||
if (isSeascape()) {
|
if (isSeascape()) {
|
||||||
padding.left += hotseatBarSizePx;
|
padding.left = hotseatBarSizePx;
|
||||||
padding.right += verticalDragHandleSizePx;
|
padding.right = verticalDragHandleSizePx;
|
||||||
} else {
|
} else {
|
||||||
padding.left += verticalDragHandleSizePx;
|
padding.left = verticalDragHandleSizePx;
|
||||||
padding.right += hotseatBarSizePx;
|
padding.right = hotseatBarSizePx;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int paddingBottom = hotseatBarSizePx + verticalDragHandleSizePx;
|
int paddingBottom = hotseatBarSizePx + verticalDragHandleSizePx;
|
||||||
|
@ -462,11 +467,11 @@ public class DeviceProfile {
|
||||||
public Rect getHotseatLayoutPadding() {
|
public Rect getHotseatLayoutPadding() {
|
||||||
if (isVerticalBarLayout()) {
|
if (isVerticalBarLayout()) {
|
||||||
if (isSeascape()) {
|
if (isSeascape()) {
|
||||||
mHotseatPadding.set(
|
mHotseatPadding.set(mInsets.left + hotseatBarSidePaddingStartPx,
|
||||||
mInsets.left, mInsets.top, hotseatBarSidePaddingPx, mInsets.bottom);
|
mInsets.top, hotseatBarSidePaddingEndPx, mInsets.bottom);
|
||||||
} else {
|
} else {
|
||||||
mHotseatPadding.set(
|
mHotseatPadding.set(hotseatBarSidePaddingEndPx, mInsets.top,
|
||||||
hotseatBarSidePaddingPx, mInsets.top, mInsets.right, mInsets.bottom);
|
mInsets.right + hotseatBarSidePaddingStartPx, mInsets.bottom);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -157,10 +157,10 @@ public class Hotseat extends FrameLayout implements LogContainerProvider, Insett
|
||||||
lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
if (grid.isSeascape()) {
|
if (grid.isSeascape()) {
|
||||||
lp.gravity = Gravity.LEFT;
|
lp.gravity = Gravity.LEFT;
|
||||||
lp.width = grid.hotseatBarSizePx + insets.left + grid.hotseatBarSidePaddingPx;
|
lp.width = grid.hotseatBarSizePx + insets.left;
|
||||||
} else {
|
} else {
|
||||||
lp.gravity = Gravity.RIGHT;
|
lp.gravity = Gravity.RIGHT;
|
||||||
lp.width = grid.hotseatBarSizePx + insets.right + grid.hotseatBarSidePaddingPx;
|
lp.width = grid.hotseatBarSizePx + insets.right;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lp.gravity = Gravity.BOTTOM;
|
lp.gravity = Gravity.BOTTOM;
|
||||||
|
|
|
@ -266,11 +266,7 @@ public abstract class ArrowPopup extends AbstractFloatingView {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insets are added later, so subtract them now.
|
// Insets are added later, so subtract them now.
|
||||||
if (mIsRtl) {
|
|
||||||
x += insets.right;
|
|
||||||
} else {
|
|
||||||
x -= insets.left;
|
x -= insets.left;
|
||||||
}
|
|
||||||
y -= insets.top;
|
y -= insets.top;
|
||||||
|
|
||||||
mGravity = 0;
|
mGravity = 0;
|
||||||
|
|
Loading…
Reference in New Issue