Revert "Update drop target button alignment across devices."
This reverts commit 27bfcaa651.
Reason for revert: b/232636570
Bug: 229789612
Bug: 231711806
Bug: 231706480
Bug: 232063941
Bug: 232283628
Change-Id: Ic83515173f4a64228a80f63d75db938243cbf625
This commit is contained in:
@@ -108,7 +108,6 @@ public class DeviceProfile {
|
||||
public float workspaceSpringLoadShrunkTop;
|
||||
public float workspaceSpringLoadShrunkBottom;
|
||||
public final int workspaceSpringLoadedBottomSpace;
|
||||
public final int workspaceSpringLoadedMinNextPageVisiblePx;
|
||||
|
||||
private final int extraSpace;
|
||||
public int workspaceTopPadding;
|
||||
@@ -215,8 +214,6 @@ public class DeviceProfile {
|
||||
public int dropTargetHorizontalPaddingPx;
|
||||
public int dropTargetVerticalPaddingPx;
|
||||
public int dropTargetGapPx;
|
||||
public int dropTargetButtonWorkspaceEdgeGapPx;
|
||||
public int dropTargetButtonScreenEdgeGapPx;
|
||||
|
||||
// Insets
|
||||
private final Rect mInsets = new Rect();
|
||||
@@ -344,15 +341,9 @@ public class DeviceProfile {
|
||||
dropTargetVerticalPaddingPx = res.getDimensionPixelSize(
|
||||
R.dimen.drop_target_button_drawable_vertical_padding);
|
||||
dropTargetGapPx = res.getDimensionPixelSize(R.dimen.drop_target_button_gap);
|
||||
dropTargetButtonWorkspaceEdgeGapPx = res.getDimensionPixelSize(
|
||||
R.dimen.drop_target_button_workspace_edge_gap);
|
||||
dropTargetButtonScreenEdgeGapPx = res.getDimensionPixelSize(
|
||||
R.dimen.drop_target_button_screen_edge_gap);
|
||||
|
||||
workspaceSpringLoadedBottomSpace =
|
||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_min_spring_loaded_space);
|
||||
workspaceSpringLoadedMinNextPageVisiblePx = res.getDimensionPixelSize(
|
||||
R.dimen.dynamic_grid_spring_loaded_min_next_space_visible);
|
||||
|
||||
workspaceCellPaddingXPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_padding_x);
|
||||
|
||||
@@ -508,7 +499,7 @@ public class DeviceProfile {
|
||||
*/
|
||||
private int calculateQsbWidth() {
|
||||
if (isQsbInline) {
|
||||
int columns = getPanelCount() * inv.numColumns;
|
||||
int columns = isTwoPanels ? inv.numColumns * 2 : inv.numColumns;
|
||||
return getIconToIconWidthForColumns(columns)
|
||||
- iconSizePx * numShownHotseatIcons
|
||||
- hotseatBorderSpace * numShownHotseatIcons;
|
||||
@@ -960,6 +951,13 @@ public class DeviceProfile {
|
||||
return workspaceSpringLoadShrunkBottom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the minimum visible amount of the next workspace page when in the spring-loaded state.
|
||||
*/
|
||||
private float getWorkspaceSpringLoadedMinimumNextPageVisible() {
|
||||
return getCellSize().x / 2f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the scale of the workspace for the spring-loaded edit state.
|
||||
*/
|
||||
@@ -971,7 +969,8 @@ public class DeviceProfile {
|
||||
// Reduce scale if next pages would not be visible after scaling the workspace
|
||||
int workspaceWidth = availableWidthPx;
|
||||
float scaledWorkspaceWidth = workspaceWidth * scale;
|
||||
float maxAvailableWidth = workspaceWidth - (2 * workspaceSpringLoadedMinNextPageVisiblePx);
|
||||
float maxAvailableWidth =
|
||||
workspaceWidth - (2 * getWorkspaceSpringLoadedMinimumNextPageVisible());
|
||||
if (scaledWorkspaceWidth > maxAvailableWidth) {
|
||||
scale *= maxAvailableWidth / scaledWorkspaceWidth;
|
||||
}
|
||||
@@ -1410,19 +1409,11 @@ public class DeviceProfile {
|
||||
writer.println(prefix + pxToDpStr("dropTargetBarSizePx", dropTargetBarSizePx));
|
||||
writer.println(
|
||||
prefix + pxToDpStr("dropTargetBarBottomMarginPx", dropTargetBarBottomMarginPx));
|
||||
writer.println(prefix + pxToDpStr("dropTargetButtonWorkspaceEdgeGapPx",
|
||||
dropTargetButtonWorkspaceEdgeGapPx));
|
||||
writer.println(prefix + pxToDpStr("dropTargetButtonScreenEdgeGapPx",
|
||||
dropTargetButtonScreenEdgeGapPx));
|
||||
|
||||
writer.println(
|
||||
prefix + pxToDpStr("workspaceSpringLoadShrunkTop", workspaceSpringLoadShrunkTop));
|
||||
writer.println(prefix + pxToDpStr("workspaceSpringLoadShrunkBottom",
|
||||
workspaceSpringLoadShrunkBottom));
|
||||
writer.println(prefix + pxToDpStr("workspaceSpringLoadedBottomSpace",
|
||||
workspaceSpringLoadedBottomSpace));
|
||||
writer.println(prefix + pxToDpStr("workspaceSpringLoadedMinNextPageVisiblePx",
|
||||
workspaceSpringLoadedMinNextPageVisiblePx));
|
||||
writer.println(
|
||||
prefix + pxToDpStr("getWorkspaceSpringLoadScale()", getWorkspaceSpringLoadScale()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user