summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-06-18 00:59:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-06-17 20:49:29 +0000
commit12758423770455f75fede0cb47d743ea18640f2f (patch)
treedcf455029b9ff4e4851cbe16aa492eceaf7edb5b /packages
parent90dcb6257557d6f62f862a84833b364f23490b4d (diff)
parente0e45bc26d02e2c6ec505ea006e7487f3a5bddc5 (diff)
downloadframeworks_base-12758423770455f75fede0cb47d743ea18640f2f.zip
frameworks_base-12758423770455f75fede0cb47d743ea18640f2f.tar.gz
frameworks_base-12758423770455f75fede0cb47d743ea18640f2f.tar.bz2
Merge "Re-enabling task based filtering in Recents using package name."
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/drawable/recents_button_bg.xml18
-rw-r--r--packages/SystemUI/res/layout/recents_task_view.xml4
-rw-r--r--packages/SystemUI/res/values/config.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/Constants.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java78
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java13
8 files changed, 86 insertions, 53 deletions
diff --git a/packages/SystemUI/res/drawable/recents_button_bg.xml b/packages/SystemUI/res/drawable/recents_button_bg.xml
new file mode 100644
index 0000000..a4cb088
--- /dev/null
+++ b/packages/SystemUI/res/drawable/recents_button_bg.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?android:attr/colorControlHighlight" /> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/recents_task_view.xml b/packages/SystemUI/res/layout/recents_task_view.xml
index e4d7b0c..1bab67a 100644
--- a/packages/SystemUI/res/layout/recents_task_view.xml
+++ b/packages/SystemUI/res/layout/recents_task_view.xml
@@ -34,7 +34,8 @@
android:layout_height="@dimen/recents_task_view_application_icon_size"
android:layout_marginStart="8dp"
android:layout_gravity="center_vertical|start"
- android:padding="8dp" />
+ android:padding="8dp"
+ android:background="@drawable/recents_button_bg" />
<TextView
android:id="@+id/activity_description"
android:layout_width="match_parent"
@@ -57,6 +58,7 @@
android:layout_marginEnd="4dp"
android:layout_gravity="center_vertical|end"
android:padding="18dp"
+ android:background="@drawable/recents_button_bg"
android:visibility="invisible"
android:src="@drawable/recents_dismiss_light" />
</com.android.systemui.recents.views.TaskBarView>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index c8851dc..c64a182 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -111,9 +111,9 @@
<!-- The duration in seconds to wait before the dismiss buttons are shown. -->
<integer name="recents_task_bar_dismiss_delay_seconds">3</integer>
<!-- The min animation duration for animating views that are currently visible. -->
- <integer name="recents_filter_animate_current_views_min_duration">175</integer>
+ <integer name="recents_filter_animate_current_views_duration">250</integer>
<!-- The min animation duration for animating views that are newly visible. -->
- <integer name="recents_filter_animate_new_views_min_duration">125</integer>
+ <integer name="recents_filter_animate_new_views_duration">250</integer>
<!-- The min animation duration for animating the task bar in. -->
<integer name="recents_animate_task_bar_enter_duration">275</integer>
<!-- The animation delay for animating the first task in. This should roughly be the animation
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Constants.java b/packages/SystemUI/src/com/android/systemui/recents/Constants.java
index 53a4b10..ddea0bf 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Constants.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Constants.java
@@ -30,7 +30,7 @@ public class Constants {
// Enables the screenshot app->Recents transition
public static final boolean EnableScreenshotAppTransition = false;
// Enables the filtering of tasks according to their grouping
- public static final boolean EnableTaskFiltering = false;
+ public static final boolean EnableTaskFiltering = true;
// Enables clipping of tasks against each other
public static final boolean EnableTaskStackClipping = true;
// Enables the use of theme colors as the task bar background
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
index acf4a18..63ef773 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java
@@ -47,8 +47,8 @@ public class RecentsConfiguration {
public Interpolator quintOutInterpolator;
/** Filtering */
- public int filteringCurrentViewsMinAnimDuration;
- public int filteringNewViewsMinAnimDuration;
+ public int filteringCurrentViewsAnimDuration;
+ public int filteringNewViewsAnimDuration;
/** Insets */
public Rect systemInsets = new Rect();
@@ -151,10 +151,10 @@ public class RecentsConfiguration {
res.getDimensionPixelSize(R.dimen.recents_animation_movement_in_dps_per_second);
// Filtering
- filteringCurrentViewsMinAnimDuration =
- res.getInteger(R.integer.recents_filter_animate_current_views_min_duration);
- filteringNewViewsMinAnimDuration =
- res.getInteger(R.integer.recents_filter_animate_new_views_min_duration);
+ filteringCurrentViewsAnimDuration =
+ res.getInteger(R.integer.recents_filter_animate_current_views_duration);
+ filteringNewViewsAnimDuration =
+ res.getInteger(R.integer.recents_filter_animate_new_views_duration);
// Insets
displayRect.set(0, 0, dm.widthPixels, dm.heightPixels);
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 6f6a6c5..7248758 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -392,6 +392,43 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
mCb.onTaskLaunching();
}
+ // Upfront the processing of the thumbnail
+ TaskViewTransform transform;
+ View sourceView = tv;
+ int offsetX = 0;
+ int offsetY = 0;
+ int stackScroll = stackView.getStackScroll();
+ if (tv == null) {
+ // If there is no actual task view, then use the stack view as the source view
+ // and then offset to the expected transform rect, but bound this to just
+ // outside the display rect (to ensure we don't animate from too far away)
+ sourceView = stackView;
+ transform = stackView.getStackTransform(stack.indexOfTask(task), stackScroll);
+ offsetX = transform.rect.left;
+ offsetY = Math.min(transform.rect.top, mConfig.displayRect.height());
+ } else {
+ transform = stackView.getStackTransform(stack.indexOfTask(task), stackScroll);
+ }
+
+ // Compute the thumbnail to scale up from
+ ActivityOptions opts = null;
+ int thumbnailWidth = transform.rect.width();
+ int thumbnailHeight = transform.rect.height();
+ if (task.thumbnail != null && thumbnailWidth > 0 && thumbnailHeight > 0 &&
+ task.thumbnail.getWidth() > 0 && task.thumbnail.getHeight() > 0) {
+ // Resize the thumbnail to the size of the view that we are animating from
+ Bitmap b = Bitmap.createBitmap(thumbnailWidth, thumbnailHeight,
+ Bitmap.Config.ARGB_8888);
+ Canvas c = new Canvas(b);
+ c.drawBitmap(task.thumbnail,
+ new Rect(0, 0, task.thumbnail.getWidth(), task.thumbnail.getHeight()),
+ new Rect(0, 0, thumbnailWidth, thumbnailHeight), null);
+ c.setBitmap(null);
+ opts = ActivityOptions.makeThumbnailScaleUpAnimation(sourceView,
+ b, offsetX, offsetY);
+ }
+
+ final ActivityOptions launchOpts = opts;
final Runnable launchRunnable = new Runnable() {
@Override
public void run() {
@@ -400,45 +437,10 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
Constants.Log.App.TimeRecentsLaunchKey, "preStartActivity");
}
- TaskViewTransform transform;
- View sourceView = tv;
- int offsetX = 0;
- int offsetY = 0;
- int stackScroll = stackView.getStackScroll();
- if (tv == null) {
- // If there is no actual task view, then use the stack view as the source view
- // and then offset to the expected transform rect, but bound this to just
- // outside the display rect (to ensure we don't animate from too far away)
- sourceView = stackView;
- transform = stackView.getStackTransform(stack.indexOfTask(task), stackScroll);
- offsetX = transform.rect.left;
- offsetY = Math.min(transform.rect.top, mConfig.displayRect.height());
- } else {
- transform = stackView.getStackTransform(stack.indexOfTask(task), stackScroll);
- }
-
- // Compute the thumbnail to scale up from
- ActivityOptions opts = null;
- int thumbnailWidth = transform.rect.width();
- int thumbnailHeight = transform.rect.height();
- if (task.thumbnail != null && thumbnailWidth > 0 && thumbnailHeight > 0 &&
- task.thumbnail.getWidth() > 0 && task.thumbnail.getHeight() > 0) {
- // Resize the thumbnail to the size of the view that we are animating from
- Bitmap b = Bitmap.createBitmap(thumbnailWidth, thumbnailHeight,
- Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
- c.drawBitmap(task.thumbnail,
- new Rect(0, 0, task.thumbnail.getWidth(), task.thumbnail.getHeight()),
- new Rect(0, 0, thumbnailWidth, thumbnailHeight), null);
- c.setBitmap(null);
- opts = ActivityOptions.makeThumbnailScaleUpAnimation(sourceView,
- b, offsetX, offsetY);
- }
-
if (task.isActive) {
// Bring an active task to the foreground
RecentsTaskLoader.getInstance().getSystemServicesProxy()
- .moveTaskToFront(task.key.id, opts);
+ .moveTaskToFront(task.key.id, launchOpts);
} else {
// Launch the activity anew with the desired animation
Intent i = new Intent(task.key.baseIntent);
@@ -447,8 +449,8 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
| Intent.FLAG_ACTIVITY_NEW_TASK);
try {
UserHandle taskUser = new UserHandle(task.userId);
- if (opts != null) {
- getContext().startActivityAsUser(i, opts.toBundle(), taskUser);
+ if (launchOpts != null) {
+ getContext().startActivityAsUser(i, launchOpts.toBundle(), taskUser);
} else {
getContext().startActivityAsUser(i, taskUser);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
index 8192f14..bf25760 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskBarView.java
@@ -23,6 +23,7 @@ import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.drawable.Drawable;
+import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewPropertyAnimator;
@@ -92,6 +93,13 @@ class TaskBarView extends FrameLayout {
mApplicationIcon = (ImageView) findViewById(R.id.application_icon);
mActivityDescription = (TextView) findViewById(R.id.activity_description);
mDismissButton = (ImageView) findViewById(R.id.dismiss_task);
+
+ // Hide the backgrounds if they are ripple drawables
+ if (!Constants.DebugFlags.App.EnableTaskFiltering) {
+ if (mApplicationIcon.getBackground() instanceof RippleDrawable) {
+ mApplicationIcon.setBackground(null);
+ }
+ }
}
@Override
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 7d7b368..6c12218 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -977,6 +977,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
ArrayList<TaskView> childrenToRemoveOut) {
// Animate all of the existing views out of view (if they are not in the visible range in
// the new stack) or to their final positions in the new stack
+ int offset = 0;
int movement = 0;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -1001,10 +1002,13 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
movement = Math.max(movement, Math.abs(toTransform.translationY -
(int) tv.getTranslationY()));
}
- childViewTransformsOut.put(tv, new Pair(0, toTransform));
+
+ int startDelay = offset *
+ Constants.Values.TaskStackView.FilterStartDelay;
+ childViewTransformsOut.put(tv, new Pair(startDelay, toTransform));
+ offset++;
}
- return Utilities.calculateTranslationAnimationDuration(movement,
- mConfig.filteringCurrentViewsMinAnimDuration);
+ return mConfig.filteringCurrentViewsAnimDuration;
}
/**
@@ -1042,8 +1046,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
}
}
}
- return Utilities.calculateTranslationAnimationDuration(movement,
- mConfig.filteringNewViewsMinAnimDuration);
+ return mConfig.filteringNewViewsAnimDuration;
}
/** Orchestrates the animations of the current child views and any new views. */