Merge "Add revised thresholds for transient taskbar behind flag ENABLE_TASKBAR_REVISED_THRESHOLDS." into tm-qpr-dev

This commit is contained in:
Jon Miranda
2022-11-22 17:20:21 +00:00
committed by Android (Google) Code Review
6 changed files with 24 additions and 4 deletions

View File

@@ -292,10 +292,14 @@
<!-- An additional touch slop to prevent x-axis movement during the swipe up to show taskbar -->
<dimen name="transient_taskbar_clamped_offset_bound">16dp</dimen>
<!-- Taskbar swipe up thresholds -->
<dimen name="taskbar_nav_threshold">40dp</dimen>
<dimen name="taskbar_app_window_threshold">150dp</dimen>
<dimen name="taskbar_home_overview_threshold">225dp</dimen>
<dimen name="taskbar_catch_up_threshold">300dp</dimen>
<dimen name="taskbar_nav_threshold">40dp</dimen>
<dimen name="taskbar_nav_threshold_v2">30dp</dimen>
<dimen name="taskbar_app_window_threshold_v2">100dp</dimen>
<dimen name="taskbar_home_overview_threshold_v2">200dp</dimen>
<!-- Taskbar 3 button spacing -->
<dimen name="taskbar_button_space_inbetween">24dp</dimen>

View File

@@ -27,6 +27,7 @@ import static com.android.launcher3.PagedView.INVALID_PAGE;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_REVISED_THRESHOLDS;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_BACKGROUND;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOME_GESTURE;
@@ -344,7 +345,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
Resources res = context.getResources();
mTaskbarAppWindowThreshold = res
.getDimensionPixelSize(R.dimen.taskbar_app_window_threshold);
.getDimensionPixelSize(ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
? R.dimen.taskbar_app_window_threshold_v2
: R.dimen.taskbar_app_window_threshold);
mTaskbarCatchUpThreshold = res.getDimensionPixelSize(R.dimen.taskbar_catch_up_threshold);
mIsTransientTaskbar = DisplayController.isTransientTaskbar(mActivity);

View File

@@ -27,6 +27,7 @@ import static com.android.launcher3.PagedView.ACTION_MOVE_ALLOW_EASY_FLING;
import static com.android.launcher3.PagedView.DEBUG_FAILED_QUICKSWITCH;
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_REVISED_THRESHOLDS;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.launcher3.util.TraceHelper.FLAG_CHECK_FOR_RACE_CONDITIONS;
import static com.android.launcher3.util.VelocityUtils.PX_PER_MS;
@@ -164,7 +165,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC
mTaskbarAlreadyOpen = controller != null && !controller.isTaskbarStashed();
mIsTransientTaskbar = DisplayController.isTransientTaskbar(base);
mTaskbarHomeOverviewThreshold = base.getResources()
.getDimensionPixelSize(R.dimen.taskbar_home_overview_threshold);
.getDimensionPixelSize(ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
? R.dimen.taskbar_home_overview_threshold_v2
: R.dimen.taskbar_home_overview_threshold);
boolean continuingPreviousGesture = mTaskAnimationManager.isRecentsAnimationRunning();
mIsDeferredDownTarget = !continuingPreviousGesture && isDeferredDownTarget;

View File

@@ -18,6 +18,7 @@ package com.android.quickstep.inputconsumers;
import static android.view.MotionEvent.INVALID_POINTER_ID;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_REVISED_THRESHOLDS;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING;
import android.content.Context;
@@ -72,7 +73,9 @@ public class TaskbarStashInputConsumer extends DelegateInputConsumer {
Resources res = context.getResources();
mUnstashArea = res.getDimensionPixelSize(R.dimen.taskbar_unstash_input_area);
int taskbarThreshold = res.getDimensionPixelSize(R.dimen.taskbar_nav_threshold);
int taskbarThreshold = res.getDimensionPixelSize(ENABLE_TASKBAR_REVISED_THRESHOLDS.get()
? R.dimen.taskbar_nav_threshold_v2
: R.dimen.taskbar_nav_threshold);
int screenHeight = taskbarActivityContext.getDeviceProfile().heightPx;
mTaskbarThresholdY = screenHeight - taskbarThreshold;

View File

@@ -388,6 +388,9 @@
<dimen name="taskbar_app_window_threshold">0dp</dimen>
<dimen name="taskbar_home_overview_threshold">0dp</dimen>
<dimen name="taskbar_catch_up_threshold">0dp</dimen>
<dimen name="taskbar_nav_threshold_v2">0dp</dimen>
<dimen name="taskbar_app_window_threshold_v2">0dp</dimen>
<dimen name="taskbar_home_overview_threshold_v2">0dp</dimen>
<!-- Size of the maximum radius for the enforced rounded rectangles. -->
<dimen name="enforced_rounded_corner_max_radius">16dp</dimen>

View File

@@ -322,6 +322,10 @@ public final class FeatureFlags {
"HOME_GARDENING_WORKSPACE_BUTTONS", false,
"Change workspace edit buttons to reflect home gardening");
public static final BooleanFlag ENABLE_TASKBAR_REVISED_THRESHOLDS = getDebugFlag(
"ENABLE_TASKBAR_REVISED_THRESHOLDS", false,
"Uses revised thresholds for transient taskbar.");
public static final BooleanFlag ENABLE_TRANSIENT_TASKBAR = getDebugFlag(
"ENABLE_TRANSIENT_TASKBAR", false, "Enables transient taskbar.");