public static final int ENTER_FROM_HOME_ALPHA_DURATION = 100;
public static final int ENTER_FROM_HOME_TRANSLATION_DURATION = 333;
- public static final int ENTER_WHILE_DOCKING_DURATION = 250;
private static final PathInterpolator ENTER_FROM_HOME_TRANSLATION_INTERPOLATOR =
new PathInterpolator(0, 0, 0, 1f);
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
Resources res = mStackView.getResources();
+ Resources appResources = mStackView.getContext().getApplicationContext().getResources();
TaskStackLayoutAlgorithm stackLayout = mStackView.getStackAlgorithm();
TaskStackViewScroller stackScroller = mStackView.getScroller();
R.dimen.recents_task_stack_animation_affiliate_enter_offset);
int launchedWhileDockingOffset = res.getDimensionPixelSize(
R.dimen.recents_task_stack_animation_launched_while_docking_offset);
- boolean isLandscape = mStackView.getContext().getApplicationContext().getResources()
- .getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
+ boolean isLandscape = appResources.getConfiguration().orientation
+ == Configuration.ORIENTATION_LANDSCAPE;
// Prepare each of the task views for their enter animation from front to back
List<TaskView> taskViews = mStackView.getTaskViews();
RecentsConfiguration config = Recents.getConfiguration();
RecentsActivityLaunchState launchState = config.getLaunchState();
Resources res = mStackView.getResources();
+ Resources appRes = mStackView.getContext().getApplicationContext().getResources();
TaskStackLayoutAlgorithm stackLayout = mStackView.getStackAlgorithm();
TaskStackViewScroller stackScroller = mStackView.getScroller();
R.integer.recents_task_enter_from_app_duration);
int taskViewEnterFromAffiliatedAppDuration = res.getInteger(
R.integer.recents_task_enter_from_affiliated_app_duration);
+ int dockGestureAnimDuration = appRes.getInteger(
+ R.integer.long_press_dock_anim_duration);
// Create enter animations for each of the views from front to back
List<TaskView> taskViews = mStackView.getTaskViews();
} else if (launchState.launchedViaDockGesture) {
// Animate the tasks up
AnimationProps taskAnimation = new AnimationProps()
- .setDuration(AnimationProps.BOUNDS, (int) (ENTER_WHILE_DOCKING_DURATION +
+ .setDuration(AnimationProps.BOUNDS, (int) (dockGestureAnimDuration +
(taskIndexFromBack * 2f * FRAME_OFFSET_MS)))
.setInterpolator(AnimationProps.BOUNDS,
ENTER_WHILE_DOCKING_INTERPOLATOR)
private int mDividerWindowWidth;
private int mDividerSize;
private int mTouchElevation;
+ private int mLongPressEntraceAnimDuration;
private final Rect mDockedRect = new Rect();
private final Rect mDockedTaskRect = new Rect();
mDividerSize = mDividerWindowWidth - 2 * mDividerInsets;
mTouchElevation = getResources().getDimensionPixelSize(
R.dimen.docked_stack_divider_lift_elevation);
+ mLongPressEntraceAnimDuration = getResources().getInteger(
+ R.integer.long_press_dock_anim_duration);
mGrowRecents = getResources().getBoolean(R.bool.recents_grow_in_multiwindow);
mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
mFlingAnimationUtils = new FlingAnimationUtils(getContext(), 0.3f);
public void resizeStack(int position, int taskPosition, SnapTarget taskSnapTarget) {
calculateBoundsForPosition(position, mDockSide, mDockedRect);
- if (mDockedRect.equals(mLastResizeRect)) {
+ if (mDockedRect.equals(mLastResizeRect) && !mEntranceAnimationRunning) {
return;
}
// Delay switching resizing mode because this might cause jank in recents animation
// that's long than this animation.
stopDragging(getCurrentPosition(), mSnapAlgorithm.getMiddleTarget(),
- 250 /* startDelay */, Interpolators.FAST_OUT_SLOW_IN, 200 /* endDelay */);
+ mLongPressEntraceAnimDuration, Interpolators.FAST_OUT_SLOW_IN,
+ 200 /* endDelay */);
}
if (mGrowAfterRecentsDrawn) {
mGrowAfterRecentsDrawn = false;