Loading packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -213,6 +213,9 @@ <!-- The height of the lock-to-app button. --> <!-- The height of the lock-to-app button. --> <dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen> <dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen> <!-- The amount to offset when animating into an affiliate group. --> <dimen name="recents_task_view_affiliate_group_enter_offset">64dp</dimen> <!-- The height of a task view bar. --> <!-- The height of a task view bar. --> <dimen name="recents_task_bar_height">56dp</dimen> <dimen name="recents_task_bar_height">56dp</dimen> Loading packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class RecentsConfiguration { public int taskViewTranslationZIncrementPx; public int taskViewTranslationZIncrementPx; public int taskViewRoundedCornerRadiusPx; public int taskViewRoundedCornerRadiusPx; public int taskViewHighlightPx; public int taskViewHighlightPx; public int taskViewAffiliateGroupEnterOffsetPx; /** Task bar colors */ /** Task bar colors */ public int taskBarViewDefaultBackgroundColor; public int taskBarViewDefaultBackgroundColor; Loading Loading @@ -210,6 +211,8 @@ public class RecentsConfiguration { taskViewTranslationZMinPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_min); taskViewTranslationZMinPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_min); taskViewTranslationZIncrementPx = taskViewTranslationZIncrementPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_increment); res.getDimensionPixelSize(R.dimen.recents_task_view_z_increment); taskViewAffiliateGroupEnterOffsetPx = res.getDimensionPixelSize(R.dimen.recents_task_view_affiliate_group_enter_offset); // Task bar colors // Task bar colors taskBarViewDefaultBackgroundColor = taskBarViewDefaultBackgroundColor = Loading packages/SystemUI/src/com/android/systemui/recents/model/TaskGrouping.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -53,6 +53,18 @@ public class TaskGrouping { return mTaskKeyIndices.get(t.key); return mTaskKeyIndices.get(t.key); } } /** Returns whether a task is in this grouping. */ public boolean containsTask(Task t) { return mTaskKeyIndices.containsKey(t.key); } /** Returns whether one task is above another in the group. If they are not in the same group, * this returns false. */ public boolean isTaskAboveTask(Task t, Task below) { return mTaskKeyIndices.containsKey(t.key) && mTaskKeyIndices.containsKey(below.key) && mTaskKeyIndices.get(t.key) > mTaskKeyIndices.get(below.key); } /** Returns the number of tasks in this group. */ /** Returns the number of tasks in this group. */ public int getTaskCount() { return mTaskKeys.size(); } public int getTaskCount() { return mTaskKeys.size(); } Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -449,7 +449,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV if (tv == null) { if (tv == null) { post(launchRunnable); post(launchRunnable); } else { } else { stackView.animateOnLaunchingTask(tv, launchRunnable); stackView.startLaunchTaskAnimation(tv, launchRunnable); } } } } Loading packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +54 −22 Original line number Original line Diff line number Diff line Loading @@ -495,20 +495,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } } } /** Animates a task view in this stack as it launches. */ public void animateOnLaunchingTask(TaskView tv, final Runnable r) { // Hide each of the task bar dismiss buttons int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { TaskView t = (TaskView) getChildAt(i); if (t == tv) { t.startLaunchTaskAnimation(r, true); } else { t.startLaunchTaskAnimation(null, false); } } } /** Focuses the task at the specified index in the stack */ /** Focuses the task at the specified index in the stack */ void focusTask(int taskIndex, boolean scrollToNewPosition) { void focusTask(int taskIndex, boolean scrollToNewPosition) { if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) { if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) { Loading Loading @@ -664,13 +650,28 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal /** Handler for the first layout. */ /** Handler for the first layout. */ void onFirstLayout() { void onFirstLayout() { // Prepare the first view for its enter animation int offscreenY = mStackAlgorithm.mViewRect.bottom - int offscreenY = mStackAlgorithm.mViewRect.bottom - (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); // Find the launch target task Task launchTargetTask = null; int childCount = getChildCount(); int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); TaskView tv = (TaskView) getChildAt(i); tv.prepareEnterRecentsAnimation(tv.getTask().isLaunchTarget, offscreenY); Task task = tv.getTask(); if (task.isLaunchTarget) { launchTargetTask = task; break; } } // Prepare the first view for its enter animation for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); boolean occludesLaunchTarget = (launchTargetTask != null) && launchTargetTask.group.isTaskAboveTask(task, launchTargetTask); tv.prepareEnterRecentsAnimation(task.isLaunchTarget, occludesLaunchTarget, offscreenY); } } // If the enter animation started already and we haven't completed a layout yet, do the // If the enter animation started already and we haven't completed a layout yet, do the Loading Loading @@ -698,8 +699,19 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } if (mStack.getTaskCount() > 0) { if (mStack.getTaskCount() > 0) { // Animate all the task views into view // Find the launch target task Task launchTargetTask = null; int childCount = getChildCount(); int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); if (task.isLaunchTarget) { launchTargetTask = task; break; } } // Animate all the task views into view for (int i = childCount - 1; i >= 0; i--) { for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); Task task = tv.getTask(); Loading @@ -707,6 +719,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal ctx.currentStackViewIndex = i; ctx.currentStackViewIndex = i; ctx.currentStackViewCount = childCount; ctx.currentStackViewCount = childCount; ctx.currentTaskRect = mStackAlgorithm.mTaskRect; ctx.currentTaskRect = mStackAlgorithm.mTaskRect; ctx.currentTaskOccludesLaunchTarget = (launchTargetTask != null) && launchTargetTask.group.isTaskAboveTask(task, launchTargetTask); mStackAlgorithm.getStackTransform(task, getStackScroll(), ctx.currentTaskTransform); mStackAlgorithm.getStackTransform(task, getStackScroll(), ctx.currentTaskTransform); tv.startEnterRecentsAnimation(ctx); tv.startEnterRecentsAnimation(ctx); } } Loading @@ -717,11 +731,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void run() { public void run() { // Start dozing // Start dozing mUIDozeTrigger.startDozing(); mUIDozeTrigger.startDozing(); // Request an update of the task views after the animation in to // relayout the fullscreen view back to its normal size if (mConfig.launchedFromAppWithScreenshot) { requestSynchronizeStackViewsWithModel(); } } } }); }); } } Loading @@ -742,6 +751,24 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal ctx.postAnimationTrigger.addLastDecrementRunnable(mReturnAllViewsToPoolRunnable); ctx.postAnimationTrigger.addLastDecrementRunnable(mReturnAllViewsToPoolRunnable); } } /** Animates a task view in this stack as it launches. */ public void startLaunchTaskAnimation(TaskView tv, final Runnable r) { Task launchTargetTask = tv.getTask(); int offscreenTranslationY = mStackAlgorithm.mViewRect.bottom - (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { TaskView t = (TaskView) getChildAt(i); if (t == tv) { t.startLaunchTaskAnimation(r, true, true); } else { boolean occludesLaunchTarget = launchTargetTask.group.isTaskAboveTask(t.getTask(), launchTargetTask); t.startLaunchTaskAnimation(null, false, occludesLaunchTarget); } } } @Override @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); super.onScrollChanged(l, t, oldl, oldt); Loading Loading @@ -988,6 +1015,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal invalidate(mStackAlgorithm.mStackRect); invalidate(mStackAlgorithm.mStackRect); } } @Override public void onTaskViewFullScreenTransitionCompleted() { requestSynchronizeStackViewsWithModel(); } /**** RecentsPackageMonitor.PackageCallbacks Implementation ****/ /**** RecentsPackageMonitor.PackageCallbacks Implementation ****/ @Override @Override Loading Loading
packages/SystemUI/res/values/dimens.xml +3 −0 Original line number Original line Diff line number Diff line Loading @@ -213,6 +213,9 @@ <!-- The height of the lock-to-app button. --> <!-- The height of the lock-to-app button. --> <dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen> <dimen name="recents_task_view_lock_to_app_button_height">48dp</dimen> <!-- The amount to offset when animating into an affiliate group. --> <dimen name="recents_task_view_affiliate_group_enter_offset">64dp</dimen> <!-- The height of a task view bar. --> <!-- The height of a task view bar. --> <dimen name="recents_task_bar_height">56dp</dimen> <dimen name="recents_task_bar_height">56dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsConfiguration.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -80,6 +80,7 @@ public class RecentsConfiguration { public int taskViewTranslationZIncrementPx; public int taskViewTranslationZIncrementPx; public int taskViewRoundedCornerRadiusPx; public int taskViewRoundedCornerRadiusPx; public int taskViewHighlightPx; public int taskViewHighlightPx; public int taskViewAffiliateGroupEnterOffsetPx; /** Task bar colors */ /** Task bar colors */ public int taskBarViewDefaultBackgroundColor; public int taskBarViewDefaultBackgroundColor; Loading Loading @@ -210,6 +211,8 @@ public class RecentsConfiguration { taskViewTranslationZMinPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_min); taskViewTranslationZMinPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_min); taskViewTranslationZIncrementPx = taskViewTranslationZIncrementPx = res.getDimensionPixelSize(R.dimen.recents_task_view_z_increment); res.getDimensionPixelSize(R.dimen.recents_task_view_z_increment); taskViewAffiliateGroupEnterOffsetPx = res.getDimensionPixelSize(R.dimen.recents_task_view_affiliate_group_enter_offset); // Task bar colors // Task bar colors taskBarViewDefaultBackgroundColor = taskBarViewDefaultBackgroundColor = Loading
packages/SystemUI/src/com/android/systemui/recents/model/TaskGrouping.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -53,6 +53,18 @@ public class TaskGrouping { return mTaskKeyIndices.get(t.key); return mTaskKeyIndices.get(t.key); } } /** Returns whether a task is in this grouping. */ public boolean containsTask(Task t) { return mTaskKeyIndices.containsKey(t.key); } /** Returns whether one task is above another in the group. If they are not in the same group, * this returns false. */ public boolean isTaskAboveTask(Task t, Task below) { return mTaskKeyIndices.containsKey(t.key) && mTaskKeyIndices.containsKey(below.key) && mTaskKeyIndices.get(t.key) > mTaskKeyIndices.get(below.key); } /** Returns the number of tasks in this group. */ /** Returns the number of tasks in this group. */ public int getTaskCount() { return mTaskKeys.size(); } public int getTaskCount() { return mTaskKeys.size(); } Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -449,7 +449,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV if (tv == null) { if (tv == null) { post(launchRunnable); post(launchRunnable); } else { } else { stackView.animateOnLaunchingTask(tv, launchRunnable); stackView.startLaunchTaskAnimation(tv, launchRunnable); } } } } Loading
packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +54 −22 Original line number Original line Diff line number Diff line Loading @@ -495,20 +495,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } } } /** Animates a task view in this stack as it launches. */ public void animateOnLaunchingTask(TaskView tv, final Runnable r) { // Hide each of the task bar dismiss buttons int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { TaskView t = (TaskView) getChildAt(i); if (t == tv) { t.startLaunchTaskAnimation(r, true); } else { t.startLaunchTaskAnimation(null, false); } } } /** Focuses the task at the specified index in the stack */ /** Focuses the task at the specified index in the stack */ void focusTask(int taskIndex, boolean scrollToNewPosition) { void focusTask(int taskIndex, boolean scrollToNewPosition) { if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) { if (0 <= taskIndex && taskIndex < mStack.getTaskCount()) { Loading Loading @@ -664,13 +650,28 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal /** Handler for the first layout. */ /** Handler for the first layout. */ void onFirstLayout() { void onFirstLayout() { // Prepare the first view for its enter animation int offscreenY = mStackAlgorithm.mViewRect.bottom - int offscreenY = mStackAlgorithm.mViewRect.bottom - (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); // Find the launch target task Task launchTargetTask = null; int childCount = getChildCount(); int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); TaskView tv = (TaskView) getChildAt(i); tv.prepareEnterRecentsAnimation(tv.getTask().isLaunchTarget, offscreenY); Task task = tv.getTask(); if (task.isLaunchTarget) { launchTargetTask = task; break; } } // Prepare the first view for its enter animation for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); boolean occludesLaunchTarget = (launchTargetTask != null) && launchTargetTask.group.isTaskAboveTask(task, launchTargetTask); tv.prepareEnterRecentsAnimation(task.isLaunchTarget, occludesLaunchTarget, offscreenY); } } // If the enter animation started already and we haven't completed a layout yet, do the // If the enter animation started already and we haven't completed a layout yet, do the Loading Loading @@ -698,8 +699,19 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } } if (mStack.getTaskCount() > 0) { if (mStack.getTaskCount() > 0) { // Animate all the task views into view // Find the launch target task Task launchTargetTask = null; int childCount = getChildCount(); int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); if (task.isLaunchTarget) { launchTargetTask = task; break; } } // Animate all the task views into view for (int i = childCount - 1; i >= 0; i--) { for (int i = childCount - 1; i >= 0; i--) { TaskView tv = (TaskView) getChildAt(i); TaskView tv = (TaskView) getChildAt(i); Task task = tv.getTask(); Task task = tv.getTask(); Loading @@ -707,6 +719,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal ctx.currentStackViewIndex = i; ctx.currentStackViewIndex = i; ctx.currentStackViewCount = childCount; ctx.currentStackViewCount = childCount; ctx.currentTaskRect = mStackAlgorithm.mTaskRect; ctx.currentTaskRect = mStackAlgorithm.mTaskRect; ctx.currentTaskOccludesLaunchTarget = (launchTargetTask != null) && launchTargetTask.group.isTaskAboveTask(task, launchTargetTask); mStackAlgorithm.getStackTransform(task, getStackScroll(), ctx.currentTaskTransform); mStackAlgorithm.getStackTransform(task, getStackScroll(), ctx.currentTaskTransform); tv.startEnterRecentsAnimation(ctx); tv.startEnterRecentsAnimation(ctx); } } Loading @@ -717,11 +731,6 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal public void run() { public void run() { // Start dozing // Start dozing mUIDozeTrigger.startDozing(); mUIDozeTrigger.startDozing(); // Request an update of the task views after the animation in to // relayout the fullscreen view back to its normal size if (mConfig.launchedFromAppWithScreenshot) { requestSynchronizeStackViewsWithModel(); } } } }); }); } } Loading @@ -742,6 +751,24 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal ctx.postAnimationTrigger.addLastDecrementRunnable(mReturnAllViewsToPoolRunnable); ctx.postAnimationTrigger.addLastDecrementRunnable(mReturnAllViewsToPoolRunnable); } } /** Animates a task view in this stack as it launches. */ public void startLaunchTaskAnimation(TaskView tv, final Runnable r) { Task launchTargetTask = tv.getTask(); int offscreenTranslationY = mStackAlgorithm.mViewRect.bottom - (mStackAlgorithm.mTaskRect.top - mStackAlgorithm.mViewRect.top); int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { TaskView t = (TaskView) getChildAt(i); if (t == tv) { t.startLaunchTaskAnimation(r, true, true); } else { boolean occludesLaunchTarget = launchTargetTask.group.isTaskAboveTask(t.getTask(), launchTargetTask); t.startLaunchTaskAnimation(null, false, occludesLaunchTarget); } } } @Override @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); super.onScrollChanged(l, t, oldl, oldt); Loading Loading @@ -988,6 +1015,11 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal invalidate(mStackAlgorithm.mStackRect); invalidate(mStackAlgorithm.mStackRect); } } @Override public void onTaskViewFullScreenTransitionCompleted() { requestSynchronizeStackViewsWithModel(); } /**** RecentsPackageMonitor.PackageCallbacks Implementation ****/ /**** RecentsPackageMonitor.PackageCallbacks Implementation ****/ @Override @Override Loading