diff options
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 62b05b0d6..774594fe2 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -56,7 +56,6 @@ public class DeviceProfile { private final int overviewModeBarItemWidthPx; private final int overviewModeBarSpacerWidthPx; private final float overviewModeIconZoneRatio; - private final float overviewModeScaleFactor; // Workspace private int desiredWorkspaceLeftRightMarginPx; @@ -136,8 +135,6 @@ public class DeviceProfile { res.getDimensionPixelSize(R.dimen.dynamic_grid_overview_bar_spacer_width); overviewModeIconZoneRatio = res.getInteger(R.integer.config_dynamic_grid_overview_icon_zone_percentage) / 100f; - overviewModeScaleFactor = - res.getInteger(R.integer.config_dynamic_grid_overview_scale_percentage) / 100f; iconDrawablePaddingOriginalPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_icon_drawable_padding); @@ -334,18 +331,11 @@ public class DeviceProfile { } } - Rect getOverviewModeButtonBarRect() { + int getOverviewModeButtonBarHeight() { int zoneHeight = (int) (overviewModeIconZoneRatio * availableHeightPx); zoneHeight = Math.min(overviewModeMaxIconZoneHeightPx, Math.max(overviewModeMinIconZoneHeightPx, zoneHeight)); - return new Rect(0, availableHeightPx - zoneHeight, 0, availableHeightPx); - } - - public float getOverviewModeScale(boolean isLayoutRtl) { - Rect workspacePadding = getWorkspacePadding(isLayoutRtl); - Rect overviewBar = getOverviewModeButtonBarRect(); - int pageSpace = availableHeightPx - workspacePadding.top - workspacePadding.bottom; - return (overviewModeScaleFactor * (pageSpace - overviewBar.height())) / pageSpace; + return zoneHeight; } // The rect returned will be extended to below the system ui that covers the workspace @@ -394,7 +384,7 @@ public class DeviceProfile { final boolean isLayoutRtl = Utilities.isRtl(launcher.getResources()); // Layout the search bar space - View searchBar = launcher.getSearchBar(); + View searchBar = launcher.getSearchDropTargetBar(); lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); if (hasVerticalBarLayout) { // Vertical search bar space -- The search bar is fixed in the layout to be on the left @@ -476,7 +466,7 @@ public class DeviceProfile { // Layout the Overview Mode ViewGroup overviewMode = launcher.getOverviewPanel(); if (overviewMode != null) { - Rect r = getOverviewModeButtonBarRect(); + int overviewButtonBarHeight = getOverviewModeButtonBarHeight(); lp = (FrameLayout.LayoutParams) overviewMode.getLayoutParams(); lp.gravity = Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM; @@ -485,7 +475,7 @@ public class DeviceProfile { int maxWidth = totalItemWidth + (visibleChildCount-1) * overviewModeBarSpacerWidthPx; lp.width = Math.min(availableWidthPx, maxWidth); - lp.height = r.height(); + lp.height = overviewButtonBarHeight; overviewMode.setLayoutParams(lp); if (lp.width > totalItemWidth && visibleChildCount > 1) { |