summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2010-12-14 17:17:05 -0800
committerJim Miller <jaggies@google.com>2010-12-15 14:08:51 -0800
commitd19bedee3437c164513bdc4ea11e33f404ed7603 (patch)
tree05de680815f4456c2ff26277fc4b4f8f919e31b1 /packages
parent320a4beda312279e842a97d3af5b3f0b28cbe49d (diff)
downloadframeworks_base-d19bedee3437c164513bdc4ea11e33f404ed7603.zip
frameworks_base-d19bedee3437c164513bdc4ea11e33f404ed7603.tar.gz
frameworks_base-d19bedee3437c164513bdc4ea11e33f404ed7603.tar.bz2
Fix 3253629: Tweaks to recent apps
This change reduces the overall timing of showing recents to make it feel more snappy. It also removes the first item from the list, which is assumed to be the current app or the home screen, depending on which is currently showing. This allows the use of muscle memory for switching between two tasks quickly. Change-Id: I04713c41ea235483ea4d3f712a84c56b0174394f
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java20
2 files changed, 12 insertions, 17 deletions
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml
index 97cbfca..cc044a1 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml
@@ -27,15 +27,6 @@
android:id="@+id/recents_bg_protect"
android:orientation="vertical">
- <TextView android:id="@+id/recents_no_recents"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/recent_tasks_empty"
- android:textSize="22dip"
- android:gravity="center_horizontal|center_vertical"
- android:visibility="gone">
- </TextView>
-
<View
android:layout_width="match_parent"
android:layout_height="0dip"
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
index 1301329..e0f37ca 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
@@ -46,6 +46,7 @@ import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
+import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
@@ -54,13 +55,15 @@ import android.widget.TextView;
import com.android.systemui.R;
public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnClickListener {
+ private static final int COLLAPSE_DURATION = 360;
private static final String TAG = "RecentAppsPanel";
private static final boolean DEBUG = TabletStatusBar.DEBUG;
private static final int DISPLAY_TASKS_PORTRAIT = 8;
private static final int DISPLAY_TASKS_LANDSCAPE = 5; // number of recent tasks to display
private static final int MAX_TASKS = DISPLAY_TASKS_PORTRAIT + 2; // allow extra for non-apps
+ private static final int STAGGER_ANIMATION_DELAY = 30;
+ private static final long ALPHA_ANIMATION_DURATION = 120;
private TabletStatusBar mBar;
- private TextView mNoRecents;
private LinearLayout mRecentsContainer;
private View mRecentsGlowView;
private ArrayList<ActivityDescription> mActivityDescriptions;
@@ -123,7 +126,6 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- mNoRecents = (TextView) findViewById(R.id.recents_no_recents);
mRecentsContainer = (LinearLayout) findViewById(R.id.recents_container);
mRecentsGlowView = findViewById(R.id.recents_glow);
mBackgroundProtector = (View) findViewById(R.id.recents_bg_protect);
@@ -193,7 +195,10 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC
.resolveActivityInfo(pm, 0);
int numTasks = recentTasks.size();
- for (int i = 0, index = 0; i < numTasks && (index < MAX_TASKS); ++i) {
+
+ // skip the first activity - assume it's either the home screen or the current app.
+ final int first = 1;
+ for (int i = first, index = 0; i < numTasks && (index < MAX_TASKS); ++i) {
final ActivityManager.RecentTaskInfo recentInfo = recentTasks.get(i);
Intent intent = new Intent(recentInfo.baseIntent);
@@ -297,22 +302,21 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC
if (animate) {
view.setAlpha(initialAlpha);
ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", initialAlpha, 1.0f);
- anim.setDuration(200);
- anim.setStartDelay((last-i)*80);
+ anim.setDuration(ALPHA_ANIMATION_DURATION);
+ anim.setStartDelay((last-i) * STAGGER_ANIMATION_DELAY);
anim.setInterpolator(interp);
anims.add(anim);
}
}
int views = mRecentsContainer.getChildCount();
- mNoRecents.setVisibility(View.GONE); // views == 0 ? View.VISIBLE : View.GONE);
mRecentsContainer.setVisibility(views > 0 ? View.VISIBLE : View.GONE);
mRecentsGlowView.setVisibility(views > 0 ? View.VISIBLE : View.GONE);
if (animate && views > 0) {
ObjectAnimator anim = ObjectAnimator.ofFloat(mRecentsGlowView, "alpha",
initialAlpha, 1.0f);
- anim.setDuration((last-first)*80);
+ anim.setDuration((last-first) * STAGGER_ANIMATION_DELAY);
anim.setInterpolator(interp);
anims.add(anim);
}
@@ -320,7 +324,7 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC
if (animate) {
ObjectAnimator anim = ObjectAnimator.ofFloat(mBackgroundProtector, "alpha",
initialAlpha, 1.0f);
- anim.setDuration(last*80);
+ anim.setDuration(last * STAGGER_ANIMATION_DELAY);
anim.setInterpolator(interp);
anims.add(anim);
}