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

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

Fixing random crash when transitioning to Recents, ensuring we don't update...

Fixing random crash when transitioning to Recents, ensuring we don't update the TextView unnecessarily.

Change-Id: I93ab512642f6e95ee96e041614f063f46420bb39
parent a433fa9c
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -292,7 +292,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
        if (firstThumbnail != null) {
            // Update the destination rect
            Rect toTaskRect = getThumbnailTransitionRect(topTask.id);

            if (toTaskRect.width() > 0 && toTaskRect.height() > 0) {
                // Create the new thumbnail for the animation down
                // XXX: We should find a way to optimize this so we don't need to create a new bitmap
                Bitmap thumbnail = Bitmap.createBitmap(toTaskRect.width(), toTaskRect.height(),
@@ -307,6 +307,7 @@ public class AlternateRecentsComponent implements ActivityOptions.OnAnimationSta
                return ActivityOptions.makeThumbnailScaleDownAnimation(mStatusBarView,
                        thumbnail, toTaskRect.left, toTaskRect.top, this);
            }
        }

        // If both the screenshot and thumbnail fails, then just fall back to the default transition
        return getUnknownTransitionActivityOptions();
+3 −2
Original line number Diff line number Diff line
@@ -157,7 +157,9 @@ class TaskBarView extends FrameLayout {
        } else if (t.applicationIcon != null) {
            mApplicationIcon.setImageDrawable(t.applicationIcon);
        }
        if (!mActivityDescription.getText().toString().equals(t.activityLabel)) {
            mActivityDescription.setText(t.activityLabel);
        }
        // Try and apply the system ui tint
        setBackgroundColor(t.colorPrimary);
        mActivityDescription.setTextColor(Utilities.getIdealColorForBackgroundColorGreyscale(
@@ -171,7 +173,6 @@ class TaskBarView extends FrameLayout {
    void unbindFromTask() {
        mTask = null;
        mApplicationIcon.setImageDrawable(null);
        mActivityDescription.setText("");
    }

    /** Prepares this task view for the enter-recents animations.  This is called earlier in the
+1 −1
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
    /** Computes the initial stack scroll for the stack. */
    int getInitialStackScroll() {
        if (mStack.getTaskCount() > 2) {
            return mMaxScroll - mStackAlgorithm.mTaskRect.height() / 2;
            return mMaxScroll - (int) (mStackAlgorithm.mTaskRect.height() * (3f/4f));
        }
        return mMaxScroll;
    }
+9 −0
Original line number Diff line number Diff line
@@ -535,6 +535,15 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, View.On
        }
    }

    @Override
    protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
        if (mIsStub && (child == mThumbnailView)) {
            // Skip the thumbnail view if we are in stub mode
            return false;
        }
        return super.drawChild(canvas, child, drawingTime);
    }

    /**
     * Sets the focused task explicitly. We need a separate flag because requestFocus() won't happen
     * if the view is not currently visible, or we are in touch state (where we still want to keep