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

Commit 37fc513d authored by Winson's avatar Winson
Browse files

Fixing several bugs.

- Prevent long pressing to drag when a task is already docked
- Ensure that the history button has a bit of background protection
- When fast-toggling, the second tap should actually activate the 
  second task and not the third
- Align the history view with the stack view
- Fixing regression launching affiliated tasks

Bug: 25931916

Change-Id: I9d74d0d2427ea0b11f4817d0e635013065e3a792
parent 479f7446
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -19,16 +19,6 @@
    android:layout_height="match_parent"
    android:background="#99000000"
    android:orientation="vertical">
    <TextView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="14dp"
        android:gravity="start"
        android:text="@string/recents_history_label"
        android:textSize="24sp"
        android:textColor="#FFFFFF"
        android:fontFamily="sans-serif-medium" />
    <android.support.v7.widget.RecyclerView
        android:id="@+id/list"
        android:layout_width="match_parent"
+4 −0
Original line number Diff line number Diff line
@@ -22,5 +22,9 @@
    android:textSize="14sp"
    android:textColor="#FFFFFF"
    android:textAllCaps="true"
    android:shadowColor="#99000000"
    android:shadowDx="0"
    android:shadowDy="2"
    android:shadowRadius="5"
    android:fontFamily="sans-serif-medium"
    android:visibility="invisible" />
 No newline at end of file
+5 −1
Original line number Diff line number Diff line
@@ -81,10 +81,14 @@ public class RecentsActivityLaunchState {
            // or coming in from another app
            if (launchedFromHome) {
                return numTasks - 1;
            } else {
                if (flags.isFastToggleRecentsEnabled()) {
                    return numTasks - 1;
                } else {
                    return numTasks - 2;
                }
            }
        }

        if (launchedWithAltTab && launchedFromAppWithThumbnail) {
            // If alt-tabbing from another app, focus the next task
+25 −1
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import android.view.animation.Interpolator;
import android.widget.LinearLayout;

import com.android.systemui.R;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsConfiguration;
import com.android.systemui.recents.misc.ReferenceCountedTrigger;
import com.android.systemui.recents.model.TaskStack;

@@ -43,6 +45,7 @@ public class RecentsHistoryView extends LinearLayout {
    private RecyclerView mRecyclerView;
    private RecentsHistoryAdapter mAdapter;
    private boolean mIsVisible;
    private Rect mSystemInsets = new Rect();

    private Interpolator mFastOutSlowInInterpolator;
    private Interpolator mFastOutLinearInInterpolator;
@@ -123,7 +126,8 @@ public class RecentsHistoryView extends LinearLayout {
     * Updates the system insets of this history view to the provided values.
     */
    public void setSystemInsets(Rect systemInsets) {
        setPadding(systemInsets.left, systemInsets.top, systemInsets.right, systemInsets.bottom);
        mSystemInsets.set(systemInsets.left, systemInsets.top, systemInsets.right, systemInsets.bottom);
        requestLayout();
    }

    /**
@@ -141,6 +145,26 @@ public class RecentsHistoryView extends LinearLayout {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        RecentsConfiguration config = Recents.getConfiguration();
        int width = MeasureSpec.getSize(widthMeasureSpec);
        int height = MeasureSpec.getSize(heightMeasureSpec);

        // Pad the view to align the history with the stack layout
        Rect taskStackBounds = new Rect();
        config.getTaskStackBounds(new Rect(0, 0, width, height), mSystemInsets.top,
                mSystemInsets.right, new Rect() /* searchBarSpaceBounds */, taskStackBounds);
        int stackWidthPadding = (int) (config.taskStackWidthPaddingPct * taskStackBounds.width());
        int stackHeightPadding = mContext.getResources().getDimensionPixelSize(
                R.dimen.recents_stack_top_padding);
        mRecyclerView.setPadding(stackWidthPadding + mSystemInsets.left,
                stackHeightPadding + mSystemInsets.top,
                stackWidthPadding + mSystemInsets.right, mSystemInsets.bottom);

        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    @Override
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        setSystemInsets(insets.getSystemWindowInsets());
+5 −11
Original line number Diff line number Diff line
@@ -431,10 +431,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
                    .setStartDelay(0)
                    .setDuration(taskViewExitToAppDuration)
                    .setInterpolator(mFastOutLinearInInterpolator)
                    .withEndAction(postAnimRunnable)
                    .start();
        } else {
            // Hide the dismiss button
            mHeaderView.startLaunchTaskDismissAnimation();
            mHeaderView.startLaunchTaskDismissAnimation(postAnimRunnable);
            // If this is another view in the task grouping and is in front of the launch task,
            // animate it away first
            if (occludesLaunchTarget) {
@@ -670,21 +671,13 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,
    @Override
    public void onTaskDataLoaded() {
        SystemServicesProxy ssp = Recents.getSystemServices();
        RecentsConfiguration config = Recents.getConfiguration();
        if (mThumbnailView != null && mHeaderView != null) {
            // Bind each of the views to the new task data
            mThumbnailView.rebindToTask(mTask);
            mHeaderView.rebindToTask(mTask);
            // Rebind any listeners
            mActionButtonView.setOnClickListener(this);

            // Only enable long-click if we have a freeform workspace to drag to/from, or if we
            // aren't already docked
            if (ssp.hasFreeformWorkspaceSupport() || !config.hasDockedTasks) {
            setOnLongClickListener(this);
            } else {
                setOnLongClickListener(null);
            }
        }
        mTaskDataLoaded = true;
    }
@@ -724,7 +717,8 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks,

    @Override
    public boolean onLongClick(View v) {
        if (v == this) {
        SystemServicesProxy ssp = Recents.getSystemServices();
        if (v == this && !ssp.hasDockedTask()) {
            // Start listening for drag events
            setClipViewInStack(false);

Loading