Loading quickstep/res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ <dimen name="overview_proactive_row_height">48dp</dimen> <dimen name="overview_proactive_row_bottom_margin">16dp</dimen> <dimen name="overview_minimum_next_prev_size">48dp</dimen> <dimen name="overview_minimum_next_prev_size">50dp</dimen> <dimen name="overview_task_margin">16dp</dimen> <!-- Overrideable in overlay that provides the Overview Actions. --> <dimen name="overview_actions_height">48dp</dimen> <dimen name="overview_actions_bottom_margin_gesture">12dp</dimen> <dimen name="overview_actions_bottom_margin_gesture">28dp</dimen> <dimen name="overview_actions_bottom_margin_three_button">8dp</dimen> <dimen name="overview_actions_horizontal_margin">16dp</dimen> Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,7 @@ public abstract class BaseQuickstepLauncher extends Launcher new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this)) ); overviewPanel.init(mActionsView, mSplitPlaceholderView); mActionsView.setDp(getDeviceProfile()); mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this)); mAppTransitionManager = new QuickstepTransitionManager(this); Loading quickstep/src/com/android/quickstep/BaseActivityInterface.java +7 −13 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import com.android.quickstep.SysUINavigationMode.Mode; 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; Loading Loading @@ -212,7 +213,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T } else { int taskMargin = dp.overviewTaskMarginPx; int proactiveRowAndMargin; if (dp.isVerticalBarLayout()) { if (!TaskView.SHOW_PROACTIVE_ACTIONS || dp.isVerticalBarLayout()) { // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside // the actions row. proactiveRowAndMargin = 0; Loading @@ -223,7 +224,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T } calculateTaskSizeInternal(context, dp, dp.overviewTaskThumbnailTopMarginPx, proactiveRowAndMargin + getOverviewActionsHeight(context) + taskMargin, proactiveRowAndMargin + getOverviewActionsHeight(context, dp), res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin, outRect); } Loading Loading @@ -314,23 +315,16 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T calculateTaskSizeInternal( context, dp, dp.overviewTaskMarginPx, getOverviewActionsHeight(context) + dp.overviewTaskMarginPx, getOverviewActionsHeight(context, dp), dp.overviewTaskMarginPx, outRect); } /** Gets the space that the overview actions will take, including bottom margin. */ public final int getOverviewActionsHeight(Context context) { private int getOverviewActionsHeight(Context context, DeviceProfile dp) { Resources res = context.getResources(); int actionsBottomMargin = 0; if (getMode(context) == Mode.THREE_BUTTONS) { actionsBottomMargin = res.getDimensionPixelSize( R.dimen.overview_actions_bottom_margin_three_button); } else { actionsBottomMargin = res.getDimensionPixelSize( R.dimen.overview_actions_bottom_margin_gesture); } return actionsBottomMargin return OverviewActionsView.getOverviewActionsBottomMarginPx(getMode(context), dp) + OverviewActionsView.getOverviewActionsTopMarginPx(getMode(context), dp) + res.getDimensionPixelSize(R.dimen.overview_actions_height); } Loading quickstep/src/com/android/quickstep/views/OverviewActionsView.java +40 −18 Original line number Diff line number Diff line Loading @@ -93,6 +93,8 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo private float mModalness; private float mModalTransformY; protected DeviceProfile mDp; public OverviewActionsView(Context context) { this(context, null); } Loading Loading @@ -205,36 +207,25 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo /** Updates vertical margins for different navigation mode or configuration changes. */ public void updateVerticalMargin(Mode mode) { if (mDp == null) { return; } LayoutParams actionParams = (LayoutParams) findViewById( R.id.action_buttons).getLayoutParams(); actionParams.setMargins( actionParams.leftMargin, actionParams.topMargin, actionParams.rightMargin, getBottomVerticalMargin(mode)); actionParams.leftMargin, getOverviewActionsTopMarginPx(mode, mDp), actionParams.rightMargin, getOverviewActionsBottomMarginPx(mode, mDp)); } /** * Set the device profile for this view to draw with. */ public void setDp(DeviceProfile dp) { mDp = dp; updateVerticalMargin(SysUINavigationMode.getMode(getContext())); requestLayout(); } protected int getBottomVerticalMargin(Mode mode) { int bottomMargin; int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { bottomMargin = 0; } else if (mode == Mode.THREE_BUTTONS) { bottomMargin = getResources() .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_three_button); } else { bottomMargin = getResources() .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_gesture); } bottomMargin += mInsets.bottom; return bottomMargin; } /** * The current task is fully modal (modalness = 1) when it is shown on its own in a modal * way. Modalness 0 means the task is shown in context with all the other tasks. Loading @@ -257,4 +248,35 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo float progress = ACCEL_DEACCEL.getInterpolation(mModalness); return Utilities.mapRange(progress, 0, endTranslation); } /** Get the top margin associated with the action buttons in Overview. */ public static int getOverviewActionsTopMarginPx( SysUINavigationMode.Mode 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 == SysUINavigationMode.Mode.THREE_BUTTONS) { return dp.overviewActionsMarginThreeButtonPx; } return dp.overviewActionsMarginGesturePx; } /** Get the bottom margin associated with the action buttons in Overview. */ public static int getOverviewActionsBottomMarginPx( SysUINavigationMode.Mode mode, DeviceProfile dp) { int inset = dp.getInsets().bottom; if (dp.isVerticalBarLayout()) { return inset; } if (mode == SysUINavigationMode.Mode.THREE_BUTTONS) { return dp.overviewActionsMarginThreeButtonPx + inset; } return dp.overviewActionsMarginGesturePx + inset; } } quickstep/src/com/android/quickstep/views/TaskView.java +6 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ public class TaskView extends FrameLayout implements Reusable { @IntDef({FLAG_UPDATE_ALL, FLAG_UPDATE_ICON, FLAG_UPDATE_THUMBNAIL}) public @interface TaskDataChanges {} /** * Should the layout account for space for a proactive action (or chip) to be added under * the task. */ public static final boolean SHOW_PROACTIVE_ACTIONS = false; /** The maximum amount that a task view can be scrimmed, dimmed or tinted. */ public static final float MAX_PAGE_SCRIM_ALPHA = 0.4f; Loading Loading
quickstep/res/values/dimens.xml +2 −2 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ <dimen name="overview_proactive_row_height">48dp</dimen> <dimen name="overview_proactive_row_bottom_margin">16dp</dimen> <dimen name="overview_minimum_next_prev_size">48dp</dimen> <dimen name="overview_minimum_next_prev_size">50dp</dimen> <dimen name="overview_task_margin">16dp</dimen> <!-- Overrideable in overlay that provides the Overview Actions. --> <dimen name="overview_actions_height">48dp</dimen> <dimen name="overview_actions_bottom_margin_gesture">12dp</dimen> <dimen name="overview_actions_bottom_margin_gesture">28dp</dimen> <dimen name="overview_actions_bottom_margin_three_button">8dp</dimen> <dimen name="overview_actions_horizontal_margin">16dp</dimen> Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −0 Original line number Diff line number Diff line Loading @@ -253,6 +253,7 @@ public abstract class BaseQuickstepLauncher extends Launcher new SplitSelectStateController(mHandler, SystemUiProxy.INSTANCE.get(this)) ); overviewPanel.init(mActionsView, mSplitPlaceholderView); mActionsView.setDp(getDeviceProfile()); mActionsView.updateVerticalMargin(SysUINavigationMode.getMode(this)); mAppTransitionManager = new QuickstepTransitionManager(this); Loading
quickstep/src/com/android/quickstep/BaseActivityInterface.java +7 −13 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import com.android.quickstep.SysUINavigationMode.Mode; 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; Loading Loading @@ -212,7 +213,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T } else { int taskMargin = dp.overviewTaskMarginPx; int proactiveRowAndMargin; if (dp.isVerticalBarLayout()) { if (!TaskView.SHOW_PROACTIVE_ACTIONS || dp.isVerticalBarLayout()) { // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside // the actions row. proactiveRowAndMargin = 0; Loading @@ -223,7 +224,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T } calculateTaskSizeInternal(context, dp, dp.overviewTaskThumbnailTopMarginPx, proactiveRowAndMargin + getOverviewActionsHeight(context) + taskMargin, proactiveRowAndMargin + getOverviewActionsHeight(context, dp), res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin, outRect); } Loading Loading @@ -314,23 +315,16 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T calculateTaskSizeInternal( context, dp, dp.overviewTaskMarginPx, getOverviewActionsHeight(context) + dp.overviewTaskMarginPx, getOverviewActionsHeight(context, dp), dp.overviewTaskMarginPx, outRect); } /** Gets the space that the overview actions will take, including bottom margin. */ public final int getOverviewActionsHeight(Context context) { private int getOverviewActionsHeight(Context context, DeviceProfile dp) { Resources res = context.getResources(); int actionsBottomMargin = 0; if (getMode(context) == Mode.THREE_BUTTONS) { actionsBottomMargin = res.getDimensionPixelSize( R.dimen.overview_actions_bottom_margin_three_button); } else { actionsBottomMargin = res.getDimensionPixelSize( R.dimen.overview_actions_bottom_margin_gesture); } return actionsBottomMargin return OverviewActionsView.getOverviewActionsBottomMarginPx(getMode(context), dp) + OverviewActionsView.getOverviewActionsTopMarginPx(getMode(context), dp) + res.getDimensionPixelSize(R.dimen.overview_actions_height); } Loading
quickstep/src/com/android/quickstep/views/OverviewActionsView.java +40 −18 Original line number Diff line number Diff line Loading @@ -93,6 +93,8 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo private float mModalness; private float mModalTransformY; protected DeviceProfile mDp; public OverviewActionsView(Context context) { this(context, null); } Loading Loading @@ -205,36 +207,25 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo /** Updates vertical margins for different navigation mode or configuration changes. */ public void updateVerticalMargin(Mode mode) { if (mDp == null) { return; } LayoutParams actionParams = (LayoutParams) findViewById( R.id.action_buttons).getLayoutParams(); actionParams.setMargins( actionParams.leftMargin, actionParams.topMargin, actionParams.rightMargin, getBottomVerticalMargin(mode)); actionParams.leftMargin, getOverviewActionsTopMarginPx(mode, mDp), actionParams.rightMargin, getOverviewActionsBottomMarginPx(mode, mDp)); } /** * Set the device profile for this view to draw with. */ public void setDp(DeviceProfile dp) { mDp = dp; updateVerticalMargin(SysUINavigationMode.getMode(getContext())); requestLayout(); } protected int getBottomVerticalMargin(Mode mode) { int bottomMargin; int orientation = getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { bottomMargin = 0; } else if (mode == Mode.THREE_BUTTONS) { bottomMargin = getResources() .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_three_button); } else { bottomMargin = getResources() .getDimensionPixelSize(R.dimen.overview_actions_bottom_margin_gesture); } bottomMargin += mInsets.bottom; return bottomMargin; } /** * The current task is fully modal (modalness = 1) when it is shown on its own in a modal * way. Modalness 0 means the task is shown in context with all the other tasks. Loading @@ -257,4 +248,35 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo float progress = ACCEL_DEACCEL.getInterpolation(mModalness); return Utilities.mapRange(progress, 0, endTranslation); } /** Get the top margin associated with the action buttons in Overview. */ public static int getOverviewActionsTopMarginPx( SysUINavigationMode.Mode 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 == SysUINavigationMode.Mode.THREE_BUTTONS) { return dp.overviewActionsMarginThreeButtonPx; } return dp.overviewActionsMarginGesturePx; } /** Get the bottom margin associated with the action buttons in Overview. */ public static int getOverviewActionsBottomMarginPx( SysUINavigationMode.Mode mode, DeviceProfile dp) { int inset = dp.getInsets().bottom; if (dp.isVerticalBarLayout()) { return inset; } if (mode == SysUINavigationMode.Mode.THREE_BUTTONS) { return dp.overviewActionsMarginThreeButtonPx + inset; } return dp.overviewActionsMarginGesturePx + inset; } }
quickstep/src/com/android/quickstep/views/TaskView.java +6 −0 Original line number Diff line number Diff line Loading @@ -132,6 +132,12 @@ public class TaskView extends FrameLayout implements Reusable { @IntDef({FLAG_UPDATE_ALL, FLAG_UPDATE_ICON, FLAG_UPDATE_THUMBNAIL}) public @interface TaskDataChanges {} /** * Should the layout account for space for a proactive action (or chip) to be added under * the task. */ public static final boolean SHOW_PROACTIVE_ACTIONS = false; /** The maximum amount that a task view can be scrimmed, dimmed or tinted. */ public static final float MAX_PAGE_SCRIM_ALPHA = 0.4f; Loading