diff options
author | Winson Chung <winsonc@google.com> | 2015-02-13 13:49:36 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2015-02-18 14:42:51 -0800 |
commit | 911f400c2eab4eb15e0491a2affd918901867d2e (patch) | |
tree | e9c92203dd1c50b5ce37eb2f485746d822f5c8ce /packages/SystemUI | |
parent | 7478de1e87b3c1941b43eafc2ff9e9a4bafead7e (diff) | |
download | frameworks_base-911f400c2eab4eb15e0491a2affd918901867d2e.zip frameworks_base-911f400c2eab4eb15e0491a2affd918901867d2e.tar.gz frameworks_base-911f400c2eab4eb15e0491a2affd918901867d2e.tar.bz2 |
Fixing Recents regressions.
- Fixes crash when alt-tabbing recents
- Fixes issue with recents not showing after rotating
- Fixes flash when task view header is focused
Bugs: 19382697, 19343393
Change-Id: Ida0984dba1c76526298eb4886f96835fdf871b9f
Diffstat (limited to 'packages/SystemUI')
3 files changed, 13 insertions, 14 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index b1ac733..e0b4c2f 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -193,8 +193,7 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView } // Start loading tasks according to the load plan - ArrayList<TaskStack> stacks = plan.getAllTaskStacks(); - if (stacks.size() == 0) { + if (!plan.hasTasks()) { loader.preloadTasks(plan, mConfig.launchedFromHome); } RecentsTaskLoadPlan.Options loadOpts = new RecentsTaskLoadPlan.Options(); @@ -203,11 +202,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView loadOpts.numVisibleTaskThumbnails = mConfig.launchedNumVisibleThumbnails; loader.loadTasks(this, plan, loadOpts); - boolean hasTasks = plan.hasTasks(); - if (hasTasks) { + ArrayList<TaskStack> stacks = plan.getAllTaskStacks(); + mConfig.launchedWithNoRecentTasks = !plan.hasTasks(); + if (!mConfig.launchedWithNoRecentTasks) { mRecentsView.setTaskStacks(stacks); } - mConfig.launchedWithNoRecentTasks = !hasTasks; // Create the home intent runnable Intent homeIntent = new Intent(Intent.ACTION_MAIN, null); 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 2318319..21975b0 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -879,7 +879,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal // Start the focus animation when alt-tabbing if (mConfig.launchedWithAltTab && !mConfig.launchedHasConfigurationChanged) { - TaskView tv = taskViews.get(mFocusedTaskIndex); + TaskView tv = getChildViewForTask(mStack.getTasks().get(mFocusedTaskIndex)); if (tv != null) { tv.setFocusedTask(true); } 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 b827acc..81e960a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java @@ -32,12 +32,10 @@ import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.PorterDuffXfermode; -import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.RippleDrawable; import android.util.AttributeSet; -import android.view.MotionEvent; import android.view.View; import android.view.ViewOutlineProvider; import android.widget.FrameLayout; @@ -104,11 +102,10 @@ public class TaskViewHeader extends FrameLayout { }); // Load the dismiss resources - Resources res = context.getResources(); - mLightDismissDrawable = res.getDrawable(R.drawable.recents_dismiss_light); - mDarkDismissDrawable = res.getDrawable(R.drawable.recents_dismiss_dark); + mLightDismissDrawable = context.getDrawable(R.drawable.recents_dismiss_light); + mDarkDismissDrawable = context.getDrawable(R.drawable.recents_dismiss_dark); mDismissContentDescription = - res.getString(R.string.accessibility_recents_item_will_be_dismissed); + context.getString(R.string.accessibility_recents_item_will_be_dismissed); // Configure the highlight paint if (sHighlightPaint == null) { @@ -283,23 +280,26 @@ public class TaskViewHeader extends FrameLayout { } if (focused) { + int currentColor = mBackgroundColor; int secondaryColor = getSecondaryColor(mCurrentPrimaryColor, mCurrentPrimaryColorIsDark); int[][] states = new int[][] { + new int[] {}, new int[] { android.R.attr.state_enabled }, new int[] { android.R.attr.state_pressed } }; int[] newStates = new int[]{ + 0, android.R.attr.state_enabled, android.R.attr.state_pressed }; int[] colors = new int[] { + currentColor, secondaryColor, secondaryColor }; mBackground.setColor(new ColorStateList(states, colors)); mBackground.setState(newStates); // Pulse the background color - int currentColor = mBackgroundColor; int lightPrimaryColor = getSecondaryColor(mCurrentPrimaryColor, mCurrentPrimaryColorIsDark); ValueAnimator backgroundColor = ValueAnimator.ofObject(new ArgbEvaluator(), currentColor, lightPrimaryColor); @@ -326,7 +326,7 @@ public class TaskViewHeader extends FrameLayout { mFocusAnimator = new AnimatorSet(); mFocusAnimator.playTogether(backgroundColor, translation); - mFocusAnimator.setStartDelay(750); + mFocusAnimator.setStartDelay(150); mFocusAnimator.setDuration(750); mFocusAnimator.start(); } else { |