summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java48
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java38
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java4
9 files changed, 67 insertions, 68 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index d1eadd8..676f1ab 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -431,8 +431,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
// Update if we are getting a configuration change
if (savedInstanceState != null) {
// Update RecentsConfiguration
- mConfig = RecentsConfiguration.reinitialize(this,
- RecentsTaskLoader.getInstance().getSystemServicesProxy());
mConfig.updateOnConfigurationChange();
// Trigger the enter animation
onEnterAnimationTriggered();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index 43d9dc1..2b33d14 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -86,11 +86,15 @@ public class RecentsConfiguration {
public float taskStackWidthPaddingPct;
public float taskStackOverscrollPct;
+ /** Transitions */
+ public int transitionEnterFromAppDelay;
+ public int transitionEnterFromHomeDelay;
+
/** Task view animation and styles */
- public int taskViewEnterFromHomeDelay;
+ public int taskViewEnterFromAppDuration;
public int taskViewEnterFromHomeDuration;
public int taskViewEnterFromHomeStaggerDelay;
- public int taskViewEnterFromHomeStaggerDuration;
+ public int taskViewExitToAppDuration;
public int taskViewExitToHomeDuration;
public int taskViewRemoveAnimDuration;
public int taskViewRemoveAnimTranslationXPx;
@@ -110,16 +114,8 @@ public class RecentsConfiguration {
/** Task bar size & animations */
public int taskBarHeight;
- public int taskBarEnterAnimDuration;
- public int taskBarEnterAnimDelay;
- public int taskBarExitAnimDuration;
public int taskBarDismissDozeDelaySeconds;
- /** Lock to app */
- public int taskViewLockToAppButtonHeight;
- public int taskViewLockToAppShortAnimDuration;
- public int taskViewLockToAppLongAnimDuration;
-
/** Nav bar scrim */
public int navBarScrimEnterDuration;
@@ -226,15 +222,23 @@ public class RecentsConfiguration {
taskStackMaxDim = res.getInteger(R.integer.recents_max_task_stack_view_dim);
taskStackTopPaddingPx = res.getDimensionPixelSize(R.dimen.recents_stack_top_padding);
+ // Transition
+ transitionEnterFromAppDelay =
+ res.getInteger(R.integer.recents_enter_from_app_transition_duration);
+ transitionEnterFromHomeDelay =
+ res.getInteger(R.integer.recents_enter_from_home_transition_duration);
+
// Task view animation and styles
- taskViewEnterFromHomeDelay =
- res.getInteger(R.integer.recents_animate_task_enter_from_home_delay);
+ taskViewEnterFromAppDuration =
+ res.getInteger(R.integer.recents_task_enter_from_app_duration);
taskViewEnterFromHomeDuration =
- res.getInteger(R.integer.recents_animate_task_enter_from_home_duration);
+ res.getInteger(R.integer.recents_task_enter_from_home_duration);
taskViewEnterFromHomeStaggerDelay =
- res.getInteger(R.integer.recents_animate_task_enter_from_home_stagger_delay);
+ res.getInteger(R.integer.recents_task_enter_from_home_stagger_delay);
+ taskViewExitToAppDuration =
+ res.getInteger(R.integer.recents_task_exit_to_app_duration);
taskViewExitToHomeDuration =
- res.getInteger(R.integer.recents_animate_task_exit_to_home_duration);
+ res.getInteger(R.integer.recents_task_exit_to_home_duration);
taskViewRemoveAnimDuration =
res.getInteger(R.integer.recents_animate_task_view_remove_duration);
taskViewRemoveAnimTranslationXPx =
@@ -265,23 +269,9 @@ public class RecentsConfiguration {
// Task bar size & animations
taskBarHeight = res.getDimensionPixelSize(R.dimen.recents_task_bar_height);
- taskBarEnterAnimDuration =
- res.getInteger(R.integer.recents_animate_task_bar_enter_duration);
- taskBarEnterAnimDelay =
- res.getInteger(R.integer.recents_animate_task_bar_enter_delay);
- taskBarExitAnimDuration =
- res.getInteger(R.integer.recents_animate_task_bar_exit_duration);
taskBarDismissDozeDelaySeconds =
res.getInteger(R.integer.recents_task_bar_dismiss_delay_seconds);
- // Lock to app
- taskViewLockToAppButtonHeight =
- res.getDimensionPixelSize(R.dimen.recents_task_view_lock_to_app_button_height);
- taskViewLockToAppShortAnimDuration =
- res.getInteger(R.integer.recents_animate_lock_to_app_button_short_duration);
- taskViewLockToAppLongAnimDuration =
- res.getInteger(R.integer.recents_animate_lock_to_app_button_long_duration);
-
// Nav bar scrim
navBarScrimEnterDuration =
res.getInteger(R.integer.recents_nav_bar_scrim_enter_duration);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
index 5f8f3f2..fb05c01 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
@@ -16,7 +16,6 @@
package com.android.systemui.recents.views;
-import android.animation.ObjectAnimator;
import android.graphics.Outline;
import android.graphics.Rect;
import android.view.View;
@@ -35,8 +34,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
float mAlpha = 1f;
final float mMinAlpha = 0.25f;
- ObjectAnimator mClipBottomAnimator;
-
public AnimateableViewBounds(TaskView source, int cornerRadius) {
mConfig = RecentsConfiguration.getInstance();
mSourceView = source;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java b/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java
index 162897e..1086160 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/SystemBarScrimViews.java
@@ -64,7 +64,9 @@ public class SystemBarScrimViews {
mStatusBarScrimView.setTranslationY(-mStatusBarScrimView.getMeasuredHeight());
mStatusBarScrimView.animate()
.translationY(0)
- .setStartDelay(mConfig.taskBarEnterAnimDelay)
+ .setStartDelay(mConfig.launchedFromHome ?
+ mConfig.transitionEnterFromHomeDelay :
+ mConfig.transitionEnterFromAppDelay)
.setDuration(mConfig.navBarScrimEnterDuration)
.setInterpolator(mConfig.quintOutInterpolator)
.withStartAction(new Runnable() {
@@ -79,7 +81,9 @@ public class SystemBarScrimViews {
mNavBarScrimView.setTranslationY(mNavBarScrimView.getMeasuredHeight());
mNavBarScrimView.animate()
.translationY(0)
- .setStartDelay(mConfig.taskBarEnterAnimDelay)
+ .setStartDelay(mConfig.launchedFromHome ?
+ mConfig.transitionEnterFromHomeDelay :
+ mConfig.transitionEnterFromAppDelay)
.setDuration(mConfig.navBarScrimEnterDuration)
.setInterpolator(mConfig.quintOutInterpolator)
.withStartAction(new Runnable() {
@@ -101,7 +105,7 @@ public class SystemBarScrimViews {
mStatusBarScrimView.animate()
.translationY(-mStatusBarScrimView.getMeasuredHeight())
.setStartDelay(0)
- .setDuration(mConfig.taskBarExitAnimDuration)
+ .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutSlowInInterpolator)
.start();
}
@@ -109,7 +113,7 @@ public class SystemBarScrimViews {
mNavBarScrimView.animate()
.translationY(mNavBarScrimView.getMeasuredHeight())
.setStartDelay(0)
- .setDuration(mConfig.taskBarExitAnimDuration)
+ .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutSlowInInterpolator)
.start();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index 1731d38..5732879 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -186,6 +186,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
mUIDozeTrigger.stopDozing();
mUIDozeTrigger.resetTrigger();
}
+ mStackScroller.reset();
}
/** Requests that the views be synchronized with the model */
@@ -659,9 +660,10 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
// If this is the first layout, then scroll to the front of the stack and synchronize the
// stack views immediately to load all the views
if (mAwaitingFirstLayout) {
- mStackScroller.setStackScrollToInitialState();
- requestSynchronizeStackViewsWithModel();
- synchronizeStackViewsWithModel();
+ if (mStackScroller.setStackScrollToInitialState()) {
+ requestSynchronizeStackViewsWithModel();
+ synchronizeStackViewsWithModel();
+ }
}
// Measure each of the TaskViews
@@ -915,7 +917,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
TaskView frontTv = getChildViewForTask(newFrontMostTask);
if (frontTv != null) {
frontTv.onTaskBound(newFrontMostTask);
- frontTv.fadeInActionButton(false);
+ frontTv.fadeInActionButton(0, mConfig.taskViewEnterFromAppDuration);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
index 04f7c6f..f7067be 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
@@ -48,6 +48,11 @@ public class TaskStackViewScroller {
setStackScroll(getStackScroll());
}
+ /** Resets the task scroller. */
+ void reset() {
+ mStackScrollP = 0f;
+ }
+
/** Sets the callbacks */
void setCallbacks(TaskStackViewScrollerCallbacks cb) {
mCb = cb;
@@ -71,9 +76,14 @@ public class TaskStackViewScroller {
mStackScrollP = s;
}
- /** Sets the current stack scroll to the initial state when you first enter recents */
- public void setStackScrollToInitialState() {
+ /**
+ * Sets the current stack scroll to the initial state when you first enter recents.
+ * @return whether the stack progress changed.
+ */
+ public boolean setStackScrollToInitialState() {
+ float prevStackScrollP = mStackScrollP;
setStackScroll(getBoundedStackScroll(mLayoutAlgorithm.mInitialScrollP));
+ return Float.compare(prevStackScrollP, mStackScrollP) != 0;
}
/** Bounds the current scroll if necessary */
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index 27d2fda..d42fa15 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -24,7 +24,6 @@ import android.graphics.*;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewOutlineProvider;
-import android.view.ViewPropertyAnimator;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
import com.android.systemui.R;
@@ -271,24 +270,25 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
if (Constants.DebugFlags.App.EnableThumbnailAlphaOnFrontmost) {
// Animate the thumbnail alpha before the dim animation (to prevent updating the
// hardware layer)
- mThumbnailView.startEnterRecentsAnimation(mConfig.taskBarEnterAnimDelay,
+ mThumbnailView.startEnterRecentsAnimation(mConfig.transitionEnterFromAppDelay,
new Runnable() {
@Override
public void run() {
- animateDimToProgress(0, mConfig.taskBarEnterAnimDuration,
+ animateDimToProgress(0, mConfig.taskViewEnterFromAppDuration,
ctx.postAnimationTrigger.decrementOnAnimationEnd());
}
});
} else {
// Immediately start the dim animation
- animateDimToProgress(mConfig.taskBarEnterAnimDelay,
- mConfig.taskBarEnterAnimDuration,
+ animateDimToProgress(mConfig.transitionEnterFromAppDelay,
+ mConfig.taskViewEnterFromAppDuration,
ctx.postAnimationTrigger.decrementOnAnimationEnd());
}
ctx.postAnimationTrigger.increment();
// Animate the action button in
- fadeInActionButton(true);
+ fadeInActionButton(mConfig.transitionEnterFromAppDelay,
+ mConfig.taskViewEnterFromAppDuration);
} else {
// Animate the task up if it was occluding the launch target
if (ctx.currentTaskOccludesLaunchTarget) {
@@ -296,7 +296,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
setAlpha(0f);
animate().alpha(1f)
.translationY(transform.translationY)
- .setStartDelay(mConfig.taskBarEnterAnimDelay)
+ .setStartDelay(mConfig.transitionEnterFromAppDelay)
.setUpdateListener(null)
.setInterpolator(mConfig.fastOutSlowInInterpolator)
.setDuration(mConfig.taskViewEnterFromHomeDuration)
@@ -311,12 +311,12 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
ctx.postAnimationTrigger.increment();
}
}
- startDelay = mConfig.taskBarEnterAnimDelay;
+ startDelay = mConfig.transitionEnterFromAppDelay;
} else if (mConfig.launchedFromHome) {
// Animate the tasks up
int frontIndex = (ctx.currentStackViewCount - ctx.currentStackViewIndex - 1);
- int delay = mConfig.taskViewEnterFromHomeDelay +
+ int delay = mConfig.transitionEnterFromHomeDelay +
frontIndex * mConfig.taskViewEnterFromHomeStaggerDelay;
setScaleX(transform.scale);
@@ -353,19 +353,17 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
}, (startDelay / 2));
}
- public void fadeInActionButton(boolean withDelay) {
+ public void fadeInActionButton(int delay, int duration) {
// Hide the action button
mActionButtonView.setAlpha(0f);
// Animate the action button in
- ViewPropertyAnimator animator = mActionButtonView.animate().alpha(1f)
- .setDuration(mConfig.taskBarEnterAnimDuration)
+ mActionButtonView.animate().alpha(1f)
+ .setStartDelay(delay)
+ .setDuration(duration)
.setInterpolator(PhoneStatusBar.ALPHA_IN)
- .withLayer();
- if (withDelay) {
- animator.setStartDelay(mConfig.taskBarEnterAnimDelay);
- }
- animator.start();
+ .withLayer()
+ .start();
}
/** Animates this task view as it leaves recents by pressing home. */
@@ -391,7 +389,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Animate the dim
if (mDimAlpha > 0) {
ObjectAnimator anim = ObjectAnimator.ofInt(this, "dim", 0);
- anim.setDuration(mConfig.taskBarExitAnimDuration);
+ anim.setDuration(mConfig.taskViewExitToAppDuration);
anim.setInterpolator(mConfig.fastOutLinearInInterpolator);
anim.start();
}
@@ -406,7 +404,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mActionButtonView.animate()
.alpha(0f)
.setStartDelay(0)
- .setDuration(mConfig.taskBarExitAnimDuration)
+ .setDuration(mConfig.taskViewExitToAppDuration)
.setInterpolator(mConfig.fastOutLinearInInterpolator)
.withLayer()
.start();
@@ -421,7 +419,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
.setStartDelay(0)
.setUpdateListener(null)
.setInterpolator(mConfig.fastOutLinearInInterpolator)
- .setDuration(mConfig.taskBarExitAnimDuration)
+ .setDuration(mConfig.taskViewExitToAppDuration)
.start();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
index 5de84bd..1e5d9fc 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
@@ -235,7 +235,7 @@ public class TaskViewHeader extends FrameLayout {
.alpha(0f)
.setStartDelay(0)
.setInterpolator(mConfig.fastOutSlowInInterpolator)
- .setDuration(mConfig.taskBarExitAnimDuration)
+ .setDuration(mConfig.taskViewExitToAppDuration)
.withLayer()
.start();
}
@@ -249,7 +249,7 @@ public class TaskViewHeader extends FrameLayout {
.alpha(1f)
.setStartDelay(0)
.setInterpolator(mConfig.fastOutLinearInInterpolator)
- .setDuration(mConfig.taskBarEnterAnimDuration)
+ .setDuration(mConfig.taskViewEnterFromAppDuration)
.withLayer()
.start();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java
index c83248e..117a7d3 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewThumbnail.java
@@ -237,12 +237,12 @@ public class TaskViewThumbnail extends View {
/** Animates this task thumbnail as it enters Recents. */
void startEnterRecentsAnimation(int delay, Runnable postAnimRunnable) {
startFadeAnimation(mConfig.taskViewThumbnailAlpha, delay,
- mConfig.taskBarEnterAnimDuration, postAnimRunnable);
+ mConfig.taskViewEnterFromAppDuration, postAnimRunnable);
}
/** Animates this task thumbnail as it exits Recents. */
void startLaunchTaskAnimation(Runnable postAnimRunnable) {
- startFadeAnimation(1f, 0, mConfig.taskBarExitAnimDuration, postAnimRunnable);
+ startFadeAnimation(1f, 0, mConfig.taskViewExitToAppDuration, postAnimRunnable);
}
/** Starts a new thumbnail alpha animation. */