Fixing issue with configuration states not being reset on configuration change.

- Also updating some interpolators

Change-Id: Ia29fc6f10705c7d286246162f894a25de7b4be40
This commit is contained in:
Winson Chung
2014-05-29 14:25:42 -07:00
parent 24cf152483
commit b01ed681fe
6 changed files with 24 additions and 14 deletions

View File

@@ -115,7 +115,7 @@
<!-- The min animation duration for animating the task bar in. -->
<integer name="recents_animate_task_bar_enter_duration">300</integer>
<!-- The min animation duration for animating the task bar out. -->
<integer name="recents_animate_task_bar_exit_duration">175</integer>
<integer name="recents_animate_task_bar_exit_duration">150</integer>
<!-- The animation duration for animating in the info pane. -->
<integer name="recents_animate_task_view_info_pane_duration">150</integer>
<!-- The animation duration for animating the removal of a task view. -->

View File

@@ -46,7 +46,9 @@ public class RecentsConfiguration {
public float animationPxMovementPerSecond;
public Interpolator defaultBezierInterpolator;
public Interpolator fastOutSlowInInterpolator;
public Interpolator fastOutLinearInInterpolator;
public Interpolator linearOutSlowInInterpolator;
public int filteringCurrentViewsMinAnimDuration;
public int filteringNewViewsMinAnimDuration;
@@ -141,8 +143,12 @@ public class RecentsConfiguration {
taskBarViewDarkTextColor =
res.getColor(R.color.recents_task_bar_dark_text_color);
defaultBezierInterpolator = AnimationUtils.loadInterpolator(context,
fastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
com.android.internal.R.interpolator.fast_out_slow_in);
fastOutLinearInInterpolator = AnimationUtils.loadInterpolator(context,
com.android.internal.R.interpolator.fast_out_linear_in);
linearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
com.android.internal.R.interpolator.linear_out_slow_in);
// Check if the developer options are enabled
ContentResolver cr = context.getContentResolver();
@@ -167,6 +173,13 @@ public class RecentsConfiguration {
appWidgetId).apply();
}
/** Called when the configuration has changed, and we want to reset any configuration specific
* members. */
public void updateOnConfigurationChange() {
launchedFromAltTab = false;
launchedWithThumbnailAnimation = false;
}
/** Returns whether the search bar app widget exists */
public boolean hasSearchBarAppWidget() {
return searchBarAppWidgetId >= 0;

View File

@@ -55,7 +55,8 @@ class SystemUIMessageHandler extends Handler {
if (msg.what == AlternateRecentsComponent.MSG_UPDATE_FOR_CONFIGURATION) {
RecentsTaskLoader.initialize(context);
RecentsConfiguration.reinitialize(context);
RecentsConfiguration config = RecentsConfiguration.reinitialize(context);
config.updateOnConfigurationChange();
try {
Bundle data = msg.getData();
@@ -73,7 +74,6 @@ class SystemUIMessageHandler extends Handler {
// Get the task stack and search bar bounds
Rect taskStackBounds = new Rect();
RecentsConfiguration config = RecentsConfiguration.getInstance();
config.getTaskStackBounds(windowRect.width(), windowRect.height(), taskStackBounds);
// Calculate the target task rect for when there is one task.

View File

@@ -16,7 +16,6 @@
package com.android.systemui.recents.views;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
@@ -81,7 +80,7 @@ class TaskBarView extends FrameLayout {
.alpha(toTransform.dismissAlpha)
.setStartDelay(0)
.setDuration(duration)
.setInterpolator(config.defaultBezierInterpolator)
.setInterpolator(config.fastOutSlowInInterpolator)
.withLayer()
.start();
} else {

View File

@@ -23,7 +23,6 @@ import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Region;
@@ -345,7 +344,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
mScrollAnimator = ObjectAnimator.ofInt(this, "stackScroll", curScroll, newScroll);
mScrollAnimator.setDuration(Utilities.calculateTranslationAnimationDuration(newScroll -
curScroll, 250));
mScrollAnimator.setInterpolator(RecentsConfiguration.getInstance().defaultBezierInterpolator);
mScrollAnimator.setInterpolator(RecentsConfiguration.getInstance().fastOutSlowInInterpolator);
mScrollAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {

View File

@@ -21,7 +21,6 @@ import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.Rect;
@@ -167,7 +166,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
.scaleY(toTransform.scale)
.alpha(toTransform.alpha)
.setDuration(duration)
.setInterpolator(config.defaultBezierInterpolator)
.setInterpolator(config.fastOutSlowInInterpolator)
.withLayer()
.setUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
@@ -235,7 +234,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
mBarView.animate()
.translationY(0)
.setStartDelay(200)
.setInterpolator(config.defaultBezierInterpolator)
.setInterpolator(config.fastOutSlowInInterpolator)
.setDuration(config.taskBarEnterAnimDuration)
.withLayer()
.start();
@@ -247,7 +246,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
mBarView.animate()
.translationY(-mBarView.getMeasuredHeight())
.setStartDelay(0)
.setInterpolator(config.defaultBezierInterpolator)
.setInterpolator(config.fastOutLinearInInterpolator)
.setDuration(config.taskBarExitAnimDuration)
.withLayer()
.withEndAction(new Runnable() {
@@ -268,7 +267,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
animate().translationX(config.taskViewRemoveAnimTranslationXPx)
.alpha(0f)
.setStartDelay(0)
.setInterpolator(config.defaultBezierInterpolator)
.setInterpolator(config.fastOutSlowInInterpolator)
.setDuration(config.taskViewRemoveAnimDuration)
.withLayer()
.withEndAction(new Runnable() {