Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a433fa9c authored by Winson Chung's avatar Winson Chung
Browse files

Updating task grouping logic.

- More fixes for graphical glitches when picking up task views.

Change-Id: I93fab1c2a9cc727c68d8f8fbd506bedaf681715f
parent 6057c915
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
    <com.android.systemui.recents.views.TaskBarView
        android:id="@+id/task_view_bar"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:layout_height="@dimen/recents_task_bar_height"
        android:layout_gravity="top|center_horizontal"
        android:background="@color/recents_task_bar_default_background_color">
        <ImageView
+3 −0
Original line number Diff line number Diff line
@@ -210,6 +210,9 @@
    <!-- The amount of highlight to make on each task view. -->
    <dimen name="recents_task_view_highlight">1dp</dimen>

    <!-- The height of a task view bar. -->
    <dimen name="recents_task_bar_height">56dp</dimen>

    <!-- The height of the search bar space. -->
    <dimen name="recents_search_bar_space_height">64dp</dimen>

+1 −4
Original line number Diff line number Diff line
@@ -341,10 +341,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        }

        // Get the transform for the running task
        TaskStack.GroupTaskIndex groupTaskIndex = new TaskStack.GroupTaskIndex();
        stack.getGroupIndexForTask(task, groupTaskIndex);
        mTmpTransform = algo.getStackTransform(groupTaskIndex.groupIndex, groupTaskIndex.taskIndex,
                tsv.getStackScroll(), mTmpTransform);
        mTmpTransform = algo.getStackTransform(task, tsv.getStackScroll(), mTmpTransform);
        mTmpTransform.rect.offset(mTaskStackBounds.left, mTaskStackBounds.top);
        mTmpTransform.rect.offset(0, mStatusBarHeight);
        return new Rect(mTmpTransform.rect);
+4 −2
Original line number Diff line number Diff line
@@ -85,7 +85,8 @@ public class RecentsConfiguration {
    public int taskBarViewDarkTextColor;
    public int taskBarViewHighlightColor;

    /** Task bar animations */
    /** Task bar size & animations */
    public int taskBarHeight;
    public int taskBarEnterAnimDuration;
    public int taskBarEnterAnimDelay;
    public int taskBarExitAnimDuration;
@@ -214,7 +215,8 @@ public class RecentsConfiguration {
        taskBarViewHighlightColor =
                res.getColor(R.color.recents_task_bar_highlight_color);

        // Task bar animations
        // Task bar size & animations
        taskBarHeight = res.getDimensionPixelSize(R.dimen.recents_task_bar_height);
        taskBarEnterAnimDuration =
                res.getInteger(R.integer.recents_animate_task_bar_enter_duration);
        taskBarEnterAnimDelay =
+15 −1
Original line number Diff line number Diff line
package com.android.systemui.recents.model;

import java.util.ArrayList;
import java.util.HashMap;

/** Represents a grouping of tasks witihin a stack. */
public class TaskGrouping {
@@ -9,6 +10,7 @@ public class TaskGrouping {
    long latestActiveTimeInGroup;

    ArrayList<Task.TaskKey> mTasks = new ArrayList<Task.TaskKey>();
    HashMap<Task.TaskKey, Integer> mTaskIndices = new HashMap<Task.TaskKey, Integer>();

    /** Creates a group with a specified affiliation. */
    public TaskGrouping(String affiliation) {
@@ -22,6 +24,7 @@ public class TaskGrouping {
            latestActiveTimeInGroup = t.key.lastActiveTime;
        }
        t.setGroup(this);
        updateTaskIndices();
    }

    /** Removes a task from this group. */
@@ -36,6 +39,7 @@ public class TaskGrouping {
            }
        }
        t.setGroup(null);
        updateTaskIndices();
    }

    /** Gets the front task */
@@ -45,9 +49,19 @@ public class TaskGrouping {

    /** Finds the index of a given task in a group. */
    public int indexOf(Task t) {
        return mTasks.indexOf(t.key);
        return mTaskIndices.get(t.key);
    }

    /** Returns the number of tasks in this group. */
    public int getTaskCount() { return mTasks.size(); }

    /** Updates the mapping of tasks to indices. */
    private void updateTaskIndices() {
        mTaskIndices.clear();
        int taskCount = mTasks.size();
        for (int i = 0; i < taskCount; i++) {
            Task.TaskKey k = mTasks.get(i);
            mTaskIndices.put(k, i);
        }
    }
}
Loading