Snap for 7991057 from a38bcacf05 to tm-release
Change-Id: I33c549c0b2989fc054e54c8cd7f1ea692b761042
This commit is contained in:
@@ -25,13 +25,6 @@
|
||||
android:clipToPadding="false"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<com.android.quickstep.views.SplitPlaceholderView
|
||||
android:id="@+id/split_placeholder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/split_placeholder_size"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
android:id="@+id/overview_actions_view"
|
||||
layout="@layout/overview_actions_container" />
|
||||
|
||||
@@ -216,6 +216,7 @@
|
||||
|
||||
<!-- Taskbar -->
|
||||
<dimen name="taskbar_size">@*android:dimen/taskbar_frame_height</dimen>
|
||||
<dimen name="taskbar_ime_size">48dp</dimen>
|
||||
<dimen name="taskbar_icon_touch_size">48dp</dimen>
|
||||
<dimen name="taskbar_icon_drag_icon_size">54dp</dimen>
|
||||
<dimen name="taskbar_folder_margin">16dp</dimen>
|
||||
|
||||
@@ -106,6 +106,9 @@ public class NavbarButtonsViewController {
|
||||
|
||||
private final AnimatedFloat mTaskbarNavButtonTranslationY = new AnimatedFloat(
|
||||
this::updateNavButtonTranslationY);
|
||||
private final AnimatedFloat mTaskbarNavButtonTranslationYForIme = new AnimatedFloat(
|
||||
this::updateNavButtonTranslationY);
|
||||
// Only applies to mTaskbarNavButtonTranslationY
|
||||
private final AnimatedFloat mNavButtonTranslationYMultiplier = new AnimatedFloat(
|
||||
this::updateNavButtonTranslationY);
|
||||
private final AnimatedFloat mTaskbarNavButtonDarkIntensity = new AnimatedFloat(
|
||||
@@ -162,14 +165,26 @@ public class NavbarButtonsViewController {
|
||||
.getKeyguardBgTaskbar(),
|
||||
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0, AnimatedFloat.VALUE, 1, 0));
|
||||
|
||||
// Make sure to remove nav bar buttons translation when notification shade is expanded.
|
||||
mPropertyHolders.add(new StatePropertyHolder(mNavButtonTranslationYMultiplier,
|
||||
flags -> (flags & FLAG_NOTIFICATION_SHADE_EXPANDED) != 0, AnimatedFloat.VALUE,
|
||||
0, 1));
|
||||
|
||||
// Force nav buttons (specifically back button) to be visible during setup wizard.
|
||||
boolean isInSetup = !mContext.isUserSetupComplete();
|
||||
if (isThreeButtonNav || isInSetup) {
|
||||
boolean alwaysShowButtons = isThreeButtonNav || isInSetup;
|
||||
|
||||
// Make sure to remove nav bar buttons translation when notification shade is expanded or
|
||||
// IME is showing (add separate translation for IME).
|
||||
int flagsToRemoveTranslation = FLAG_NOTIFICATION_SHADE_EXPANDED | FLAG_IME_VISIBLE;
|
||||
mPropertyHolders.add(new StatePropertyHolder(mNavButtonTranslationYMultiplier,
|
||||
flags -> (flags & flagsToRemoveTranslation) != 0, AnimatedFloat.VALUE,
|
||||
0, 1));
|
||||
// Center nav buttons in new height for IME.
|
||||
float transForIme = (mContext.getDeviceProfile().taskbarSize
|
||||
- mContext.getTaskbarHeightForIme()) / 2f;
|
||||
// For gesture nav, nav buttons only show for IME anyway so keep them translated down.
|
||||
float defaultButtonTransY = alwaysShowButtons ? 0 : transForIme;
|
||||
mPropertyHolders.add(new StatePropertyHolder(mTaskbarNavButtonTranslationYForIme,
|
||||
flags -> (flags & FLAG_IME_VISIBLE) != 0, AnimatedFloat.VALUE, transForIme,
|
||||
defaultButtonTransY));
|
||||
|
||||
if (alwaysShowButtons) {
|
||||
initButtons(mNavButtonContainer, mEndContextualContainer,
|
||||
mControllers.navButtonController);
|
||||
|
||||
@@ -408,8 +423,10 @@ public class NavbarButtonsViewController {
|
||||
}
|
||||
|
||||
private void updateNavButtonTranslationY() {
|
||||
mNavButtonsView.setTranslationY(mTaskbarNavButtonTranslationY.value
|
||||
* mNavButtonTranslationYMultiplier.value);
|
||||
float normalTranslationY = mTaskbarNavButtonTranslationY.value
|
||||
* mNavButtonTranslationYMultiplier.value;
|
||||
float otherTranslationY = mTaskbarNavButtonTranslationYForIme.value;
|
||||
mNavButtonsView.setTranslationY(normalTranslationY + otherTranslationY);
|
||||
}
|
||||
|
||||
private void updateNavButtonDarkIntensity() {
|
||||
|
||||
@@ -32,6 +32,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.Rect;
|
||||
@@ -100,6 +101,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
|
||||
private final WindowManager mWindowManager;
|
||||
private final @Nullable RoundedCorner mLeftCorner, mRightCorner;
|
||||
private final int mTaskbarHeightForIme;
|
||||
private WindowManager.LayoutParams mWindowLayoutParams;
|
||||
private boolean mIsFullscreen;
|
||||
// The size we should return to when we call setTaskbarWindowFullscreen(false)
|
||||
@@ -128,10 +130,13 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
mIsUserSetupComplete = SettingsCache.INSTANCE.get(this).getValue(
|
||||
Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);
|
||||
|
||||
float taskbarIconSize = getResources().getDimension(R.dimen.taskbar_icon_size);
|
||||
mDeviceProfile.updateIconSize(1, getResources());
|
||||
final Resources resources = getResources();
|
||||
float taskbarIconSize = resources.getDimension(R.dimen.taskbar_icon_size);
|
||||
mDeviceProfile.updateIconSize(1, resources);
|
||||
float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx;
|
||||
mDeviceProfile.updateIconSize(iconScale, getResources());
|
||||
mDeviceProfile.updateIconSize(iconScale, resources);
|
||||
|
||||
mTaskbarHeightForIme = resources.getDimensionPixelSize(R.dimen.taskbar_ime_size);
|
||||
|
||||
mLayoutInflater = LayoutInflater.from(this).cloneInContext(this);
|
||||
|
||||
@@ -205,7 +210,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
// Adjust the frame by the rounded corners (ie. leaving just the bar as the inset) when
|
||||
// the IME is showing
|
||||
mWindowLayoutParams.providedInternalImeInsets = Insets.of(0,
|
||||
getDefaultTaskbarWindowHeight() - mDeviceProfile.taskbarSize, 0, 0);
|
||||
getDefaultTaskbarWindowHeight() - mTaskbarHeightForIme, 0, 0);
|
||||
|
||||
// Initialize controllers after all are constructed.
|
||||
mControllers.init(sharedState);
|
||||
@@ -447,7 +452,9 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
if (mWindowLayoutParams.height == height || mIsDestroyed) {
|
||||
return;
|
||||
}
|
||||
if (height != MATCH_PARENT) {
|
||||
if (height == MATCH_PARENT) {
|
||||
height = mDeviceProfile.heightPx;
|
||||
} else {
|
||||
mLastRequestedNonFullscreenHeight = height;
|
||||
if (mIsFullscreen) {
|
||||
// We still need to be fullscreen, so defer any change to our height until we call
|
||||
@@ -458,6 +465,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
}
|
||||
}
|
||||
mWindowLayoutParams.height = height;
|
||||
mWindowLayoutParams.providedInternalImeInsets =
|
||||
Insets.of(0, height - mTaskbarHeightForIme, 0, 0);
|
||||
mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
|
||||
}
|
||||
|
||||
@@ -468,6 +477,13 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
return mDeviceProfile.taskbarSize + Math.max(getLeftCornerRadius(), getRightCornerRadius());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the bottom insets taskbar provides to the IME when IME is visible.
|
||||
*/
|
||||
public int getTaskbarHeightForIme() {
|
||||
return mTaskbarHeightForIme;
|
||||
}
|
||||
|
||||
protected void onTaskbarIconClicked(View view) {
|
||||
Object tag = view.getTag();
|
||||
if (tag instanceof Task) {
|
||||
|
||||
@@ -375,12 +375,12 @@ import java.util.function.Supplier;
|
||||
|
||||
// Update the resumed state immediately to ensure a seamless handoff
|
||||
boolean launcherResumed = !finishedToApp;
|
||||
mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0);
|
||||
|
||||
updateStateForFlag(FLAG_RECENTS_ANIMATION_RUNNING, false);
|
||||
updateStateForFlag(FLAG_RESUMED, launcherResumed);
|
||||
applyState();
|
||||
|
||||
// Set this last because applyState() might also animate it.
|
||||
mIconAlignmentForResumedState.cancelAnimation();
|
||||
mIconAlignmentForResumedState.updateValue(launcherResumed ? 1 : 0);
|
||||
|
||||
TaskbarStashController controller = mControllers.taskbarStashController;
|
||||
controller.updateStateForFlag(FLAG_IN_APP, finishedToApp);
|
||||
|
||||
@@ -74,6 +74,7 @@ import android.view.ViewTreeObserver.OnScrollChangedListener;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.Toast;
|
||||
import android.window.PictureInPictureSurfaceTransaction;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
@@ -90,6 +91,7 @@ import com.android.launcher3.statemanager.BaseState;
|
||||
import com.android.launcher3.statemanager.StatefulActivity;
|
||||
import com.android.launcher3.tracing.InputConsumerProto;
|
||||
import com.android.launcher3.tracing.SwipeHandlerProto;
|
||||
import com.android.launcher3.util.ActivityLifecycleCallbacksAdapter;
|
||||
import com.android.launcher3.util.TraceHelper;
|
||||
import com.android.launcher3.util.WindowBounds;
|
||||
import com.android.quickstep.BaseActivityInterface.AnimationFactory;
|
||||
@@ -97,7 +99,6 @@ import com.android.quickstep.GestureState.GestureEndTarget;
|
||||
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
|
||||
import com.android.quickstep.util.ActiveGestureLog;
|
||||
import com.android.quickstep.util.ActivityInitListener;
|
||||
import com.android.launcher3.util.ActivityLifecycleCallbacksAdapter;
|
||||
import com.android.quickstep.util.AnimatorControllerWithResistance;
|
||||
import com.android.quickstep.util.InputConsumerProxy;
|
||||
import com.android.quickstep.util.InputProxyHandlerFactory;
|
||||
@@ -1261,7 +1262,8 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
HomeAnimationFactory homeAnimFactory =
|
||||
createHomeAnimationFactory(cookies, duration, isTranslucent, appCanEnterPip,
|
||||
runningTaskTarget);
|
||||
mIsSwipingPipToHome = homeAnimFactory.supportSwipePipToHome() && appCanEnterPip;
|
||||
mIsSwipingPipToHome = !mIsSwipeForStagedSplit
|
||||
&& homeAnimFactory.supportSwipePipToHome() && appCanEnterPip;
|
||||
final RectFSpringAnim[] windowAnim;
|
||||
if (mIsSwipingPipToHome) {
|
||||
mSwipePipToHomeAnimator = createWindowAnimationToPip(
|
||||
@@ -1728,7 +1730,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
// If there are no targets or the animation not started, then there is nothing to finish
|
||||
mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED);
|
||||
} else {
|
||||
maybeFinishSwipePipToHome();
|
||||
maybeFinishSwipeToHome();
|
||||
finishRecentsControllerToHome(
|
||||
() -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
|
||||
}
|
||||
@@ -1737,10 +1739,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the {@link #mIsSwipingPipToHome} and notifies SysUI that transition is finished
|
||||
* if applicable. This should happen before {@link #finishRecentsControllerToHome(Runnable)}.
|
||||
* Notifies SysUI that transition is finished if applicable and also pass leash transactions
|
||||
* from Launcher to WM.
|
||||
* This should happen before {@link #finishRecentsControllerToHome(Runnable)}.
|
||||
*/
|
||||
private void maybeFinishSwipePipToHome() {
|
||||
private void maybeFinishSwipeToHome() {
|
||||
if (mIsSwipingPipToHome && mSwipePipToHomeAnimators[0] != null) {
|
||||
SystemUiProxy.INSTANCE.get(mContext).stopSwipePipToHome(
|
||||
mSwipePipToHomeAnimator.getComponentName(),
|
||||
@@ -1751,6 +1754,18 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
mSwipePipToHomeAnimator.getFinishTransaction(),
|
||||
mSwipePipToHomeAnimator.getContentOverlay());
|
||||
mIsSwipingPipToHome = false;
|
||||
} else if (mIsSwipeForStagedSplit) {
|
||||
// Transaction to hide the task to avoid flicker for entering PiP from split-screen.
|
||||
PictureInPictureSurfaceTransaction tx =
|
||||
new PictureInPictureSurfaceTransaction.Builder()
|
||||
.setAlpha(0f)
|
||||
.build();
|
||||
int[] taskIds =
|
||||
LauncherSplitScreenListener.INSTANCE.getNoCreate().getRunningSplitTaskIds();
|
||||
for (int taskId : taskIds) {
|
||||
mRecentsAnimationController.setFinishTaskTransaction(taskId,
|
||||
tx, null /* overlay */);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,14 +24,22 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TR
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_HORIZONTAL_OFFSET;
|
||||
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
|
||||
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
|
||||
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_MODALNESS;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_PRIMARY_SPLIT_TRANSLATION;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_SPLIT_TRANSLATION;
|
||||
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;
|
||||
import static com.android.quickstep.views.TaskView.FLAG_UPDATE_ALL;
|
||||
|
||||
import android.util.FloatProperty;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.anim.PropertySetter;
|
||||
import com.android.launcher3.statemanager.StateManager.StateHandler;
|
||||
@@ -100,5 +108,31 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
|
||||
|
||||
setter.setViewBackgroundColor(mActivity.getScrimView(), state.getScrimColor(mActivity),
|
||||
config.getInterpolator(ANIM_SCRIM_FADE, LINEAR));
|
||||
|
||||
RecentsState currentState = mActivity.getStateManager().getState();
|
||||
if (isSplitSelectionState(state) && !isSplitSelectionState(currentState)) {
|
||||
setter.add(mRecentsView.createSplitSelectInitAnimation().buildAnim());
|
||||
}
|
||||
|
||||
Pair<FloatProperty, FloatProperty> taskViewsFloat =
|
||||
mRecentsView.getPagedOrientationHandler().getSplitSelectTaskOffset(
|
||||
TASK_PRIMARY_SPLIT_TRANSLATION, TASK_SECONDARY_SPLIT_TRANSLATION,
|
||||
mActivity.getDeviceProfile());
|
||||
setter.setFloat(mRecentsView, taskViewsFloat.second, 0, LINEAR);
|
||||
if (isSplitSelectionState(state)) {
|
||||
mRecentsView.applySplitPrimaryScrollOffset();
|
||||
setter.setFloat(mRecentsView, taskViewsFloat.first,
|
||||
mRecentsView.getSplitSelectTranslation(), LINEAR);
|
||||
} else {
|
||||
mRecentsView.resetSplitPrimaryScrollOffset();
|
||||
setter.setFloat(mRecentsView, taskViewsFloat.first, 0, LINEAR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if {@param toState} is {@link RecentsState#OVERVIEW_SPLIT_SELECT}
|
||||
*/
|
||||
private boolean isSplitSelectionState(@NonNull RecentsState toState) {
|
||||
return toState == OVERVIEW_SPLIT_SELECT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ import static com.android.quickstep.GestureState.GestureEndTarget.RECENTS;
|
||||
import static com.android.quickstep.fallback.RecentsState.DEFAULT;
|
||||
import static com.android.quickstep.fallback.RecentsState.HOME;
|
||||
import static com.android.quickstep.fallback.RecentsState.MODAL_TASK;
|
||||
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.ActivityManager.RunningTaskInfo;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
@@ -35,6 +35,7 @@ import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.statemanager.StateManager.StateListener;
|
||||
import com.android.launcher3.util.SplitConfigurationOptions;
|
||||
import com.android.quickstep.FallbackActivityInterface;
|
||||
import com.android.quickstep.GestureState;
|
||||
import com.android.quickstep.RecentsActivity;
|
||||
@@ -207,6 +208,13 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initiateSplitSelect(TaskView taskView,
|
||||
@SplitConfigurationOptions.StagePosition int stagePosition) {
|
||||
super.initiateSplitSelect(taskView, stagePosition);
|
||||
mActivity.getStateManager().goToState(OVERVIEW_SPLIT_SELECT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateTransitionStart(RecentsState toState) {
|
||||
setOverviewStateEnabled(true);
|
||||
@@ -246,12 +254,4 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
|
||||
// Do not let touch escape to siblings below this view.
|
||||
return result || mActivity.getStateManager().getState().overviewUi();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
|
||||
// Reset modal state if full configuration changes
|
||||
setModalStateEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ public class RecentsState implements BaseState<RecentsState> {
|
||||
FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI);
|
||||
public static final RecentsState HOME = new RecentsState(3, 0);
|
||||
public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0);
|
||||
public static final RecentsState OVERVIEW_SPLIT_SELECT = new RecentsState(5,
|
||||
FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_OVERVIEW_UI);
|
||||
|
||||
public final int ordinal;
|
||||
private final int mFlags;
|
||||
|
||||
@@ -17,8 +17,9 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.InsettableFrameLayout;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAnimUtils;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.Utilities;
|
||||
@@ -43,7 +44,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
|
||||
private SplitPlaceholderView mSplitPlaceholderView;
|
||||
private RectF mStartingPosition;
|
||||
private final Launcher mLauncher;
|
||||
private final BaseDraggingActivity mActivity;
|
||||
private final boolean mIsRtl;
|
||||
private final Rect mOutline = new Rect();
|
||||
private PagedOrientationHandler mOrientationHandler;
|
||||
@@ -59,7 +60,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
|
||||
public FloatingTaskView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mLauncher = Launcher.getLauncher(context);
|
||||
mActivity = BaseActivity.fromContext(context);
|
||||
mIsRtl = Utilities.isRtl(getResources());
|
||||
}
|
||||
|
||||
@@ -114,7 +115,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
public void updateInitialPositionForView(TaskView originalView) {
|
||||
View thumbnail = originalView.getThumbnail();
|
||||
Rect viewBounds = new Rect(0, 0, thumbnail.getWidth(), thumbnail.getHeight());
|
||||
Utilities.getBoundsForViewInDragLayer(mLauncher.getDragLayer(), thumbnail, viewBounds,
|
||||
Utilities.getBoundsForViewInDragLayer(mActivity.getDragLayer(), thumbnail, viewBounds,
|
||||
true /* ignoreTransform */, null /* recycle */,
|
||||
mStartingPosition);
|
||||
mStartingPosition.offset(originalView.getTranslationX(), originalView.getTranslationY());
|
||||
@@ -161,7 +162,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
// Position the floating view exactly on top of the original
|
||||
lp.topMargin = Math.round(pos.top);
|
||||
if (mIsRtl) {
|
||||
lp.setMarginStart(mLauncher.getDeviceProfile().widthPx - Math.round(pos.right));
|
||||
lp.setMarginStart(mActivity.getDeviceProfile().widthPx - Math.round(pos.right));
|
||||
} else {
|
||||
lp.setMarginStart(Math.round(pos.left));
|
||||
}
|
||||
@@ -174,7 +175,7 @@ public class FloatingTaskView extends FrameLayout {
|
||||
|
||||
public void addAnimation(PendingAnimation animation, RectF startingBounds, Rect endBounds,
|
||||
View viewToCover, boolean fadeWithThumbnail) {
|
||||
final BaseDragLayer dragLayer = mLauncher.getDragLayer();
|
||||
final BaseDragLayer dragLayer = mActivity.getDragLayer();
|
||||
int[] dragLayerBounds = new int[2];
|
||||
dragLayer.getLocationOnScreen(dragLayerBounds);
|
||||
SplitOverlayProperties prop = new SplitOverlayProperties(endBounds,
|
||||
|
||||
@@ -168,15 +168,4 @@ public class LauncherRecentsView extends RecentsView<BaseQuickstepLauncher, Laun
|
||||
super.initiateSplitSelect(taskView, stagePosition);
|
||||
mActivity.getStateManager().goToState(LauncherState.OVERVIEW_SPLIT_SELECT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onOrientationChanged() {
|
||||
super.onOrientationChanged();
|
||||
// If overview is in modal state when rotate, reset it to overview state without running
|
||||
// animation.
|
||||
setModalStateEnabled(false);
|
||||
if (mActivity.isInState(OVERVIEW_SPLIT_SELECT)) {
|
||||
onRotateInSplitSelectionState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1264,7 +1264,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
@Override
|
||||
protected void onNotSnappingToPageInFreeScroll() {
|
||||
int finalPos = mScroller.getFinalX();
|
||||
if (!showAsGrid() && finalPos > mMinScroll && finalPos < mMaxScroll) {
|
||||
if (finalPos > mMinScroll && finalPos < mMaxScroll) {
|
||||
int firstPageScroll = getScrollForPage(!mIsRtl ? 0 : getPageCount() - 1);
|
||||
int lastPageScroll = getScrollForPage(!mIsRtl ? getPageCount() - 1 : 0);
|
||||
|
||||
@@ -1278,6 +1278,19 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
? mMaxScroll
|
||||
: getScrollForPage(mNextPage);
|
||||
|
||||
if (showAsGrid()) {
|
||||
if (isSplitSelectionActive()) {
|
||||
return;
|
||||
}
|
||||
TaskView taskView = getTaskViewAt(mNextPage);
|
||||
// Only snap to fully visible focused task.
|
||||
if (taskView == null
|
||||
|| !taskView.isFocusedTask()
|
||||
|| !isTaskViewFullyVisible(taskView)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mScroller.setFinalX(pageSnapped);
|
||||
// Ensure the scroll/snap doesn't happen too fast;
|
||||
int extraScrollDuration = OVERSCROLL_PAGE_SNAP_ANIMATION_DURATION
|
||||
@@ -1640,7 +1653,13 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
setCurrentPage(mCurrentPage);
|
||||
}
|
||||
|
||||
protected void onOrientationChanged() {
|
||||
private void onOrientationChanged() {
|
||||
// If overview is in modal state when rotate, reset it to overview state without running
|
||||
// animation.
|
||||
setModalStateEnabled(false);
|
||||
if (isSplitSelectionActive()) {
|
||||
onRotateInSplitSelectionState();
|
||||
}
|
||||
}
|
||||
|
||||
// Update task size and padding that are dependent on DeviceProfile and insets.
|
||||
|
||||
@@ -677,7 +677,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
* second app. {@code false} otherwise
|
||||
*/
|
||||
private boolean confirmSecondSplitSelectApp() {
|
||||
boolean isSelectingSecondSplitApp = mActivity.isInState(OVERVIEW_SPLIT_SELECT);
|
||||
boolean isSelectingSecondSplitApp = getRecentsView().isSplitSelectionActive();
|
||||
if (isSelectingSecondSplitApp) {
|
||||
getRecentsView().confirmSplitSelect(this);
|
||||
}
|
||||
|
||||
@@ -1639,6 +1639,8 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
|
||||
AbstractFloatingView.closeOpenViews(this, false, TYPE_ALL & ~TYPE_REBIND_SAFE);
|
||||
finishAutoCancelActionMode();
|
||||
|
||||
DragView.removeAllViews(this);
|
||||
|
||||
if (mPendingRequestArgs != null) {
|
||||
outState.putParcelable(RUNTIME_STATE_PENDING_REQUEST_ARGS, mPendingRequestArgs);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3.anim;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.util.FloatProperty;
|
||||
import android.util.IntProperty;
|
||||
@@ -64,4 +65,9 @@ public interface PropertySetter {
|
||||
TimeInterpolator interpolator) {
|
||||
property.setValue(target, value);
|
||||
}
|
||||
|
||||
default void add(Animator animatorSet) {
|
||||
animatorSet.setDuration(0);
|
||||
animatorSet.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,4 +564,19 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
|
||||
iv.setImageDrawable(drawable);
|
||||
return iv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes any stray DragView from the DragLayer.
|
||||
*/
|
||||
public static void removeAllViews(ActivityContext activity) {
|
||||
BaseDragLayer dragLayer = activity.getDragLayer();
|
||||
// Iterate in reverse order. DragView is added later to the dragLayer,
|
||||
// and will be one of the last views.
|
||||
for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {
|
||||
View child = dragLayer.getChildAt(i);
|
||||
if (child instanceof DragView) {
|
||||
dragLayer.removeView(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ public abstract class AbstractLauncherUiTest {
|
||||
}
|
||||
sDumpWasGenerated = true;
|
||||
Log.d("b/195319692", "sDumpWasGenerated := true", new Exception());
|
||||
result = "memory dump filename: " + fileName;
|
||||
result = "saved memory dump as an artifact";
|
||||
} catch (Throwable e) {
|
||||
Log.e(TAG, "dumpHprofData failed", e);
|
||||
result = "failed to save memory dump";
|
||||
|
||||
Reference in New Issue
Block a user