mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Merge "Update overview actions alignment" into tm-dev
This commit is contained in:
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="overview_actions_top_margin_gesture">19.1dp</dimen>
|
||||
<dimen name="overview_actions_bottom_margin_gesture">10dp</dimen>
|
||||
<dimen name="overview_actions_top_margin">12dp</dimen>
|
||||
<dimen name="overview_grid_side_margin">52dp</dimen>
|
||||
<dimen name="overview_page_spacing">38dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
<dimen name="overview_task_margin">12dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">4dp</dimen>
|
||||
<dimen name="overview_actions_button_spacing">36dp</dimen>
|
||||
<dimen name="overview_actions_top_margin_gesture">19.37dp</dimen>
|
||||
<dimen name="overview_actions_bottom_margin_gesture">22dp</dimen>
|
||||
<dimen name="overview_grid_side_margin">60dp</dimen>
|
||||
<dimen name="overview_grid_row_spacing">36dp</dimen>
|
||||
<dimen name="overview_page_spacing">36dp</dimen>
|
||||
|
||||
@@ -35,13 +35,12 @@
|
||||
<dimen name="overview_task_margin">16dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">0dp</dimen>
|
||||
<item name="overview_max_scale" format="float" type="dimen">0.7</item>
|
||||
<item name="overview_modal_max_scale" format="float" type="dimen">1.1</item>
|
||||
|
||||
<!-- Overrideable in overlay that provides the Overview Actions. -->
|
||||
<dimen name="overview_actions_height">48dp</dimen>
|
||||
<dimen name="overview_actions_button_spacing">32dp</dimen>
|
||||
<dimen name="overview_actions_top_margin_gesture">28dp</dimen>
|
||||
<dimen name="overview_actions_bottom_margin_gesture">28dp</dimen>
|
||||
<dimen name="overview_actions_margin_three_button">8dp</dimen>
|
||||
<dimen name="overview_actions_top_margin">24dp</dimen>
|
||||
<dimen name="overview_actions_horizontal_margin">16dp</dimen>
|
||||
|
||||
<dimen name="overview_page_spacing">16dp</dimen>
|
||||
|
||||
@@ -296,7 +296,7 @@ public abstract class BaseQuickstepLauncher extends Launcher {
|
||||
new SplitSelectStateController(this, mHandler, getStateManager(),
|
||||
getDepthController());
|
||||
overviewPanel.init(mActionsView, controller);
|
||||
mActionsView.setDp(getDeviceProfile());
|
||||
mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
|
||||
mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));
|
||||
|
||||
mAppTransitionManager = new QuickstepTransitionManager(this);
|
||||
|
||||
@@ -19,7 +19,6 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.util.DisplayController.getNavigationMode;
|
||||
import static com.android.quickstep.AbsSwipeUpHandler.RECENTS_ATTACH_DURATION;
|
||||
import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
|
||||
import static com.android.quickstep.util.RecentsAtomicAnimationFactory.INDEX_RECENTS_FADE_ANIM;
|
||||
@@ -62,7 +61,6 @@ import com.android.launcher3.views.ScrimView;
|
||||
import com.android.quickstep.util.ActivityInitListener;
|
||||
import com.android.quickstep.util.AnimatorControllerWithResistance;
|
||||
import com.android.quickstep.util.SplitScreenBounds;
|
||||
import com.android.quickstep.views.OverviewActionsView;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
@@ -224,7 +222,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
Resources res = context.getResources();
|
||||
if (dp.isTablet) {
|
||||
Rect gridRect = new Rect();
|
||||
calculateGridSize(context, dp, gridRect);
|
||||
calculateGridSize(dp, gridRect);
|
||||
|
||||
PointF taskDimension = getTaskDimension(context, dp);
|
||||
float scale = gridRect.height() / taskDimension.y;
|
||||
@@ -238,15 +236,15 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
int taskMargin = dp.overviewTaskMarginPx;
|
||||
calculateTaskSizeInternal(context, dp,
|
||||
dp.overviewTaskThumbnailTopMarginPx,
|
||||
getOverviewActionsHeight(context, dp),
|
||||
dp.getOverviewActionsClaimedSpace(),
|
||||
res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
|
||||
Gravity.CENTER,
|
||||
outRect);
|
||||
}
|
||||
}
|
||||
|
||||
private void calculateTaskSizeInternal(Context context, DeviceProfile dp,
|
||||
int claimedSpaceAbove, int claimedSpaceBelow, int minimumHorizontalPadding,
|
||||
Rect outRect) {
|
||||
private void calculateTaskSizeInternal(Context context, DeviceProfile dp, int claimedSpaceAbove,
|
||||
int claimedSpaceBelow, int minimumHorizontalPadding, int gravity, Rect outRect) {
|
||||
PointF taskDimension = getTaskDimension(context, dp);
|
||||
Rect insets = dp.getInsets();
|
||||
|
||||
@@ -264,7 +262,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
int outWidth = Math.round(scale * taskDimension.x);
|
||||
int outHeight = Math.round(scale * taskDimension.y);
|
||||
|
||||
Gravity.apply(Gravity.CENTER, outWidth, outHeight, potentialTaskRect, outRect);
|
||||
Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
|
||||
}
|
||||
|
||||
private static PointF getTaskDimension(Context context, DeviceProfile dp) {
|
||||
@@ -314,10 +312,10 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
/**
|
||||
* Calculates the overview grid size for the provided device configuration.
|
||||
*/
|
||||
public final void calculateGridSize(Context context, DeviceProfile dp, Rect outRect) {
|
||||
public final void calculateGridSize(DeviceProfile dp, Rect outRect) {
|
||||
Rect insets = dp.getInsets();
|
||||
int topMargin = dp.overviewTaskThumbnailTopMarginPx;
|
||||
int bottomMargin = getOverviewActionsHeight(context, dp);
|
||||
int bottomMargin = dp.getOverviewActionsClaimedSpace();
|
||||
int sideMargin = dp.overviewGridSideMargin;
|
||||
|
||||
outRect.set(0, 0, dp.widthPx, dp.heightPx);
|
||||
@@ -352,21 +350,17 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
* Calculates the modal taskView size for the provided device configuration
|
||||
*/
|
||||
public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect) {
|
||||
calculateTaskSize(context, dp, outRect);
|
||||
float maxScale = context.getResources().getFloat(R.dimen.overview_modal_max_scale);
|
||||
calculateTaskSizeInternal(
|
||||
context, dp,
|
||||
dp.overviewTaskMarginPx,
|
||||
getOverviewActionsHeight(context, dp),
|
||||
dp.overviewTaskMarginPx,
|
||||
dp.heightPx - outRect.bottom - dp.getInsets().bottom,
|
||||
Math.round((dp.availableWidthPx - outRect.width() * maxScale) / 2),
|
||||
Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM,
|
||||
outRect);
|
||||
}
|
||||
|
||||
/** Gets the space that the overview actions will take, including bottom margin. */
|
||||
private int getOverviewActionsHeight(Context context, DeviceProfile dp) {
|
||||
return OverviewActionsView.getOverviewActionsBottomMarginPx(getNavigationMode(context), dp)
|
||||
+ OverviewActionsView.getOverviewActionsTopMarginPx(getNavigationMode(context), dp)
|
||||
+ dp.overviewActionsHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the gesture ends and the animation starts towards the given target. Used to add
|
||||
* an optional additional animation with the same duration.
|
||||
|
||||
@@ -221,6 +221,9 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
|
||||
setOverviewStateEnabled(true);
|
||||
setOverviewGridEnabled(toState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile()));
|
||||
setOverviewFullscreenEnabled(toState.isFullScreen());
|
||||
if (toState == MODAL_TASK) {
|
||||
setOverviewSelectEnabled(true);
|
||||
}
|
||||
Log.d(BAD_STATE, "FRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
|
||||
setFreezeViewVisibility(true);
|
||||
}
|
||||
@@ -236,6 +239,9 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
|
||||
Log.d(BAD_STATE, "FRV onStateTransitionComplete setFreezeVisibility=false, finalState="
|
||||
+ finalState);
|
||||
setFreezeViewVisibility(false);
|
||||
if (finalState != MODAL_TASK) {
|
||||
setOverviewSelectEnabled(false);
|
||||
}
|
||||
|
||||
if (isOverlayEnabled) {
|
||||
runActionOnRemoteHandles(remoteTargetHandle ->
|
||||
|
||||
@@ -100,6 +100,9 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher, Laun
|
||||
setOverviewStateEnabled(toState.overviewUi);
|
||||
setOverviewGridEnabled(toState.displayOverviewTasksAsGrid(mActivity.getDeviceProfile()));
|
||||
setOverviewFullscreenEnabled(toState.getOverviewFullscreenProgress() == 1);
|
||||
if (toState == OVERVIEW_MODAL_TASK) {
|
||||
setOverviewSelectEnabled(true);
|
||||
}
|
||||
Log.d(BAD_STATE, "LRV onStateTransitionStart setFreezeVisibility=true, toState=" + toState);
|
||||
setFreezeViewVisibility(true);
|
||||
}
|
||||
@@ -115,6 +118,9 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher, Laun
|
||||
Log.d(BAD_STATE, "LRV onStateTransitionComplete setFreezeVisibility=false, finalState="
|
||||
+ finalState);
|
||||
setFreezeViewVisibility(false);
|
||||
if (finalState != OVERVIEW_MODAL_TASK) {
|
||||
setOverviewSelectEnabled(false);
|
||||
}
|
||||
|
||||
if (isOverlayEnabled) {
|
||||
runActionOnRemoteHandles(remoteTargetHandle ->
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static com.android.launcher3.util.DisplayController.NavigationMode.THREE_BUTTONS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Rect;
|
||||
@@ -99,6 +97,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
|
||||
@Nullable
|
||||
protected DeviceProfile mDp;
|
||||
private final Rect mTaskSize = new Rect();
|
||||
|
||||
public OverviewActionsView(Context context) {
|
||||
this(context, null);
|
||||
@@ -202,8 +201,10 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
* Offsets OverviewActionsView horizontal position based on 3 button nav container in taskbar.
|
||||
*/
|
||||
private void updatePadding() {
|
||||
boolean alignFor3ButtonTaskbar = mDp.isTaskbarPresent &&
|
||||
DisplayController.getNavigationMode(getContext()) == THREE_BUTTONS;
|
||||
if (mDp == null) {
|
||||
return;
|
||||
}
|
||||
boolean alignFor3ButtonTaskbar = mDp.isTaskbarPresent && !mDp.isGestureMode;
|
||||
if (alignFor3ButtonTaskbar) {
|
||||
// Add extra horizontal spacing
|
||||
int additionalPadding = ApiWrapper.getHotseatEndOffset(getContext());
|
||||
@@ -225,15 +226,34 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
LayoutParams actionParams = (LayoutParams) findViewById(
|
||||
R.id.action_buttons).getLayoutParams();
|
||||
actionParams.setMargins(
|
||||
actionParams.leftMargin, getOverviewActionsTopMarginPx(mode, mDp),
|
||||
actionParams.rightMargin, getOverviewActionsBottomMarginPx(mode, mDp));
|
||||
actionParams.leftMargin, mDp.overviewActionsTopMarginPx,
|
||||
actionParams.rightMargin, getBottomMargin());
|
||||
}
|
||||
|
||||
private int getBottomMargin() {
|
||||
if (mDp == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mDp.isVerticalBarLayout()) {
|
||||
return mDp.getInsets().bottom;
|
||||
}
|
||||
|
||||
if (!mDp.isGestureMode && mDp.isTaskbarPresent) {
|
||||
return mDp.getOverviewActionsClaimedSpaceBelow();
|
||||
}
|
||||
|
||||
// Align to bottom of task Rect.
|
||||
return mDp.heightPx - mTaskSize.bottom - mDp.overviewActionsTopMarginPx
|
||||
- mDp.overviewActionsHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the device profile for this view to draw with.
|
||||
* Updates device profile and task size for this view to draw with.
|
||||
*/
|
||||
public void setDp(DeviceProfile dp) {
|
||||
public void updateDimension(DeviceProfile dp, Rect taskSize) {
|
||||
mDp = dp;
|
||||
mTaskSize.set(taskSize);
|
||||
updateVerticalMargin(DisplayController.getNavigationMode(getContext()));
|
||||
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
@@ -257,45 +277,4 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
mSplitButton.setVisibility(visible ? VISIBLE : GONE);
|
||||
findViewById(R.id.action_split_space).setVisibility(visible ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
/** Get the top margin associated with the action buttons in Overview. */
|
||||
public static int getOverviewActionsTopMarginPx(NavigationMode mode, DeviceProfile dp) {
|
||||
// In vertical bar, use the smaller task margin for the top regardless of mode
|
||||
if (dp.isVerticalBarLayout()) {
|
||||
return dp.overviewTaskMarginPx;
|
||||
}
|
||||
|
||||
if (mode == NavigationMode.THREE_BUTTONS) {
|
||||
return dp.overviewActionsMarginThreeButtonPx;
|
||||
}
|
||||
|
||||
return dp.overviewActionsTopMarginGesturePx;
|
||||
}
|
||||
|
||||
/** Get the bottom margin associated with the action buttons in Overview. */
|
||||
public static int getOverviewActionsBottomMarginPx(NavigationMode mode, DeviceProfile dp) {
|
||||
int bottomInset = dp.getInsets().bottom;
|
||||
|
||||
if (dp.isVerticalBarLayout()) {
|
||||
return bottomInset;
|
||||
}
|
||||
|
||||
if (mode == NavigationMode.THREE_BUTTONS) {
|
||||
int bottomMargin = dp.overviewActionsMarginThreeButtonPx + bottomInset;
|
||||
if (dp.isTaskbarPresent) {
|
||||
// Align vertically, using taskbar height + mDp.taskbarOffsetY() to estimate where
|
||||
// the button nav top is.
|
||||
int actionsTop = (dp.heightPx - bottomMargin - bottomInset)
|
||||
- dp.overviewActionsHeight;
|
||||
int navTop = dp.heightPx - (dp.taskbarSize + dp.getTaskbarOffsetY());
|
||||
bottomMargin -=
|
||||
navTop - actionsTop + ((dp.taskbarSize - dp.overviewActionsHeight) / 2);
|
||||
}
|
||||
return bottomMargin;
|
||||
}
|
||||
|
||||
// There is no bottom inset when taskbar is present, use stashed taskbar as padding instead.
|
||||
return dp.overviewActionsBottomMarginGesturePx
|
||||
+ (dp.isTaskbarPresent ? dp.stashedTaskbarSize : bottomInset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,6 +455,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
protected boolean mFreezeViewVisibility;
|
||||
private boolean mOverviewGridEnabled;
|
||||
private boolean mOverviewFullscreenEnabled;
|
||||
private boolean mOverviewSelectEnabled;
|
||||
|
||||
private float mAdjacentPageHorizontalOffset = 0;
|
||||
protected float mTaskViewsSecondaryTranslation = 0;
|
||||
@@ -1637,11 +1638,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
// Propagate DeviceProfile change event.
|
||||
runActionOnRemoteHandles(
|
||||
remoteTargetHandle -> remoteTargetHandle.getTaskViewSimulator().setDp(dp));
|
||||
mActionsView.setDp(dp);
|
||||
mOrientationState.setDeviceProfile(dp);
|
||||
|
||||
// Update RecentsView and TaskView's DeviceProfile dependent layout.
|
||||
updateOrientationHandler();
|
||||
mActionsView.updateDimension(dp, mLastComputedTaskSize);
|
||||
}
|
||||
|
||||
private void updateOrientationHandler() {
|
||||
@@ -1706,7 +1707,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
dp.widthPx - mInsets.right - mTempRect.right,
|
||||
dp.heightPx - mInsets.bottom - mTempRect.bottom);
|
||||
|
||||
mSizeStrategy.calculateGridSize(mActivity, mActivity.getDeviceProfile(),
|
||||
mSizeStrategy.calculateGridSize(mActivity.getDeviceProfile(),
|
||||
mLastComputedGridSize);
|
||||
mSizeStrategy.calculateGridTaskSize(mActivity, mActivity.getDeviceProfile(),
|
||||
mLastComputedGridTaskSize, mOrientationHandler);
|
||||
@@ -1764,7 +1765,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
* Returns the size of task selected to enter modal state.
|
||||
*/
|
||||
public Point getSelectedTaskSize() {
|
||||
mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), mTempRect);
|
||||
mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(),
|
||||
mTempRect);
|
||||
return new Point(mTempRect.width(), mTempRect.height());
|
||||
}
|
||||
|
||||
@@ -3689,10 +3691,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
|
||||
// Update the pivots such that when the task is scaled, it fills the full page
|
||||
getTaskSize(mTempRect);
|
||||
getPagedViewOrientedState().getFullScreenScaleAndPivot(mTempRect,
|
||||
mActivity.getDeviceProfile(), mTempPointF);
|
||||
setPivotX(mTempPointF.x);
|
||||
setPivotY(mTempPointF.y);
|
||||
updatePivots();
|
||||
setTaskModalness(mTaskModalness);
|
||||
mLastComputedTaskStartPushOutDistance = null;
|
||||
mLastComputedTaskEndPushOutDistance = null;
|
||||
@@ -3704,6 +3703,18 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
: IMPORTANT_FOR_ACCESSIBILITY_AUTO);
|
||||
}
|
||||
|
||||
private void updatePivots() {
|
||||
if (mOverviewSelectEnabled) {
|
||||
setPivotX(mLastComputedTaskSize.centerX());
|
||||
setPivotY(mLastComputedTaskSize.bottom);
|
||||
} else {
|
||||
getPagedViewOrientedState().getFullScreenScaleAndPivot(mTempRect,
|
||||
mActivity.getDeviceProfile(), mTempPointF);
|
||||
setPivotX(mTempPointF.x);
|
||||
setPivotY(mTempPointF.y);
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePageOffsets() {
|
||||
float offset = mAdjacentPageHorizontalOffset;
|
||||
float modalOffset = ACCEL_0_75.getInterpolation(mTaskModalness);
|
||||
@@ -4844,6 +4855,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
if (mOverlayEnabled != overlayEnabled) {
|
||||
mOverlayEnabled = overlayEnabled;
|
||||
updateEnabledOverlays();
|
||||
updatePivots();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4865,6 +4877,17 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update whether RecentsView is in select mode. Should be enabled before transitioning to
|
||||
* select mode, and only disabled after transitioning from select mode.
|
||||
*/
|
||||
public void setOverviewSelectEnabled(boolean overviewSelectEnabled) {
|
||||
if (mOverviewSelectEnabled != overviewSelectEnabled) {
|
||||
mOverviewSelectEnabled = overviewSelectEnabled;
|
||||
updatePivots();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the current running task view to static snapshot mode,
|
||||
* capturing the snapshot at the same time.
|
||||
|
||||
@@ -368,9 +368,7 @@
|
||||
<dimen name="overview_actions_height">0dp</dimen>
|
||||
<dimen name="overview_actions_button_spacing">0dp</dimen>
|
||||
<dimen name="overview_actions_margin_gesture">0dp</dimen>
|
||||
<dimen name="overview_actions_top_margin_gesture">0dp</dimen>
|
||||
<dimen name="overview_actions_bottom_margin_gesture">0dp</dimen>
|
||||
<dimen name="overview_actions_margin_three_button">0dp</dimen>
|
||||
<dimen name="overview_actions_top_margin">0dp</dimen>
|
||||
<dimen name="overview_grid_side_margin">0dp</dimen>
|
||||
<dimen name="overview_grid_row_spacing">0dp</dimen>
|
||||
<dimen name="overview_page_spacing">0dp</dimen>
|
||||
|
||||
@@ -195,9 +195,7 @@ public class DeviceProfile {
|
||||
public int overviewTaskIconDrawableSizeGridPx;
|
||||
public int overviewTaskThumbnailTopMarginPx;
|
||||
public final int overviewActionsHeight;
|
||||
public final int overviewActionsMarginThreeButtonPx;
|
||||
public final int overviewActionsTopMarginGesturePx;
|
||||
public final int overviewActionsBottomMarginGesturePx;
|
||||
public final int overviewActionsTopMarginPx;
|
||||
public final int overviewActionsButtonSpacing;
|
||||
public int overviewPageSpacing;
|
||||
public int overviewRowSpacing;
|
||||
@@ -408,16 +406,14 @@ public class DeviceProfile {
|
||||
overviewTaskIconDrawableSizeGridPx =
|
||||
res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size_grid);
|
||||
overviewTaskThumbnailTopMarginPx = overviewTaskIconSizePx + overviewTaskMarginPx * 2;
|
||||
overviewActionsTopMarginGesturePx = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_top_margin_gesture);
|
||||
overviewActionsBottomMarginGesturePx = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_bottom_margin_gesture);
|
||||
// In vertical bar, use the smaller task margin for the top regardless of mode.
|
||||
overviewActionsTopMarginPx = isVerticalBarLayout()
|
||||
? overviewTaskMarginPx
|
||||
: res.getDimensionPixelSize(R.dimen.overview_actions_top_margin);
|
||||
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
|
||||
overviewActionsButtonSpacing = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_button_spacing);
|
||||
overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
|
||||
overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_margin_three_button);
|
||||
// Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
|
||||
// overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the
|
||||
// extra margin when calculating row spacing.
|
||||
@@ -1103,6 +1099,24 @@ public class DeviceProfile {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of pixels required below OverviewActions excluding insets.
|
||||
*/
|
||||
public int getOverviewActionsClaimedSpaceBelow() {
|
||||
if (isTaskbarPresent && !isGestureMode) {
|
||||
// Align vertically to where nav buttons are.
|
||||
return ((taskbarSize - overviewActionsHeight) / 2) + getTaskbarOffsetY();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Gets the space that the overview actions will take, including bottom margin. */
|
||||
public int getOverviewActionsClaimedSpace() {
|
||||
return overviewActionsTopMarginPx + overviewActionsHeight
|
||||
+ getOverviewActionsClaimedSpaceBelow();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the bounds for which the open folders should be contained within
|
||||
*/
|
||||
@@ -1323,12 +1337,10 @@ public class DeviceProfile {
|
||||
overviewTaskIconDrawableSizeGridPx));
|
||||
writer.println(prefix + pxToDpStr("overviewTaskThumbnailTopMarginPx",
|
||||
overviewTaskThumbnailTopMarginPx));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsMarginThreeButtonPx",
|
||||
overviewActionsMarginThreeButtonPx));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsTopMarginGesturePx",
|
||||
overviewActionsTopMarginGesturePx));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsBottomMarginGesturePx",
|
||||
overviewActionsBottomMarginGesturePx));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsTopMarginPx",
|
||||
overviewActionsTopMarginPx));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsHeight",
|
||||
overviewActionsHeight));
|
||||
writer.println(prefix + pxToDpStr("overviewActionsButtonSpacing",
|
||||
overviewActionsButtonSpacing));
|
||||
writer.println(prefix + pxToDpStr("overviewPageSpacing", overviewPageSpacing));
|
||||
|
||||
Reference in New Issue
Block a user