Merge "Land ENABLE_TASKBAR_IN_OVERVIEW" into tm-qpr-dev am: 6a10a003d6 am: a1907c710e am: cbab01c721
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21538759 Change-Id: I00c6cb0332b80c3956a94660f0e9beefa6b2058b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -113,7 +113,6 @@ import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
|||||||
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
|
import com.android.launcher3.LauncherAnimationRunner.RemoteAnimationFactory;
|
||||||
import com.android.launcher3.anim.AnimationSuccessListener;
|
import com.android.launcher3.anim.AnimationSuccessListener;
|
||||||
import com.android.launcher3.anim.AnimatorListeners;
|
import com.android.launcher3.anim.AnimatorListeners;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.launcher3.dragndrop.DragLayer;
|
import com.android.launcher3.dragndrop.DragLayer;
|
||||||
import com.android.launcher3.icons.FastBitmapDrawable;
|
import com.android.launcher3.icons.FastBitmapDrawable;
|
||||||
import com.android.launcher3.model.data.ItemInfo;
|
import com.android.launcher3.model.data.ItemInfo;
|
||||||
@@ -558,11 +557,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
|||||||
|
|
||||||
final boolean scrimEnabled = ENABLE_SCRIM_FOR_APP_LAUNCH.get();
|
final boolean scrimEnabled = ENABLE_SCRIM_FOR_APP_LAUNCH.get();
|
||||||
if (scrimEnabled) {
|
if (scrimEnabled) {
|
||||||
boolean useTaskbarColor = mDeviceProfile.isTaskbarPresentInApps
|
int scrimColor = Themes.getAttrColor(mLauncher, R.attr.overviewScrimColor);
|
||||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get();
|
|
||||||
int scrimColor = useTaskbarColor
|
|
||||||
? mLauncher.getResources().getColor(R.color.taskbar_background)
|
|
||||||
: Themes.getAttrColor(mLauncher, R.attr.overviewScrimColor);
|
|
||||||
int scrimColorTrans = ColorUtils.setAlphaComponent(scrimColor, 0);
|
int scrimColorTrans = ColorUtils.setAlphaComponent(scrimColor, 0);
|
||||||
int[] colors = isAppOpening
|
int[] colors = isAppOpening
|
||||||
? new int[]{scrimColorTrans, scrimColor}
|
? new int[]{scrimColorTrans, scrimColor}
|
||||||
@@ -576,29 +571,6 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
|
|||||||
scrim.setDuration(CONTENT_SCRIM_DURATION);
|
scrim.setDuration(CONTENT_SCRIM_DURATION);
|
||||||
scrim.setInterpolator(DEACCEL_1_5);
|
scrim.setInterpolator(DEACCEL_1_5);
|
||||||
|
|
||||||
if (useTaskbarColor) {
|
|
||||||
// Hide the taskbar background color since it would duplicate the scrim.
|
|
||||||
scrim.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationStart(Animator animation) {
|
|
||||||
LauncherTaskbarUIController taskbarUIController =
|
|
||||||
mLauncher.getTaskbarUIController();
|
|
||||||
if (taskbarUIController != null) {
|
|
||||||
taskbarUIController.forceHideBackground(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animation) {
|
|
||||||
LauncherTaskbarUIController taskbarUIController =
|
|
||||||
mLauncher.getTaskbarUIController();
|
|
||||||
if (taskbarUIController != null) {
|
|
||||||
taskbarUIController.forceHideBackground(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
launcherAnimator.play(scrim);
|
launcherAnimator.play(scrim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ public class FallbackTaskbarUIController extends TaskbarUIController {
|
|||||||
public Animator createAnimToRecentsState(RecentsState toState, long duration) {
|
public Animator createAnimToRecentsState(RecentsState toState, long duration) {
|
||||||
boolean useStashedLauncherState = toState.hasOverviewActions();
|
boolean useStashedLauncherState = toState.hasOverviewActions();
|
||||||
boolean stashedLauncherState =
|
boolean stashedLauncherState =
|
||||||
useStashedLauncherState && !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get();
|
useStashedLauncherState && FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get()
|
||||||
|
&& toState == RecentsState.MODAL_TASK;
|
||||||
TaskbarStashController stashController = mControllers.taskbarStashController;
|
TaskbarStashController stashController = mControllers.taskbarStashController;
|
||||||
// Set both FLAG_IN_STASHED_LAUNCHER_STATE and FLAG_IN_APP to ensure the state is respected.
|
// Set both FLAG_IN_STASHED_LAUNCHER_STATE and FLAG_IN_APP to ensure the state is respected.
|
||||||
// For all other states, just use the current stashed-in-app setting (e.g. if long clicked).
|
// For all other states, just use the current stashed-in-app setting (e.g. if long clicked).
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.android.launcher3.QuickstepTransitionManager;
|
|||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.anim.AnimatedFloat;
|
import com.android.launcher3.anim.AnimatedFloat;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.launcher3.logging.InstanceId;
|
import com.android.launcher3.logging.InstanceId;
|
||||||
import com.android.launcher3.logging.InstanceIdSequence;
|
import com.android.launcher3.logging.InstanceIdSequence;
|
||||||
import com.android.launcher3.model.data.ItemInfo;
|
import com.android.launcher3.model.data.ItemInfo;
|
||||||
@@ -84,7 +83,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Initialized in init.
|
// Initialized in init.
|
||||||
private AnimatedFloat mTaskbarOverrideBackgroundAlpha;
|
|
||||||
private TaskbarKeyguardController mKeyguardController;
|
private TaskbarKeyguardController mKeyguardController;
|
||||||
private final TaskbarLauncherStateController
|
private final TaskbarLauncherStateController
|
||||||
mTaskbarLauncherStateController = new TaskbarLauncherStateController();
|
mTaskbarLauncherStateController = new TaskbarLauncherStateController();
|
||||||
@@ -98,8 +96,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
super.init(taskbarControllers);
|
super.init(taskbarControllers);
|
||||||
|
|
||||||
mTaskbarLauncherStateController.init(mControllers, mLauncher);
|
mTaskbarLauncherStateController.init(mControllers, mLauncher);
|
||||||
mTaskbarOverrideBackgroundAlpha = mControllers.taskbarDragLayerController
|
|
||||||
.getOverrideBackgroundAlpha();
|
|
||||||
|
|
||||||
mLauncher.setTaskbarUIController(this);
|
mLauncher.setTaskbarUIController(this);
|
||||||
mKeyguardController = taskbarControllers.taskbarKeyguardController;
|
mKeyguardController = taskbarControllers.taskbarKeyguardController;
|
||||||
@@ -254,13 +250,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets whether the background behind the taskbar/nav bar should be hidden.
|
|
||||||
*/
|
|
||||||
public void forceHideBackground(boolean forceHide) {
|
|
||||||
mTaskbarOverrideBackgroundAlpha.updateValue(forceHide ? 0 : 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts a Taskbar EDU flow, if the user should see one upon launching an application.
|
* Starts a Taskbar EDU flow, if the user should see one upon launching an application.
|
||||||
*/
|
*/
|
||||||
@@ -317,21 +306,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
instanceId);
|
instanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSystemGestureInProgress(boolean inProgress) {
|
|
||||||
super.setSystemGestureInProgress(inProgress);
|
|
||||||
if (DisplayController.isTransientTaskbar(mLauncher)) {
|
|
||||||
forceHideBackground(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
|
||||||
// Launcher's ScrimView will draw the background throughout the gesture. But once the
|
|
||||||
// gesture ends, start drawing taskbar's background again since launcher might stop
|
|
||||||
// drawing.
|
|
||||||
forceHideBackground(inProgress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animates Taskbar elements during a transition to a Launcher state that should use in-app
|
* Animates Taskbar elements during a transition to a Launcher state that should use in-app
|
||||||
* layouts.
|
* layouts.
|
||||||
@@ -400,10 +374,6 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||||
super.dumpLogs(prefix, pw);
|
super.dumpLogs(prefix, pw);
|
||||||
|
|
||||||
pw.println(String.format(
|
|
||||||
"%s\tmTaskbarOverrideBackgroundAlpha=%.2f",
|
|
||||||
prefix,
|
|
||||||
mTaskbarOverrideBackgroundAlpha.value));
|
|
||||||
pw.println(String.format("%s\tTaskbar in-app display progress:", prefix));
|
pw.println(String.format("%s\tTaskbar in-app display progress:", prefix));
|
||||||
mTaskbarInAppDisplayProgressMultiProp.dump(
|
mTaskbarInAppDisplayProgressMultiProp.dump(
|
||||||
prefix + "\t",
|
prefix + "\t",
|
||||||
|
|||||||
@@ -127,10 +127,6 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa
|
|||||||
return mAssistantBgTaskbar;
|
return mAssistantBgTaskbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AnimatedFloat getOverrideBackgroundAlpha() {
|
|
||||||
return mBgOverride;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AnimatedFloat getTaskbarBackgroundOffset() {
|
public AnimatedFloat getTaskbarBackgroundOffset() {
|
||||||
return mBgOffset;
|
return mBgOffset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ import android.graphics.Color;
|
|||||||
import com.android.launcher3.BaseDraggingActivity;
|
import com.android.launcher3.BaseDraggingActivity;
|
||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.R;
|
|
||||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.quickstep.util.LayoutUtils;
|
import com.android.quickstep.util.LayoutUtils;
|
||||||
import com.android.quickstep.views.DesktopTaskView;
|
import com.android.quickstep.views.DesktopTaskView;
|
||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
@@ -103,10 +101,6 @@ public class BackgroundAppState extends OverviewState {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getWorkspaceScrimColor(Launcher launcher) {
|
public int getWorkspaceScrimColor(Launcher launcher) {
|
||||||
DeviceProfile dp = launcher.getDeviceProfile();
|
|
||||||
if (dp.isTaskbarPresentInApps && !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
|
||||||
return launcher.getColor(R.color.taskbar_background);
|
|
||||||
}
|
|
||||||
return Color.TRANSPARENT;
|
return Color.TRANSPARENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import com.android.launcher3.DeviceProfile;
|
|||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.launcher3.util.DisplayController;
|
import com.android.launcher3.util.DisplayController;
|
||||||
import com.android.launcher3.util.Themes;
|
import com.android.launcher3.util.Themes;
|
||||||
import com.android.quickstep.util.LayoutUtils;
|
import com.android.quickstep.util.LayoutUtils;
|
||||||
@@ -103,14 +102,9 @@ public class OverviewState extends LauncherState {
|
|||||||
return CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
|
return CLEAR_ALL_BUTTON | OVERVIEW_ACTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isTaskbarStashed(Launcher launcher) {
|
|
||||||
return !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
|
public boolean isTaskbarAlignedWithHotseat(Launcher launcher) {
|
||||||
return !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -261,26 +261,8 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
|||||||
* Offsets OverviewActionsView horizontal position based on 3 button nav container in taskbar.
|
* Offsets OverviewActionsView horizontal position based on 3 button nav container in taskbar.
|
||||||
*/
|
*/
|
||||||
private void updatePadding() {
|
private void updatePadding() {
|
||||||
if (mDp == null) {
|
// If taskbar is in overview, overview action has dedicated space above nav buttons
|
||||||
return;
|
setPadding(mInsets.left, 0, mInsets.right, 0);
|
||||||
}
|
|
||||||
boolean largeScreenLandscape = mDp.isTablet && !mDp.isTwoPanels && mDp.isLandscape;
|
|
||||||
// If in 3-button mode, shift action buttons to accommodate 3-button layout.
|
|
||||||
// (Special exception for landscape tablets, where there is enough room and we don't need to
|
|
||||||
// shift the action buttons.)
|
|
||||||
if (mDp.areNavButtonsInline && !largeScreenLandscape
|
|
||||||
// If taskbar is in overview, overview action has dedicated space above nav buttons
|
|
||||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
|
||||||
// Add extra horizontal spacing
|
|
||||||
int additionalPadding = mDp.hotseatBarEndOffset;
|
|
||||||
if (isLayoutRtl()) {
|
|
||||||
setPadding(mInsets.left + additionalPadding, 0, mInsets.right, 0);
|
|
||||||
} else {
|
|
||||||
setPadding(mInsets.left, 0, mInsets.right + additionalPadding, 0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setPadding(mInsets.left, 0, mInsets.right, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Updates vertical margins for different navigation mode or configuration changes. */
|
/** Updates vertical margins for different navigation mode or configuration changes. */
|
||||||
@@ -300,11 +282,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mDp.isGestureMode && mDp.isTaskbarPresent
|
|
||||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
|
||||||
return mDp.getOverviewActionsClaimedSpaceBelow();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mDp.isTablet && FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get()) {
|
if (mDp.isTablet && FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get()) {
|
||||||
return mDp.stashedTaskbarSize;
|
return mDp.stashedTaskbarSize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ import static com.android.launcher3.anim.Interpolators.OVERSHOOT_0_75;
|
|||||||
import static com.android.launcher3.anim.Interpolators.clampToProgress;
|
import static com.android.launcher3.anim.Interpolators.clampToProgress;
|
||||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW;
|
import static com.android.launcher3.config.FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW;
|
||||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP;
|
import static com.android.launcher3.config.FeatureFlags.ENABLE_LAUNCH_FROM_STAGED_APP;
|
||||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW;
|
|
||||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
|
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_OVERVIEW_ACTIONS_SPLIT;
|
||||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
|
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_CLEAR_ALL;
|
||||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
|
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TASK_DISMISS_SWIPE_UP;
|
||||||
@@ -3681,8 +3680,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
removeViewInLayout(mClearAllButton);
|
removeViewInLayout(mClearAllButton);
|
||||||
if (isHomeTaskDismissed) {
|
if (isHomeTaskDismissed) {
|
||||||
updateEmptyMessage();
|
updateEmptyMessage();
|
||||||
} else if (!(ENABLE_TASKBAR_IN_OVERVIEW.get() &&
|
} else if (!mSplitSelectStateController.isSplitSelectActive()) {
|
||||||
mSplitSelectStateController.isSplitSelectActive())) {
|
|
||||||
startHome();
|
startHome();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -3785,8 +3783,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
|||||||
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SELECT_ACTIVE, isSplitSelectionActive());
|
mActionsView.updateHiddenFlags(HIDDEN_SPLIT_SELECT_ACTIVE, isSplitSelectionActive());
|
||||||
mActionsView.updateSplitButtonHiddenFlags(FLAG_IS_NOT_TABLET,
|
mActionsView.updateSplitButtonHiddenFlags(FLAG_IS_NOT_TABLET,
|
||||||
!mActivity.getDeviceProfile().isTablet);
|
!mActivity.getDeviceProfile().isTablet);
|
||||||
mActionsView.updateSplitButtonDisabledFlags(FLAG_SINGLE_TASK,
|
mActionsView.updateSplitButtonDisabledFlags(FLAG_SINGLE_TASK, /*enable=*/ false);
|
||||||
!FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get() && getTaskViewCount() <= 1);
|
|
||||||
if (DESKTOP_MODE_SUPPORTED) {
|
if (DESKTOP_MODE_SUPPORTED) {
|
||||||
boolean isCurrentDesktop = getCurrentPageTaskView() instanceof DesktopTaskView;
|
boolean isCurrentDesktop = getCurrentPageTaskView() instanceof DesktopTaskView;
|
||||||
mActionsView.updateHiddenFlags(HIDDEN_DESKTOP, isCurrentDesktop);
|
mActionsView.updateHiddenFlags(HIDDEN_DESKTOP, isCurrentDesktop);
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package com.android.quickstep.views;
|
package com.android.quickstep.views;
|
||||||
|
|
||||||
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.FloatProperty;
|
import android.util.FloatProperty;
|
||||||
@@ -27,11 +25,8 @@ import android.widget.FrameLayout;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
|
||||||
import com.android.launcher3.DeviceProfile;
|
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.launcher3.statemanager.StatefulActivity;
|
import com.android.launcher3.statemanager.StatefulActivity;
|
||||||
import com.android.launcher3.util.DisplayController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A rounded rectangular component containing a single TextView.
|
* A rounded rectangular component containing a single TextView.
|
||||||
@@ -103,36 +98,10 @@ public class SplitInstructionsView extends FrameLayout {
|
|||||||
this,
|
this,
|
||||||
mLauncher.getDeviceProfile(),
|
mLauncher.getDeviceProfile(),
|
||||||
getMeasuredHeight(),
|
getMeasuredHeight(),
|
||||||
getMeasuredWidth(),
|
getMeasuredWidth()
|
||||||
getThreeButtonNavShift()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// In some cases, when user is using 3-button nav, there isn't enough room for both the
|
|
||||||
// 3-button nav and a centered SplitInstructionsView. This function will return an int that will
|
|
||||||
// be used to shift the SplitInstructionsView over a bit so that everything looks well-spaced.
|
|
||||||
// In many cases, this will return 0, since we don't need to shift it away from the center.
|
|
||||||
int getThreeButtonNavShift() {
|
|
||||||
DeviceProfile dp = mLauncher.getDeviceProfile();
|
|
||||||
if ((DisplayController.getNavigationMode(getContext()) == THREE_BUTTONS)
|
|
||||||
&& ((dp.isTwoPanels) || (dp.isTablet && !dp.isLandscape))
|
|
||||||
// If taskbar is in overview, overview action has dedicated space above nav buttons
|
|
||||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
|
||||||
int navButtonWidth = getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.taskbar_nav_buttons_size);
|
|
||||||
int extraMargin = getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.taskbar_split_instructions_margin);
|
|
||||||
// Explanation: The 3-button nav for non-phones sits on one side of the screen, taking
|
|
||||||
// up 3 buttons + a side margin worth of space. Our splitInstructionsView starts in the
|
|
||||||
// center of the screen and we want to center it in the remaining space, therefore we
|
|
||||||
// want to shift it over by half the 3-button layout's width.
|
|
||||||
// If the user is using an RtL layout, we shift it the opposite way.
|
|
||||||
return -((3 * navButtonWidth + extraMargin) / 2) * (isLayoutRtl() ? -1 : 1);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public AppCompatTextView getTextView() {
|
public AppCompatTextView getTextView() {
|
||||||
return mTextView;
|
return mTextView;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,10 +415,6 @@
|
|||||||
<dimen name="split_instructions_elevation">1dp</dimen>
|
<dimen name="split_instructions_elevation">1dp</dimen>
|
||||||
<dimen name="split_instructions_horizontal_padding">24dp</dimen>
|
<dimen name="split_instructions_horizontal_padding">24dp</dimen>
|
||||||
<dimen name="split_instructions_vertical_padding">12dp</dimen>
|
<dimen name="split_instructions_vertical_padding">12dp</dimen>
|
||||||
<dimen name="split_instructions_bottom_margin_tablet_landscape">32dp</dimen>
|
|
||||||
<dimen name="split_instructions_bottom_margin_tablet_portrait">44dp</dimen>
|
|
||||||
<dimen name="split_instructions_bottom_margin_twopanels_landscape">33dp</dimen>
|
|
||||||
<dimen name="split_instructions_bottom_margin_twopanels_portrait">51dp</dimen>
|
|
||||||
<dimen name="split_instructions_bottom_margin_phone_landscape">24dp</dimen>
|
<dimen name="split_instructions_bottom_margin_phone_landscape">24dp</dimen>
|
||||||
<dimen name="split_instructions_bottom_margin_phone_portrait">60dp</dimen>
|
<dimen name="split_instructions_bottom_margin_phone_portrait">60dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -1417,14 +1417,7 @@ public class DeviceProfile {
|
|||||||
*/
|
*/
|
||||||
public int getOverviewActionsClaimedSpaceBelow() {
|
public int getOverviewActionsClaimedSpaceBelow() {
|
||||||
if (isTaskbarPresent) {
|
if (isTaskbarPresent) {
|
||||||
if (FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
return transientTaskbarSize + transientTaskbarMargin * 2;
|
||||||
return transientTaskbarSize + transientTaskbarMargin * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return isGestureMode
|
|
||||||
? stashedTaskbarSize
|
|
||||||
// Align vertically to where nav buttons are.
|
|
||||||
: ((taskbarSize - overviewActionsHeight) / 2) + getTaskbarOffsetY();
|
|
||||||
}
|
}
|
||||||
return mInsets.bottom;
|
return mInsets.bottom;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,10 +216,6 @@ public final class FeatureFlags {
|
|||||||
"ENABLE_ALL_APPS_ONE_SEARCH_IN_TASKBAR", false,
|
"ENABLE_ALL_APPS_ONE_SEARCH_IN_TASKBAR", false,
|
||||||
"Enables One Search box in Taskbar All Apps.");
|
"Enables One Search box in Taskbar All Apps.");
|
||||||
|
|
||||||
public static final BooleanFlag ENABLE_TASKBAR_IN_OVERVIEW = getDebugFlag(270393449,
|
|
||||||
"ENABLE_TASKBAR_IN_OVERVIEW", true,
|
|
||||||
"Enables accessing the system Taskbar in overview.");
|
|
||||||
|
|
||||||
public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE = getDebugFlag(270393906,
|
public static final BooleanFlag ENABLE_SPLIT_FROM_WORKSPACE = getDebugFlag(270393906,
|
||||||
"ENABLE_SPLIT_FROM_WORKSPACE", true,
|
"ENABLE_SPLIT_FROM_WORKSPACE", true,
|
||||||
"Enable initiating split screen from workspace.");
|
"Enable initiating split screen from workspace.");
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
||||||
int splitInstructionsWidth, int threeButtonNavShift) {
|
int splitInstructionsWidth) {
|
||||||
out.setPivotX(0);
|
out.setPivotX(0);
|
||||||
out.setPivotY(splitInstructionsHeight);
|
out.setPivotY(splitInstructionsHeight);
|
||||||
out.setRotation(getDegreesRotated());
|
out.setRotation(getDegreesRotated());
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public interface PagedOrientationHandler {
|
|||||||
* @param splitInstructionsWidth The SplitInstructionView's width.
|
* @param splitInstructionsWidth The SplitInstructionView's width.
|
||||||
*/
|
*/
|
||||||
void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
||||||
int splitInstructionsWidth, int threeButtonNavShift);
|
int splitInstructionsWidth);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param splitDividerSize height of split screen drag handle in portrait, width in landscape
|
* @param splitDividerSize height of split screen drag handle in portrait, width in landscape
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
|
|||||||
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
|
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X;
|
||||||
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
|
import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_Y;
|
||||||
import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
|
import static com.android.launcher3.touch.SingleAxisSwipeDetector.VERTICAL;
|
||||||
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
|
|
||||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
|
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_BOTTOM_OR_RIGHT;
|
||||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT;
|
||||||
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_MAIN;
|
import static com.android.launcher3.util.SplitConfigurationOptions.STAGE_TYPE_MAIN;
|
||||||
@@ -51,8 +50,6 @@ import android.widget.LinearLayout;
|
|||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
import com.android.launcher3.Utilities;
|
import com.android.launcher3.Utilities;
|
||||||
import com.android.launcher3.config.FeatureFlags;
|
|
||||||
import com.android.launcher3.util.DisplayController;
|
|
||||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
import com.android.launcher3.util.SplitConfigurationOptions.SplitBounds;
|
||||||
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||||
@@ -517,57 +514,29 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
||||||
int splitInstructionsWidth, int threeButtonNavShift) {
|
int splitInstructionsWidth) {
|
||||||
out.setPivotX(0);
|
out.setPivotX(0);
|
||||||
out.setPivotY(splitInstructionsHeight);
|
out.setPivotY(splitInstructionsHeight);
|
||||||
out.setRotation(getDegreesRotated());
|
out.setRotation(getDegreesRotated());
|
||||||
int distanceToEdge;
|
int distanceToEdge;
|
||||||
if ((DisplayController.getNavigationMode(out.getContext()) == THREE_BUTTONS)
|
if (dp.isPhone) {
|
||||||
&& (dp.isTwoPanels || dp.isTablet)
|
if (dp.isLandscape) {
|
||||||
// If taskbar is in overview, overview action has dedicated space above nav buttons
|
distanceToEdge = out.getResources().getDimensionPixelSize(
|
||||||
&& !FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) {
|
R.dimen.split_instructions_bottom_margin_phone_landscape);
|
||||||
// If 3-button nav is active, align the splitInstructionsView with it.
|
|
||||||
distanceToEdge = dp.getTaskbarOffsetY()
|
|
||||||
+ ((dp.taskbarSize - splitInstructionsHeight) / 2);
|
|
||||||
} else {
|
|
||||||
// If 3-button nav is not active, set bottom margin according to spec.
|
|
||||||
if (dp.isPhone) {
|
|
||||||
if (dp.isLandscape) {
|
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.split_instructions_bottom_margin_phone_landscape);
|
|
||||||
} else {
|
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.split_instructions_bottom_margin_phone_portrait);
|
|
||||||
}
|
|
||||||
} else if (dp.isTwoPanels) {
|
|
||||||
if (dp.isLandscape) {
|
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.split_instructions_bottom_margin_twopanels_landscape);
|
|
||||||
} else {
|
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.split_instructions_bottom_margin_twopanels_portrait);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (dp.isLandscape) {
|
distanceToEdge = out.getResources().getDimensionPixelSize(
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
R.dimen.split_instructions_bottom_margin_phone_portrait);
|
||||||
R.dimen.split_instructions_bottom_margin_tablet_landscape);
|
|
||||||
} else {
|
|
||||||
distanceToEdge = out.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.split_instructions_bottom_margin_tablet_portrait);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
distanceToEdge = dp.getOverviewActionsClaimedSpaceBelow();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center the view in case of unbalanced insets on left or right of screen
|
// Center the view in case of unbalanced insets on left or right of screen
|
||||||
int insetCorrectionX = (dp.getInsets().right - dp.getInsets().left) / 2;
|
int insetCorrectionX = (dp.getInsets().right - dp.getInsets().left) / 2;
|
||||||
// Adjust for any insets on the bottom edge
|
// Adjust for any insets on the bottom edge
|
||||||
int insetCorrectionY = dp.getInsets().bottom;
|
int insetCorrectionY = dp.getInsets().bottom;
|
||||||
// Adjust for taskbar in overview
|
out.setTranslationX(insetCorrectionX);
|
||||||
int taskbarCorrectionY =
|
out.setTranslationY(-distanceToEdge + insetCorrectionY);
|
||||||
dp.isTaskbarPresent && FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()
|
|
||||||
? dp.taskbarSize : 0;
|
|
||||||
out.setTranslationX(insetCorrectionX + threeButtonNavShift);
|
|
||||||
out.setTranslationY(-distanceToEdge + insetCorrectionY - taskbarCorrectionY);
|
|
||||||
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams();
|
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) out.getLayoutParams();
|
||||||
lp.gravity = CENTER_HORIZONTAL | BOTTOM;
|
lp.gravity = CENTER_HORIZONTAL | BOTTOM;
|
||||||
out.setLayoutParams(lp);
|
out.setLayoutParams(lp);
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
public void setSplitInstructionsParams(View out, DeviceProfile dp, int splitInstructionsHeight,
|
||||||
int splitInstructionsWidth, int threeButtonNavShift) {
|
int splitInstructionsWidth) {
|
||||||
out.setPivotX(0);
|
out.setPivotX(0);
|
||||||
out.setPivotY(splitInstructionsHeight);
|
out.setPivotY(splitInstructionsHeight);
|
||||||
out.setRotation(getDegreesRotated());
|
out.setRotation(getDegreesRotated());
|
||||||
|
|||||||
Reference in New Issue
Block a user