From d19bedee3437c164513bdc4ea11e33f404ed7603 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 14 Dec 2010 17:17:05 -0800 Subject: 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 --- .../res/layout-xlarge/status_bar_recent_panel.xml | 9 --------- .../systemui/statusbar/tablet/RecentAppsPanel.java | 20 ++++++++++++-------- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'packages/SystemUI') 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"> - - - 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); } -- cgit v1.1