summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-07-28 22:54:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-28 22:54:51 +0000
commit687ae8483daad60dc60e884c031d2dd340ac7d4a (patch)
treea3aadd0257f1f6c1b74ca010ae471628965392d3 /src/com/android/launcher3/DeviceProfile.java
parent40e89c1a43daf94ec6495d71c1f0b5933b6c9d47 (diff)
parent946609f0ea70e1361dbe979af0e054d4c18b929b (diff)
downloadandroid_packages_apps_Trebuchet-687ae8483daad60dc60e884c031d2dd340ac7d4a.tar.gz
android_packages_apps_Trebuchet-687ae8483daad60dc60e884c031d2dd340ac7d4a.tar.bz2
android_packages_apps_Trebuchet-687ae8483daad60dc60e884c031d2dd340ac7d4a.zip
am 946609f0: Merge "Fixing overview mode scale calculations." into ub-launcher3-burnaby
* commit '946609f0ea70e1361dbe979af0e054d4c18b929b': Fixing overview mode scale calculations.
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 596611248..6cfdcf70b 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -25,6 +25,7 @@ import android.graphics.Paint.FontMetrics;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.DisplayMetrics;
+import android.util.Size;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
@@ -56,7 +57,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 +136,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 +332,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
@@ -476,7 +467,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 +476,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) {