summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java38
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/Constants.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java96
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java128
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java253
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskViewFooter.java98
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java31
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java17
23 files changed, 211 insertions, 554 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index f184ad2..8ef3791 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -43,6 +43,7 @@ import com.android.systemui.statusbar.phone.PhoneStatusBar;
import com.android.systemui.statusbar.phone.SystemUIDialog;
import java.io.PrintWriter;
+import java.text.NumberFormat;
public class PowerNotificationWarnings implements PowerUI.WarningsUI {
private static final String TAG = PowerUI.TAG + ".Notification";
@@ -157,7 +158,6 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setContentTitle(mContext.getString(R.string.invalid_charger_title))
.setContentText(mContext.getString(R.string.invalid_charger_text))
.setPriority(Notification.PRIORITY_MAX)
- .setCategory(Notification.CATEGORY_SYSTEM)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setColor(mContext.getResources().getColor(
com.android.internal.R.color.system_notification_accent_color));
@@ -171,16 +171,16 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
private void showWarningNotification() {
final int textRes = mSaver ? R.string.battery_low_percent_format_saver_started
: R.string.battery_low_percent_format;
+ final String percentage = NumberFormat.getPercentInstance().format((double) mBatteryLevel / 100.0);
final Notification.Builder nb = new Notification.Builder(mContext)
.setSmallIcon(R.drawable.ic_power_low)
// Bump the notification when the bucket dropped.
.setWhen(mBucketDroppedNegativeTimeMs)
.setShowWhen(false)
.setContentTitle(mContext.getString(R.string.battery_low_title))
- .setContentText(mContext.getString(textRes, mBatteryLevel))
+ .setContentText(mContext.getString(textRes, percentage))
.setOnlyAlertOnce(true)
.setPriority(Notification.PRIORITY_MAX)
- .setCategory(Notification.CATEGORY_SYSTEM)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setColor(mContext.getResources().getColor(
com.android.internal.R.color.battery_saver_mode_color));
@@ -212,7 +212,6 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
.setContentText(mContext.getString(R.string.battery_saver_notification_text))
.setOngoing(true)
.setShowWhen(false)
- .setCategory(Notification.CATEGORY_SYSTEM)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setColor(mContext.getResources().getColor(
com.android.internal.R.color.battery_saver_mode_color));
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java
index eb4560d..111484b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailClipper.java
@@ -55,7 +55,6 @@ public class QSDetailClipper {
if (listener != null) {
mAnimator.addListener(listener);
}
- mDetail.setLayerType(View.LAYER_TYPE_HARDWARE, null);
if (in) {
mBackground.startTransition((int)(mAnimator.getDuration() * 0.6));
mAnimator.addListener(mVisibleOnStart);
@@ -82,7 +81,6 @@ public class QSDetailClipper {
}
public void onAnimationEnd(Animator animation) {
- mDetail.setLayerType(View.LAYER_TYPE_NONE, null);
mAnimator = null;
}
};
@@ -90,7 +88,6 @@ public class QSDetailClipper {
private final AnimatorListenerAdapter mGoneOnEnd = new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- mDetail.setLayerType(View.LAYER_TYPE_NONE, null);
mDetail.setVisibility(View.GONE);
mBackground.resetTransition();
mAnimator = null;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java b/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java
index ad79aba..a1092a3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/UsageTracker.java
@@ -22,7 +22,6 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
-import com.android.systemui.R;
import com.android.systemui.statusbar.policy.Listenable;
public class UsageTracker implements Listenable {
@@ -35,11 +34,10 @@ public class UsageTracker implements Listenable {
private boolean mRegistered;
- public UsageTracker(Context context, Class<?> tile) {
+ public UsageTracker(Context context, Class<?> tile, int timeoutResource) {
mContext = context;
mPrefKey = tile.getSimpleName() + "LastUsed";
- mTimeToShowTile = MILLIS_PER_DAY * mContext.getResources()
- .getInteger(R.integer.days_to_show_timeout_tiles);
+ mTimeToShowTile = MILLIS_PER_DAY * mContext.getResources().getInteger(timeoutResource);
mResetAction = "com.android.systemui.qs." + tile.getSimpleName() + ".usage_reset";
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
index 01849c1..7ba1dc0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
@@ -44,7 +44,8 @@ public class ColorInversionTile extends QSTile<QSTile.BooleanState> {
}
}
};
- mUsageTracker = new UsageTracker(host.getContext(), ColorInversionTile.class);
+ mUsageTracker = new UsageTracker(host.getContext(), ColorInversionTile.class,
+ R.integer.days_to_show_color_inversion_tile);
if (mSetting.getValue() != 0 && !mUsageTracker.isRecentlyUsed()) {
mUsageTracker.trackUsage();
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index ce99cc3..b30a1d3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -34,7 +34,7 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
public HotspotTile(Host host) {
super(host);
mController = host.getHotspotController();
- mUsageTracker = new UsageTracker(host.getContext(), HotspotTile.class);
+ mUsageTracker = newUsageTracker(host.getContext());
mUsageTracker.setListening(true);
}
@@ -84,6 +84,10 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
}
}
+ private static UsageTracker newUsageTracker(Context context) {
+ return new UsageTracker(context, HotspotTile.class, R.integer.days_to_show_hotspot_tile);
+ }
+
private final class Callback implements HotspotController.Callback {
@Override
public void onHotspotChanged(boolean enabled) {
@@ -101,7 +105,7 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
@Override
public void onReceive(Context context, Intent intent) {
if (mUsageTracker == null) {
- mUsageTracker = new UsageTracker(context, HotspotTile.class);
+ mUsageTracker = newUsageTracker(context);
}
mUsageTracker.trackUsage();
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 1283dcd..1ca67bc 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -59,7 +59,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
final public static String EXTRA_FROM_HOME = "recents.triggeredOverHome";
final public static String EXTRA_FROM_SEARCH_HOME = "recents.triggeredOverSearchHome";
final public static String EXTRA_FROM_APP_THUMBNAIL = "recents.animatingWithThumbnail";
- final public static String EXTRA_FROM_APP_FULL_SCREENSHOT = "recents.thumbnail";
final public static String EXTRA_FROM_TASK_ID = "recents.activeTaskId";
final public static String EXTRA_TRIGGERED_FROM_ALT_TAB = "recents.triggeredFromAltTab";
final public static String EXTRA_TRIGGERED_FROM_HOME_KEY = "recents.triggeredFromHomeKey";
@@ -74,7 +73,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
final static String sRecentsPackage = "com.android.systemui";
final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity";
- static Bitmap sLastScreenshot;
static RecentsComponent.Callbacks sRecentsComponentCallbacks;
Context mContext;
@@ -256,7 +254,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
public void onConfigurationChanged(Configuration newConfig) {
// Reload the header bar layout
reloadHeaderBarLayout();
- sLastScreenshot = null;
}
/** Prepares the header bar layout. */
@@ -394,20 +391,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
*/
ActivityOptions getThumbnailTransitionActivityOptions(ActivityManager.RunningTaskInfo topTask,
boolean isTopTaskHome) {
- if (Constants.DebugFlags.App.EnableScreenshotAppTransition) {
- // Recycle the last screenshot
- consumeLastScreenshot();
-
- // Take the full screenshot
- sLastScreenshot = mSystemServicesProxy.takeAppScreenshot();
- if (sLastScreenshot != null) {
- mStartAnimationTriggered = false;
- return ActivityOptions.makeCustomAnimation(mContext,
- R.anim.recents_from_app_enter,
- R.anim.recents_from_app_exit, mHandler, this);
- }
- }
-
// Update the destination rect
Task toTask = new Task();
TaskViewTransform toTransform = getThumbnailTransitionTransform(topTask.id, isTopTaskHome,
@@ -493,11 +476,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
// Try starting with a thumbnail transition
ActivityOptions opts = getThumbnailTransitionActivityOptions(topTask, isTopTaskHome);
if (opts != null) {
- if (sLastScreenshot != null) {
- startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_FULL_SCREENSHOT);
- } else {
- startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL);
- }
+ startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_APP_THUMBNAIL);
} else {
// Fall through below to the non-thumbnail transition
useThumbnailTransition = false;
@@ -535,7 +514,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
} else {
// Otherwise we do the normal fade from an unknown source
ActivityOptions opts = getUnknownTransitionActivityOptions();
- startAlternateRecentsActivity(topTask, opts, null);
+ startAlternateRecentsActivity(topTask, opts, EXTRA_FROM_HOME);
}
}
mLastToggleTime = System.currentTimeMillis();
@@ -561,19 +540,6 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
}
}
- /** Returns the last screenshot taken, this will be called by the RecentsActivity. */
- public static Bitmap getLastScreenshot() {
- return sLastScreenshot;
- }
-
- /** Recycles the last screenshot taken, this will be called by the RecentsActivity. */
- public static void consumeLastScreenshot() {
- if (sLastScreenshot != null) {
- sLastScreenshot.recycle();
- sLastScreenshot = null;
- }
- }
-
/** Sets the RecentsComponent callbacks. */
public void setRecentsComponentCallback(RecentsComponent.Callbacks cb) {
sRecentsComponentCallbacks = cb;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Constants.java b/packages/SystemUI/src/com/android/systemui/recents/Constants.java
index 85cf077..9b84d2e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Constants.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Constants.java
@@ -25,8 +25,6 @@ public class Constants {
public static final boolean Verbose = false;
public static class App {
- // Enables the screenshot app->Recents transition
- public static final boolean EnableScreenshotAppTransition = false;
// Enables debug drawing for the transition thumbnail
public static final boolean EnableTransitionThumbnailDebugMode = false;
// Enables the filtering of tasks according to their grouping
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 01ba5a2..1c8f55b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -189,8 +189,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView
AlternateRecentsComponent.EXTRA_FROM_HOME, false);
mConfig.launchedFromAppWithThumbnail = launchIntent.getBooleanExtra(
AlternateRecentsComponent.EXTRA_FROM_APP_THUMBNAIL, false);
- mConfig.launchedFromAppWithScreenshot = launchIntent.getBooleanExtra(
- AlternateRecentsComponent.EXTRA_FROM_APP_FULL_SCREENSHOT, false);
mConfig.launchedToTaskId = launchIntent.getIntExtra(
AlternateRecentsComponent.EXTRA_FROM_TASK_ID, -1);
mConfig.launchedWithAltTab = launchIntent.getBooleanExtra(
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index 2aca576..bfea3f7 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -307,7 +307,6 @@ public class RecentsConfiguration {
launchedWithAltTab = false;
launchedWithNoRecentTasks = false;
launchedFromAppWithThumbnail = false;
- launchedFromAppWithScreenshot = false;
launchedFromHome = false;
launchedToTaskId = -1;
}
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 d2fdaff..421b905 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/AnimateableViewBounds.java
@@ -17,12 +17,10 @@
package com.android.systemui.recents.views;
import android.animation.ObjectAnimator;
-import android.animation.ValueAnimator;
import android.graphics.Outline;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewOutlineProvider;
-
import com.android.systemui.recents.RecentsConfiguration;
/* An outline provider that has a clip and outline that can be animated. */
@@ -31,35 +29,27 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
RecentsConfiguration mConfig;
TaskView mSourceView;
- Rect mTmpRect = new Rect();
Rect mClipRect = new Rect();
Rect mClipBounds = new Rect();
- Rect mOutlineClipRect = new Rect();
int mCornerRadius;
float mAlpha = 1f;
final float mMinAlpha = 0.25f;
- ObjectAnimator mClipTopAnimator;
- ObjectAnimator mClipRightAnimator;
ObjectAnimator mClipBottomAnimator;
public AnimateableViewBounds(TaskView source, int cornerRadius) {
mConfig = RecentsConfiguration.getInstance();
mSourceView = source;
mCornerRadius = cornerRadius;
- setClipTop(getClipTop());
- setClipRight(getClipRight());
setClipBottom(getClipBottom());
- setOutlineClipBottom(getOutlineClipBottom());
}
@Override
public void getOutline(View view, Outline outline) {
outline.setAlpha(mMinAlpha + mAlpha / (1f - mMinAlpha));
- outline.setRoundRect(Math.max(mClipRect.left, mOutlineClipRect.left),
- Math.max(mClipRect.top, mOutlineClipRect.top),
- mSourceView.getWidth() - Math.max(mClipRect.right, mOutlineClipRect.right),
- mSourceView.getHeight() - Math.max(mClipRect.bottom, mOutlineClipRect.bottom),
+ outline.setRoundRect(mClipRect.left, mClipRect.top,
+ mSourceView.getWidth() - mClipRect.right,
+ mSourceView.getHeight() - mClipRect.bottom,
mCornerRadius);
}
@@ -71,73 +61,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
}
}
- /** Animates the top clip. */
- void animateClipTop(int top, int duration, ValueAnimator.AnimatorUpdateListener updateListener) {
- if (mClipTopAnimator != null) {
- mClipTopAnimator.removeAllListeners();
- mClipTopAnimator.cancel();
- }
- mClipTopAnimator = ObjectAnimator.ofInt(this, "clipTop", top);
- mClipTopAnimator.setDuration(duration);
- mClipTopAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
- if (updateListener != null) {
- mClipTopAnimator.addUpdateListener(updateListener);
- }
- mClipTopAnimator.start();
- }
-
- /** Sets the top clip. */
- public void setClipTop(int top) {
- if (top != mClipRect.top) {
- mClipRect.top = top;
- mSourceView.invalidateOutline();
- updateClipBounds();
- }
- }
-
- /** Returns the top clip. */
- public int getClipTop() {
- return mClipRect.top;
- }
-
- /** Animates the right clip. */
- void animateClipRight(int right, int duration) {
- if (mClipRightAnimator != null) {
- mClipRightAnimator.removeAllListeners();
- mClipRightAnimator.cancel();
- }
- mClipRightAnimator = ObjectAnimator.ofInt(this, "clipRight", right);
- mClipRightAnimator.setDuration(duration);
- mClipRightAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
- mClipRightAnimator.start();
- }
-
- /** Sets the right clip. */
- public void setClipRight(int right) {
- if (right != mClipRect.right) {
- mClipRect.right = right;
- mSourceView.invalidateOutline();
- updateClipBounds();
- }
- }
-
- /** Returns the right clip. */
- public int getClipRight() {
- return mClipRect.right;
- }
-
- /** Animates the bottom clip. */
- void animateClipBottom(int bottom, int duration) {
- if (mClipBottomAnimator != null) {
- mClipBottomAnimator.removeAllListeners();
- mClipBottomAnimator.cancel();
- }
- mClipBottomAnimator = ObjectAnimator.ofInt(this, "clipBottom", bottom);
- mClipBottomAnimator.setDuration(duration);
- mClipBottomAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
- mClipBottomAnimator.start();
- }
-
/** Sets the bottom clip. */
public void setClipBottom(int bottom) {
if (bottom != mClipRect.bottom) {
@@ -156,19 +79,6 @@ public class AnimateableViewBounds extends ViewOutlineProvider {
return mClipRect.bottom;
}
- /** Sets the outline bottom clip. */
- public void setOutlineClipBottom(int bottom) {
- if (bottom != mOutlineClipRect.bottom) {
- mOutlineClipRect.bottom = bottom;
- mSourceView.invalidateOutline();
- }
- }
-
- /** Gets the outline bottom clip. */
- public int getOutlineClipBottom() {
- return mOutlineClipRect.bottom;
- }
-
private void updateClipBounds() {
mClipBounds.set(mClipRect.left, mClipRect.top,
mSourceView.getWidth() - mClipRect.right,
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 6c22a3b..9dfebfe 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -18,7 +18,6 @@ package com.android.systemui.recents.views;
import android.app.ActivityOptions;
import android.app.TaskStackBuilder;
-import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -35,7 +34,6 @@ import android.view.WindowInsets;
import android.widget.FrameLayout;
import com.android.systemui.recents.Constants;
import com.android.systemui.recents.RecentsConfiguration;
-import com.android.systemui.recents.misc.Console;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.misc.Utilities;
import com.android.systemui.recents.model.RecentsPackageMonitor;
@@ -339,7 +337,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
View child = getChildAt(i);
if (child != mSearchBar) {
TaskStackView stackView = (TaskStackView) child;
- stackView.focusNextTask(forward);
+ stackView.focusNextTask(forward, true);
break;
}
}
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 40134da..e479952 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -24,7 +24,6 @@ import android.graphics.Rect;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityEvent;
import android.widget.FrameLayout;
import com.android.systemui.R;
@@ -415,7 +414,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
/** Focuses the task at the specified index in the stack */
- void focusTask(int taskIndex, boolean scrollToNewPosition) {
+ void focusTask(int taskIndex, boolean scrollToNewPosition, final boolean animateFocusedState) {
// Return early if the task is already focused
if (taskIndex == mFocusedTaskIndex) return;
@@ -427,7 +426,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
TaskView tv = getChildViewForTask(t);
Runnable postScrollRunnable = null;
if (tv != null) {
- tv.setFocusedTask();
+ tv.setFocusedTask(animateFocusedState);
} else {
postScrollRunnable = new Runnable() {
@Override
@@ -435,7 +434,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
Task t = mStack.getTasks().get(mFocusedTaskIndex);
TaskView tv = getChildViewForTask(t);
if (tv != null) {
- tv.setFocusedTask();
+ tv.setFocusedTask(animateFocusedState);
}
}
};
@@ -455,18 +454,50 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
}
- /** Focuses the next task in the stack */
- void focusNextTask(boolean forward) {
+ /**
+ * Ensures that there is a task focused, if nothign is focused, then we will use the task
+ * at the center of the visible stack.
+ */
+ public boolean ensureFocusedTask() {
+ if (mFocusedTaskIndex < 0) {
+ // If there is no task focused, then find the task that is closes to the center
+ // of the screen and use that as the currently focused task
+ int x = mLayoutAlgorithm.mStackVisibleRect.centerX();
+ int y = mLayoutAlgorithm.mStackVisibleRect.centerY();
+ int childCount = getChildCount();
+ for (int i = childCount - 1; i >= 0; i--) {
+ TaskView tv = (TaskView) getChildAt(i);
+ tv.getHitRect(mTmpRect);
+ if (mTmpRect.contains(x, y)) {
+ mFocusedTaskIndex = mStack.indexOfTask(tv.getTask());
+ break;
+ }
+ }
+ // If we can't find the center task, then use the front most index
+ if (mFocusedTaskIndex < 0 && childCount > 0) {
+ mFocusedTaskIndex = childCount - 1;
+ }
+ }
+ return mFocusedTaskIndex >= 0;
+ }
+
+ /**
+ * Focuses the next task in the stack.
+ * @param animateFocusedState determines whether to actually draw the highlight along with
+ * the change in focus, as well as whether to scroll to fit the
+ * task into view.
+ */
+ public void focusNextTask(boolean forward, boolean animateFocusedState) {
// Find the next index to focus
int numTasks = mStack.getTaskCount();
if (numTasks == 0) return;
- int nextFocusIndex = numTasks - 1;
- if (0 <= mFocusedTaskIndex && mFocusedTaskIndex < numTasks) {
- nextFocusIndex = Math.max(0, Math.min(numTasks - 1,
- mFocusedTaskIndex + (forward ? -1 : 1)));
+ int direction = (forward ? -1 : 1);
+ int newIndex = mFocusedTaskIndex + direction;
+ if (newIndex >= 0 && newIndex <= (numTasks - 1)) {
+ newIndex = Math.max(0, Math.min(numTasks - 1, newIndex));
+ focusTask(newIndex, true, animateFocusedState);
}
- focusTask(nextFocusIndex, true);
}
/** Dismisses the focused task. */
@@ -506,6 +537,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
@Override
+ public boolean onGenericMotionEvent(MotionEvent ev) {
+ return mTouchHandler.onGenericMotionEvent(ev);
+ }
+
+ @Override
public void computeScroll() {
mStackScroller.computeScroll();
// Synchronize the views
@@ -562,22 +598,18 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
TaskView tv = (TaskView) getChildAt(i);
- if (tv.isFullScreenView()) {
- tv.measure(widthMeasureSpec, heightMeasureSpec);
+ if (tv.getBackground() != null) {
+ tv.getBackground().getPadding(mTmpRect);
} else {
- if (tv.getBackground() != null) {
- tv.getBackground().getPadding(mTmpRect);
- } else {
- mTmpRect.setEmpty();
- }
- tv.measure(
- MeasureSpec.makeMeasureSpec(
- mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,
- MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(
- mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom +
- tv.getMaxFooterHeight(), MeasureSpec.EXACTLY));
+ mTmpRect.setEmpty();
}
+ tv.measure(
+ MeasureSpec.makeMeasureSpec(
+ mLayoutAlgorithm.mTaskRect.width() + mTmpRect.left + mTmpRect.right,
+ MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(
+ mLayoutAlgorithm.mTaskRect.height() + mTmpRect.top + mTmpRect.bottom,
+ MeasureSpec.EXACTLY));
}
setMeasuredDimension(width, height);
@@ -594,20 +626,15 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
TaskView tv = (TaskView) getChildAt(i);
- if (tv.isFullScreenView()) {
- tv.layout(left, top, left + tv.getMeasuredWidth(), top + tv.getMeasuredHeight());
+ if (tv.getBackground() != null) {
+ tv.getBackground().getPadding(mTmpRect);
} else {
- if (tv.getBackground() != null) {
- tv.getBackground().getPadding(mTmpRect);
- } else {
- mTmpRect.setEmpty();
- }
- tv.layout(mLayoutAlgorithm.mTaskRect.left - mTmpRect.left,
- mLayoutAlgorithm.mTaskRect.top - mTmpRect.top,
- mLayoutAlgorithm.mTaskRect.right + mTmpRect.right,
- mLayoutAlgorithm.mTaskRect.bottom + mTmpRect.bottom +
- tv.getMaxFooterHeight());
+ mTmpRect.setEmpty();
}
+ tv.layout(mLayoutAlgorithm.mTaskRect.left - mTmpRect.left,
+ mLayoutAlgorithm.mTaskRect.top - mTmpRect.top,
+ mLayoutAlgorithm.mTaskRect.right + mTmpRect.right,
+ mLayoutAlgorithm.mTaskRect.bottom + mTmpRect.bottom);
}
if (mAwaitingFirstLayout) {
@@ -653,9 +680,9 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
// When Alt-Tabbing, we scroll to and focus the previous task
if (mConfig.launchedWithAltTab) {
if (mConfig.launchedFromHome) {
- focusTask(Math.max(0, mStack.getTaskCount() - 1), false);
+ focusTask(Math.max(0, mStack.getTaskCount() - 1), false, true);
} else {
- focusTask(Math.max(0, mStack.getTaskCount() - 2), false);
+ focusTask(Math.max(0, mStack.getTaskCount() - 2), false, true);
}
}
}
@@ -811,6 +838,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
TaskView frontTv = getChildViewForTask(newFrontMostTask);
if (frontTv != null) {
frontTv.onTaskBound(newFrontMostTask);
+ frontTv.fadeInActionButton(false);
}
}
@@ -923,13 +951,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
// Rebind the task and request that this task's data be filled into the TaskView
tv.onTaskBound(task);
- // Mark the launch task as fullscreen
- if (Constants.DebugFlags.App.EnableScreenshotAppTransition && mAwaitingFirstLayout) {
- if (task.isLaunchTarget) {
- tv.setIsFullScreen(true);
- }
- }
-
// Load the task data
RecentsTaskLoader.getInstance().loadTaskData(task);
@@ -1018,14 +1039,18 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
tv.getTask().activityLabel));
// Remove the task from the view
mStack.removeTask(task);
- // If the dismissed task was focused, then we should focus the next task in front
+ // If the dismissed task was focused, then we should focus the new task in the same index
if (taskWasFocused) {
ArrayList<Task> tasks = mStack.getTasks();
- int nextTaskIndex = Math.min(tasks.size() - 1, taskIndex);
+ int nextTaskIndex = Math.min(tasks.size() - 1, taskIndex - 1);
if (nextTaskIndex >= 0) {
Task nextTask = tasks.get(nextTaskIndex);
TaskView nextTv = getChildViewForTask(nextTask);
- nextTv.setFocusedTask();
+ if (nextTv != null) {
+ // Focus the next task, and only animate the visible state if we are launched
+ // from Alt-Tab
+ nextTv.setFocusedTask(mConfig.launchedWithAltTab);
+ }
}
}
}
@@ -1038,11 +1063,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
@Override
- public void onTaskViewFullScreenTransitionCompleted() {
- requestSynchronizeStackViewsWithModel();
- }
-
- @Override
public void onTaskViewFocusChanged(TaskView tv, boolean focused) {
if (focused) {
mFocusedTaskIndex = mStack.indexOfTask(tv.getTask());
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java
index 31fc701..c549d2b 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewLayoutAlgorithm.java
@@ -199,18 +199,14 @@ public class TaskStackViewLayoutAlgorithm {
return transformOut;
}
- /**
- * Returns the untransformed task view size.
- */
+ /** Returns the untransformed task view size. */
public Rect getUntransformedTaskViewSize() {
Rect tvSize = new Rect(mTaskRect);
tvSize.offsetTo(0, 0);
return tvSize;
}
- /**
- * Returns the scroll to such task top = 1f;
- */
+ /** Returns the scroll to such task top = 1f; */
float getStackScrollForTask(Task t) {
return mTaskProgressMap.get(t.key);
}
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 5852b88..c9113fe 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewScroller.java
@@ -38,6 +38,7 @@ public class TaskStackViewScroller {
OverScroller mScroller;
ObjectAnimator mScrollAnimator;
+ float mFinalAnimatedScroll;
public TaskStackViewScroller(Context context, RecentsConfiguration config, TaskStackViewLayoutAlgorithm layoutAlgorithm) {
mConfig = config;
@@ -128,10 +129,15 @@ public class TaskStackViewScroller {
/** Animates the stack scroll */
void animateScroll(float curScroll, float newScroll, final Runnable postRunnable) {
- // Abort any current animations
+ // Finish any current scrolling animations
+ if (mScrollAnimator != null && mScrollAnimator.isRunning()) {
+ setStackScroll(mFinalAnimatedScroll);
+ mScroller.startScroll(0, progressToScrollRange(mFinalAnimatedScroll), 0, 0, 0);
+ }
stopScroller();
stopBoundScrollAnimation();
+ mFinalAnimatedScroll = newScroll;
mScrollAnimator = ObjectAnimator.ofFloat(this, "stackScroll", curScroll, newScroll);
mScrollAnimator.setDuration(mConfig.taskStackScrollDuration);
mScrollAnimator.setInterpolator(mConfig.linearOutSlowInInterpolator);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
index 8f9b4c2..2b173a9 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java
@@ -17,6 +17,7 @@
package com.android.systemui.recents.views;
import android.content.Context;
+import android.view.InputDevice;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
@@ -189,7 +190,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
/** Handles touch events once we have intercepted them */
public boolean onTouchEvent(MotionEvent ev) {
-
// Short circuit if we have no children
boolean hasChildren = (mSv.getChildCount() > 0);
if (!hasChildren) {
@@ -336,6 +336,30 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
return true;
}
+ /** Handles generic motion events */
+ public boolean onGenericMotionEvent(MotionEvent ev) {
+ if ((ev.getSource() & InputDevice.SOURCE_CLASS_POINTER) ==
+ InputDevice.SOURCE_CLASS_POINTER) {
+ int action = ev.getAction();
+ switch (action & MotionEvent.ACTION_MASK) {
+ case MotionEvent.ACTION_SCROLL:
+ // Find the front most task and scroll the next task to the front
+ float vScroll = ev.getAxisValue(MotionEvent.AXIS_VSCROLL);
+ if (vScroll > 0) {
+ if (mSv.ensureFocusedTask()) {
+ mSv.focusNextTask(true, false);
+ }
+ } else {
+ if (mSv.ensureFocusedTask()) {
+ mSv.focusNextTask(false, false);
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
/**** SwipeHelper Implementation ****/
@Override
@@ -355,8 +379,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
tv.setClipViewInStack(false);
// Disallow touch events from this task view
tv.setTouchEnabled(false);
- // Hide the footer
- tv.animateFooterVisibility(false, mSv.mConfig.taskViewLockToAppShortAnimDuration);
// Disallow parents from intercepting touch events
final ViewParent parent = mSv.getParent();
if (parent != null) {
@@ -387,8 +409,6 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback {
tv.setClipViewInStack(true);
// Re-enable touch events from this task view
tv.setTouchEnabled(true);
- // Restore the footer
- tv.animateFooterVisibility(true, mSv.mConfig.taskViewLockToAppShortAnimDuration);
}
@Override
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 2658176..dfb30f3 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -21,11 +21,10 @@ import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.*;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
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;
@@ -34,10 +33,11 @@ import com.android.systemui.recents.Constants;
import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.model.RecentsTaskLoader;
import com.android.systemui.recents.model.Task;
+import com.android.systemui.statusbar.phone.PhoneStatusBar;
/* A task view */
public class TaskView extends FrameLayout implements Task.TaskCallbacks,
- TaskViewFooter.TaskFooterViewCallbacks, View.OnClickListener, View.OnLongClickListener {
+ View.OnClickListener, View.OnLongClickListener {
/** The TaskView callbacks */
interface TaskViewCallbacks {
@@ -46,7 +46,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
public void onTaskViewClicked(TaskView tv, Task task, boolean lockToTask);
public void onTaskViewDismissed(TaskView tv);
public void onTaskViewClipStateChanged(TaskView tv);
- public void onTaskViewFullScreenTransitionCompleted();
public void onTaskViewFocusChanged(TaskView tv, boolean focused);
}
@@ -64,7 +63,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
boolean mTaskDataLoaded;
boolean mIsFocused;
boolean mFocusAnimationsEnabled;
- boolean mIsFullScreenView;
boolean mClipViewInStack;
AnimateableViewBounds mViewBounds;
Paint mLayerPaint = new Paint();
@@ -72,7 +70,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
View mContent;
TaskViewThumbnail mThumbnailView;
TaskViewHeader mHeaderView;
- TaskViewFooter mFooterView;
View mActionButtonView;
TaskViewCallbacks mCb;
@@ -142,9 +139,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
outline.setOval(0, 0, mActionButtonView.getWidth(), mActionButtonView.getHeight());
}
});
- if (mFooterView != null) {
- mFooterView.setCallbacks(this);
- }
}
@Override
@@ -159,29 +153,16 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mContent.measure(MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY));
- // Measure the bar view, thumbnail, and footer
+ // Measure the bar view, and action button
mHeaderView.measure(MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(mConfig.taskBarHeight, MeasureSpec.EXACTLY));
- if (mFooterView != null) {
- mFooterView.measure(
- MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(mConfig.taskViewLockToAppButtonHeight,
- MeasureSpec.EXACTLY));
- }
mActionButtonView.measure(
MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.AT_MOST),
MeasureSpec.makeMeasureSpec(heightWithoutPadding, MeasureSpec.AT_MOST));
- if (mIsFullScreenView) {
- // Measure the thumbnail height to be the full dimensions
- mThumbnailView.measure(
- MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(heightWithoutPadding, MeasureSpec.EXACTLY));
- } else {
- // Measure the thumbnail to be square
- mThumbnailView.measure(
- MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY));
- }
+ // Measure the thumbnail to be square
+ mThumbnailView.measure(
+ MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY),
+ MeasureSpec.makeMeasureSpec(widthWithoutPadding, MeasureSpec.EXACTLY));
setMeasuredDimension(width, height);
invalidateOutline();
}
@@ -193,16 +174,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
void updateViewPropertiesToTaskTransform(TaskViewTransform toTransform, int duration,
ValueAnimator.AnimatorUpdateListener updateCallback) {
- // If we are a full screen view, then only update the Z to keep it in order
- // XXX: Also update/animate the dim as well
- if (mIsFullScreenView) {
- if (!mConfig.fakeShadows &&
- toTransform.hasTranslationZChangedFrom(getTranslationZ())) {
- setTranslationZ(toTransform.translationZ);
- }
- return;
- }
-
// Apply the transform
toTransform.applyToTaskView(this, duration, mConfig.fastOutSlowInInterpolator, false,
!mConfig.fakeShadows, updateCallback);
@@ -253,22 +224,12 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
void prepareEnterRecentsAnimation(boolean isTaskViewLaunchTargetTask,
boolean occludesLaunchTarget, int offscreenY) {
int initialDim = getDim();
- if (mConfig.launchedFromAppWithScreenshot) {
+ if (mConfig.launchedFromAppWithThumbnail) {
if (isTaskViewLaunchTargetTask) {
- // Hide the footer during the transition in, and animate it out afterwards?
- if (mFooterView != null) {
- mFooterView.animateFooterVisibility(false, 0);
- }
- } else {
- // Don't do anything for the side views when animating in
- }
-
- } else if (mConfig.launchedFromAppWithThumbnail) {
- if (isTaskViewLaunchTargetTask) {
- // Hide the action button if it exists
- mActionButtonView.setAlpha(0f);
// Set the dim to 0 so we can animate it in
initialDim = 0;
+ // Hide the action button
+ mActionButtonView.setAlpha(0f);
} else if (occludesLaunchTarget) {
// Move the task view off screen (below) so we can animate it in
setTranslationY(offscreenY);
@@ -292,74 +253,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
final TaskViewTransform transform = ctx.currentTaskTransform;
int startDelay = 0;
- if (mConfig.launchedFromAppWithScreenshot) {
- if (mTask.isLaunchTarget) {
- Rect taskRect = ctx.currentTaskRect;
- int duration = mConfig.taskViewEnterFromHomeDuration * 10;
- int windowInsetTop = mConfig.systemInsets.top; // XXX: Should be for the window
- float taskScale = ((float) taskRect.width() / getMeasuredWidth()) * transform.scale;
- float scaledYOffset = ((1f - taskScale) * getMeasuredHeight()) / 2;
- float scaledWindowInsetTop = (int) (taskScale * windowInsetTop);
- float scaledTranslationY = taskRect.top + transform.translationY -
- (scaledWindowInsetTop + scaledYOffset);
- startDelay = mConfig.taskViewEnterFromHomeStaggerDelay;
-
- // Animate the top clip
- mViewBounds.animateClipTop(windowInsetTop, duration,
- new ValueAnimator.AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- int y = (Integer) animation.getAnimatedValue();
- mHeaderView.setTranslationY(y);
- }
- });
- // Animate the bottom or right clip
- int size = Math.round((taskRect.width() / taskScale));
- if (mConfig.hasHorizontalLayout()) {
- mViewBounds.animateClipRight(getMeasuredWidth() - size, duration);
- } else {
- mViewBounds.animateClipBottom(getMeasuredHeight() - (windowInsetTop + size), duration);
- }
- // Animate the task bar of the first task view
- animate()
- .scaleX(taskScale)
- .scaleY(taskScale)
- .translationY(scaledTranslationY)
- .setDuration(duration)
- .withEndAction(new Runnable() {
- @Override
- public void run() {
- setIsFullScreen(false);
- requestLayout();
-
- // Reset the clip
- mViewBounds.setClipTop(0);
- mViewBounds.setClipBottom(0);
- mViewBounds.setClipRight(0);
- // Reset the bar translation
- mHeaderView.setTranslationY(0);
- // Animate the footer into view (if it is the front most task)
- animateFooterVisibility(true, mConfig.taskBarEnterAnimDuration);
-
- // Unbind the thumbnail from the screenshot
- RecentsTaskLoader.getInstance().loadTaskData(mTask);
- // Recycle the full screen screenshot
- AlternateRecentsComponent.consumeLastScreenshot();
-
- mCb.onTaskViewFullScreenTransitionCompleted();
-
- // Decrement the post animation trigger
- ctx.postAnimationTrigger.decrement();
- }
- })
- .start();
- } else {
- // Animate the footer into view
- animateFooterVisibility(true, 0);
- }
- ctx.postAnimationTrigger.increment();
-
- } else if (mConfig.launchedFromAppWithThumbnail) {
+ if (mConfig.launchedFromAppWithThumbnail) {
if (mTask.isLaunchTarget) {
// Animate the dim/overlay
if (Constants.DebugFlags.App.EnableThumbnailAlphaOnFrontmost) {
@@ -381,16 +275,8 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
}
ctx.postAnimationTrigger.increment();
- // Animate the footer into view
- animateFooterVisibility(true, mConfig.taskBarEnterAnimDuration);
-
// Animate the action button in
- mActionButtonView.animate().alpha(1f)
- .setStartDelay(mConfig.taskBarEnterAnimDelay)
- .setDuration(mConfig.taskBarEnterAnimDuration)
- .setInterpolator(mConfig.fastOutLinearInInterpolator)
- .withLayer()
- .start();
+ fadeInActionButton(true);
} else {
// Animate the task up if it was occluding the launch target
if (ctx.currentTaskOccludesLaunchTarget) {
@@ -442,14 +328,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
})
.start();
ctx.postAnimationTrigger.increment();
-
- // Animate the footer into view
- animateFooterVisibility(true, mConfig.taskViewEnterFromHomeDuration);
startDelay = delay;
-
- } else {
- // Animate the footer into view
- animateFooterVisibility(true, 0);
}
// Enable the focus animations from this point onwards so that they aren't affected by the
@@ -462,6 +341,21 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
}, (startDelay / 2));
}
+ public void fadeInActionButton(boolean withDelay) {
+ // Hide the action button
+ mActionButtonView.setAlpha(0f);
+
+ // Animate the action button in
+ ViewPropertyAnimator animator = mActionButtonView.animate().alpha(1f)
+ .setDuration(mConfig.taskBarEnterAnimDuration)
+ .setInterpolator(PhoneStatusBar.ALPHA_IN)
+ .withLayer();
+ if (withDelay) {
+ animator.setStartDelay(mConfig.taskBarEnterAnimDelay);
+ }
+ animator.start();
+ }
+
/** Animates this task view as it leaves recents by pressing home. */
void startExitToHomeAnimation(ViewAnimation.TaskViewExitContext ctx) {
animate()
@@ -569,23 +463,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mCb.onTaskViewDismissed(tv);
}
});
- // Hide the footer
- animateFooterVisibility(false, mConfig.taskViewRemoveAnimDuration);
- }
-
- /** Sets whether this task view is full screen or not. */
- void setIsFullScreen(boolean isFullscreen) {
- mIsFullScreenView = isFullscreen;
- mHeaderView.setIsFullscreen(isFullscreen);
- if (isFullscreen) {
- // If we are full screen, then disable the bottom outline clip for the footer
- mViewBounds.setOutlineClipBottom(0);
- }
- }
-
- /** Returns whether this task view should currently be drawn as a full screen view. */
- boolean isFullScreenView() {
- return mIsFullScreenView;
}
/**
@@ -593,7 +470,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
* view.
*/
boolean shouldClipViewInStack() {
- return mClipViewInStack && !mIsFullScreenView && (getVisibility() == View.VISIBLE);
+ return mClipViewInStack && (getVisibility() == View.VISIBLE);
}
/** Sets whether this view should be clipped, or clipped against. */
@@ -604,27 +481,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
}
}
- /** Gets the max footer height. */
- public int getMaxFooterHeight() {
- if (mFooterView != null) {
- return mFooterView.mMaxFooterHeight;
- } else {
- return 0;
- }
- }
-
- /** Animates the footer into and out of view. */
- void animateFooterVisibility(boolean visible, int duration) {
- // Hide the footer if we are a full screen view
- if (mIsFullScreenView) return;
- // Hide the footer if the current task can not be locked to
- if (!mTask.lockToTaskEnabled || !mTask.lockToThisTask) return;
- // Otherwise, animate the visibility
- if (mFooterView != null) {
- mFooterView.animateFooterVisibility(visible, duration);
- }
- }
-
/** Sets the current task progress. */
public void setTaskProgress(float p) {
mTaskProgress = p;
@@ -706,11 +562,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
* if the view is not currently visible, or we are in touch state (where we still want to keep
* track of focus).
*/
- public void setFocusedTask() {
+ public void setFocusedTask(boolean animateFocusedState) {
mIsFocused = true;
if (mFocusAnimationsEnabled) {
// Focus the header bar
- mHeaderView.onTaskViewFocusChanged(true);
+ mHeaderView.onTaskViewFocusChanged(true, animateFocusedState);
}
// Update the thumbnail alpha with the focus
mThumbnailView.onFocusChanged(true);
@@ -732,7 +588,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mIsFocused = false;
if (mFocusAnimationsEnabled) {
// Un-focus the header bar
- mHeaderView.onTaskViewFocusChanged(false);
+ mHeaderView.onTaskViewFocusChanged(false, true);
}
// Update the thumbnail alpha with the focus
@@ -766,7 +622,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
mFocusAnimationsEnabled = true;
if (mIsFocused && !wasFocusAnimationsEnabled) {
// Re-notify the header if we were focused and animations were not previously enabled
- mHeaderView.onTaskViewFocusChanged(true);
+ mHeaderView.onTaskViewFocusChanged(true, true);
}
}
@@ -776,15 +632,12 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
public void onTaskBound(Task t) {
mTask = t;
mTask.setCallbacks(this);
- if (getMeasuredWidth() == 0) {
- // If we haven't yet measured, we should just set the footer height with any animation
- animateFooterVisibility(t.lockToThisTask, 0);
- } else {
- animateFooterVisibility(t.lockToThisTask, mConfig.taskViewLockToAppLongAnimDuration);
- }
- // Hide the action button if lock to app is disabled
- if (!t.lockToTaskEnabled && mActionButtonView.getVisibility() != View.GONE) {
- mActionButtonView.setVisibility(View.GONE);
+
+ // Hide the action button if lock to app is disabled for this view
+ int lockButtonVisibility = (!t.lockToTaskEnabled || !t.lockToThisTask) ? GONE : VISIBLE;
+ if (mActionButtonView.getVisibility() != lockButtonVisibility) {
+ mActionButtonView.setVisibility(lockButtonVisibility);
+ requestLayout();
}
}
@@ -792,18 +645,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
public void onTaskDataLoaded() {
if (mThumbnailView != null && mHeaderView != null) {
// Bind each of the views to the new task data
- if (mIsFullScreenView) {
- mThumbnailView.bindToScreenshot(AlternateRecentsComponent.getLastScreenshot());
- } else {
- mThumbnailView.rebindToTask(mTask);
- }
+ mThumbnailView.rebindToTask(mTask);
mHeaderView.rebindToTask(mTask);
// Rebind any listeners
mHeaderView.mApplicationIcon.setOnClickListener(this);
mHeaderView.mDismissButton.setOnClickListener(this);
- if (mFooterView != null) {
- mFooterView.setOnClickListener(this);
- }
mActionButtonView.setOnClickListener(this);
if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
if (mConfig.developerOptionsEnabled) {
@@ -824,9 +670,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Unbind any listeners
mHeaderView.mApplicationIcon.setOnClickListener(null);
mHeaderView.mDismissButton.setOnClickListener(null);
- if (mFooterView != null) {
- mFooterView.setOnClickListener(null);
- }
mActionButtonView.setOnClickListener(null);
if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) {
mHeaderView.mApplicationIcon.setOnLongClickListener(null);
@@ -840,19 +683,6 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
setOnClickListener(enabled ? this : null);
}
- /**** TaskViewFooter.TaskFooterViewCallbacks ****/
-
- @Override
- public void onTaskFooterHeightChanged(int height, int maxHeight) {
- if (mIsFullScreenView) {
- // Disable the bottom outline clip when fullscreen
- mViewBounds.setOutlineClipBottom(0);
- } else {
- // Update the bottom clip in our outline provider
- mViewBounds.setOutlineClipBottom(maxHeight - height);
- }
- }
-
/**** View.OnClickListener Implementation ****/
@Override
@@ -876,8 +706,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
// Reset the translation of the action button before we animate it out
mActionButtonView.setTranslationZ(0f);
}
- mCb.onTaskViewClicked(tv, tv.getTask(),
- (v == mFooterView || v == mActionButtonView));
+ mCb.onTaskViewClicked(tv, tv.getTask(), (v == mActionButtonView));
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewFooter.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewFooter.java
deleted file mode 100644
index 324169e..0000000
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewFooter.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.recents.views;
-
-import android.animation.ObjectAnimator;
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.FrameLayout;
-import com.android.systemui.recents.RecentsConfiguration;
-
-
-/** The task footer view */
-public class TaskViewFooter extends FrameLayout {
-
- interface TaskFooterViewCallbacks {
- public void onTaskFooterHeightChanged(int height, int maxHeight);
- }
-
- RecentsConfiguration mConfig;
-
- TaskFooterViewCallbacks mCb;
- int mFooterHeight;
- int mMaxFooterHeight;
- ObjectAnimator mFooterAnimator;
-
- public TaskViewFooter(Context context) {
- this(context, null);
- }
-
- public TaskViewFooter(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public TaskViewFooter(Context context, AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, 0);
- }
-
- public TaskViewFooter(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- mConfig = RecentsConfiguration.getInstance();
- mMaxFooterHeight = mConfig.taskViewLockToAppButtonHeight;
- setFooterHeight(getFooterHeight());
- }
-
- /** Sets the callbacks for when the footer height changes. */
- void setCallbacks(TaskFooterViewCallbacks cb) {
- mCb = cb;
- mCb.onTaskFooterHeightChanged(mFooterHeight, mMaxFooterHeight);
- }
-
- /** Sets the footer height. */
- public void setFooterHeight(int footerHeight) {
- if (footerHeight != mFooterHeight) {
- mFooterHeight = footerHeight;
- mCb.onTaskFooterHeightChanged(footerHeight, mMaxFooterHeight);
- }
- }
-
- /** Gets the footer height. */
- public int getFooterHeight() {
- return mFooterHeight;
- }
-
- /** Animates the footer into and out of view. */
- void animateFooterVisibility(final boolean visible, int duration) {
- // Return early if there is no footer
- if (mMaxFooterHeight <= 0) return;
-
- // Cancel the previous animation
- if (mFooterAnimator != null) {
- mFooterAnimator.removeAllListeners();
- mFooterAnimator.cancel();
- }
- int finalHeight = visible ? mMaxFooterHeight : 0;
- if (duration > 0) {
- mFooterAnimator = ObjectAnimator.ofInt(this, "footerHeight", finalHeight);
- mFooterAnimator.setDuration(duration);
- mFooterAnimator.setInterpolator(mConfig.fastOutSlowInInterpolator);
- mFooterAnimator.start();
- } else {
- setFooterHeight(finalHeight);
- }
- }
-}
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 396d441..6554f82 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java
@@ -66,10 +66,8 @@ public class TaskViewHeader extends FrameLayout {
Drawable mLightDismissDrawable;
Drawable mDarkDismissDrawable;
AnimatorSet mFocusAnimator;
- ValueAnimator backgroundColorAnimator;
PorterDuffColorFilter mDimFilter = new PorterDuffColorFilter(0, PorterDuff.Mode.SRC_ATOP);
- boolean mIsFullscreen;
boolean mCurrentPrimaryColorIsDark;
int mCurrentPrimaryColor;
@@ -159,21 +157,14 @@ public class TaskViewHeader extends FrameLayout {
@Override
protected void onDraw(Canvas canvas) {
- if (!mIsFullscreen) {
- // Draw the highlight at the top edge (but put the bottom edge just out of view)
- float offset = (float) Math.ceil(mConfig.taskViewHighlightPx / 2f);
- float radius = mConfig.taskViewRoundedCornerRadiusPx;
- int count = canvas.save(Canvas.CLIP_SAVE_FLAG);
- canvas.clipRect(0, 0, getMeasuredWidth(), getMeasuredHeight());
- canvas.drawRoundRect(-offset, 0f, (float) getMeasuredWidth() + offset,
- getMeasuredHeight() + radius, radius, radius, sHighlightPaint);
- canvas.restoreToCount(count);
- }
- }
-
- /** Sets whether the current task is full screen or not. */
- void setIsFullscreen(boolean isFullscreen) {
- mIsFullscreen = isFullscreen;
+ // Draw the highlight at the top edge (but put the bottom edge just out of view)
+ float offset = (float) Math.ceil(mConfig.taskViewHighlightPx / 2f);
+ float radius = mConfig.taskViewRoundedCornerRadiusPx;
+ int count = canvas.save(Canvas.CLIP_SAVE_FLAG);
+ canvas.clipRect(0, 0, getMeasuredWidth(), getMeasuredHeight());
+ canvas.drawRoundRect(-offset, 0f, (float) getMeasuredWidth() + offset,
+ getMeasuredHeight() + radius, radius, radius, sHighlightPaint);
+ canvas.restoreToCount(count);
}
@Override
@@ -268,13 +259,17 @@ public class TaskViewHeader extends FrameLayout {
}
/** Notifies the associated TaskView has been focused. */
- void onTaskViewFocusChanged(boolean focused) {
+ void onTaskViewFocusChanged(boolean focused, boolean animateFocusedState) {
+ // If we are not animating the visible state, just return
+ if (!animateFocusedState) return;
+
boolean isRunning = false;
if (mFocusAnimator != null) {
isRunning = mFocusAnimator.isRunning();
mFocusAnimator.removeAllListeners();
mFocusAnimator.cancel();
}
+
if (focused) {
int secondaryColor = getSecondaryColor(mCurrentPrimaryColor, mCurrentPrimaryColorIsDark);
int[][] states = new int[][] {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 650a14f..40c9134 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -36,6 +36,8 @@ import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
import com.android.systemui.statusbar.policy.UserInfoController;
+import java.text.NumberFormat;
+
/**
* The header group on Keyguard.
*/
@@ -150,7 +152,8 @@ public class KeyguardStatusBarView extends RelativeLayout
@Override
public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) {
- mBatteryLevel.setText(getResources().getString(R.string.battery_level_template, level));
+ String percentage = NumberFormat.getPercentInstance().format((double) level / 100.0);
+ mBatteryLevel.setText(percentage);
boolean changed = mBatteryCharging != charging;
mBatteryCharging = charging;
if (changed) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 9e3f0f6..4980c1c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -40,6 +40,7 @@ import android.app.Notification;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.content.BroadcastReceiver;
+import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -95,6 +96,7 @@ import android.view.ViewPropertyAnimator;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
+import android.view.WindowManagerGlobal;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AccelerateDecelerateInterpolator;
@@ -2413,6 +2415,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
showBouncer();
disable(mDisabledUnmodified, true /* animate */);
+
+ // Trimming will happen later if Keyguard is showing - doing it here might cause a jank in
+ // the bouncer appear animation.
+ if (!mStatusBarKeyguardViewManager.isShowing()) {
+ WindowManagerGlobal.getInstance().trimMemory(ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
+ }
}
public boolean interceptTouchEvent(MotionEvent event) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index b0f3ea1..ca853a9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -48,6 +48,8 @@ import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.NextAlarmController;
import com.android.systemui.statusbar.policy.UserInfoController;
+import java.text.NumberFormat;
+
/**
* The view to manage the header area in the expanded status bar.
*/
@@ -395,7 +397,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
@Override
public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) {
- mBatteryLevel.setText(getResources().getString(R.string.battery_level_template, level));
+ String percentage = NumberFormat.getPercentInstance().format((double) level / 100.0);
+ mBatteryLevel.setText(percentage);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index 55c861a..65d231e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.phone;
+import android.content.ComponentCallbacks2;
import android.content.Context;
import android.os.Bundle;
import android.os.RemoteException;
@@ -24,6 +25,7 @@ import android.util.Slog;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManagerGlobal;
import com.android.internal.policy.IKeyguardShowCallback;
import com.android.internal.widget.LockPatternUtils;
@@ -268,6 +270,8 @@ public class StatusBarKeyguardViewManager {
public void run() {
mStatusBarWindowManager.setKeyguardFadingAway(false);
mPhoneStatusBar.finishKeyguardFadingAway();
+ WindowManagerGlobal.getInstance().trimMemory(
+ ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN);
}
});
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java
index dcda2c7..b89aa8f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/TrustDrawable.java
@@ -133,6 +133,7 @@ public class TrustDrawable extends Drawable {
if (!mAnimating) {
mAnimating = true;
updateState(true);
+ invalidateSelf();
}
}
@@ -146,18 +147,21 @@ public class TrustDrawable extends Drawable {
mState = STATE_UNSET;
mCurAlpha = 0;
mCurInnerRadius = mInnerRadiusEnter;
+ invalidateSelf();
}
}
public void setTrustManaged(boolean trustManaged) {
if (trustManaged == mTrustManaged && mState != STATE_UNSET) return;
mTrustManaged = trustManaged;
- if (mAnimating) {
- updateState(true);
- }
+ updateState(true);
}
- private void updateState(boolean animate) {
+ private void updateState(boolean allowTransientState) {
+ if (!mAnimating) {
+ return;
+ }
+
int nextState = mState;
if (mState == STATE_UNSET) {
nextState = mTrustManaged ? STATE_ENTERING : STATE_GONE;
@@ -170,7 +174,7 @@ public class TrustDrawable extends Drawable {
} else if (mState == STATE_EXITING) {
if (mTrustManaged) nextState = STATE_ENTERING;
}
- if (!animate) {
+ if (!allowTransientState) {
if (nextState == STATE_ENTERING) nextState = STATE_VISIBLE;
if (nextState == STATE_EXITING) nextState = STATE_GONE;
}
@@ -200,9 +204,8 @@ public class TrustDrawable extends Drawable {
mState = nextState;
if (mCurAnimator != null) {
mCurAnimator.start();
- } else {
- invalidateSelf();
}
+ invalidateSelf();
}
}