Merge "Remove some unused hotseat/qsb scaling code" into sc-dev

This commit is contained in:
TreeHugger Robot authored and Android (Google) Code Review committed 2021-03-24 00:16:01 +00:00
commit b9d201a5d6
7 files changed
+7 -66

No files matched your search

@@ -81,20 +81,6 @@ public class BackgroundAppState extends OverviewState {
return false;
}
@Override
public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) {
if ((getVisibleElements(launcher) & HOTSEAT_ICONS) != 0) {
// Translate hotseat offscreen if we show it in overview.
RecentsView recentsView = launcher.getOverviewPanel();
ScaleAndTranslation scaleAndTranslation = super.getHotseatScaleAndTranslation(launcher);
scaleAndTranslation.translationY += LayoutUtils.getShelfTrackingDistance(launcher,
launcher.getDeviceProfile(),
recentsView.getPagedOrientationHandler());
return scaleAndTranslation;
}
return super.getHotseatScaleAndTranslation(launcher);
}
@Override
protected float getDepthUnchecked(Context context) {
return 1f;
@@ -77,40 +77,11 @@ public class OverviewState extends LauncherState {
return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
}
@Override
public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) {
if ((getVisibleElements(launcher) & HOTSEAT_ICONS) != 0) {
DeviceProfile dp = launcher.getDeviceProfile();
if (dp.allAppsIconSizePx >= dp.iconSizePx) {
return new ScaleAndTranslation(1, 0, 0);
} else {
float scale = ((float) dp.allAppsIconSizePx) / dp.iconSizePx;
// Distance between the screen center (which is the pivotY for hotseat) and the
// bottom of the hotseat (which we want to preserve)
float distanceFromBottom = dp.heightPx / 2 - dp.hotseatBarBottomPaddingPx;
// On scaling, the bottom edge is moved closer to the pivotY. We move the
// hotseat back down so that the bottom edge's position is preserved.
float translationY = distanceFromBottom * (1 - scale);
return new ScaleAndTranslation(scale, 0, translationY);
}
}
return getWorkspaceScaleAndTranslation(launcher);
}
@Override
public float[] getOverviewScaleAndOffset(Launcher launcher) {
return new float[] {NO_SCALE, NO_OFFSET};
}
@Override
public ScaleAndTranslation getQsbScaleAndTranslation(Launcher launcher) {
if (this == OVERVIEW) {
// Treat the QSB as part of the hotseat so they move together.
return getHotseatScaleAndTranslation(launcher);
}
return super.getQsbScaleAndTranslation(launcher);
}
@Override
public PageAlphaProvider getWorkspacePageAlphaProvider(Launcher launcher) {
return new PageAlphaProvider(DEACCEL_2) {