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

Commit 81fad35d authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Automerger Merge Worker
Browse files

Merge "Code cleanup: recycle typed arrays when they are no longer needed" into...

Merge "Code cleanup: recycle typed arrays when they are no longer needed" into udc-dev am: f0233c53

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23214379



Change-Id: Ibd3ca5a7555ed859df529157815799875d34061f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0333de88 f0233c53
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.quickstep.util.BorderAnimator.DEFAULT_BORDER_COLOR;
import android.animation.Animator;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.util.AttributeSet;
@@ -67,6 +68,9 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout {
            int defStyleAttr,
            int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        TypedArray ta = context.obtainStyledAttributes(
                attrs, R.styleable.TaskView, defStyleAttr, defStyleRes);

        setWillNotDraw(false);
        Resources resources = context.getResources();
        mBorderAnimator = new BorderAnimator(
@@ -75,17 +79,8 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout {
                        R.dimen.keyboard_quick_switch_border_width),
                /* borderRadiusPx= */ resources.getDimensionPixelSize(
                        R.dimen.keyboard_quick_switch_task_view_radius),
                /* borderColor= */ attrs == null
                        ? DEFAULT_BORDER_COLOR
                        : context.getTheme()
                                .obtainStyledAttributes(
                                        attrs,
                                        R.styleable.TaskView,
                                        defStyleAttr,
                                        defStyleRes)
                                .getColor(
                                        R.styleable.TaskView_borderColor,
                                        DEFAULT_BORDER_COLOR),
                /* borderColor= */ ta.getColor(
                        R.styleable.TaskView_borderColor, DEFAULT_BORDER_COLOR),
                /* invalidateViewCallback= */ KeyboardQuickSwitchTaskView.this::invalidate,
                /* viewScaleTargetProvider= */ new BorderAnimator.ViewScaleTargetProvider() {
                    @NonNull
@@ -100,6 +95,7 @@ public class KeyboardQuickSwitchTaskView extends ConstraintLayout {
                        return mContent;
                    }
                });
        ta.recycle();
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -195,6 +195,9 @@ public class KeyboardQuickSwitchViewController {
                            // focus a less recent app or loop back to the opposite end
                            : ((mCurrentFocusIndex + 1) % taskCount));

            if (mCurrentFocusIndex == toIndex) {
                return true;
            }
            mKeyboardQuickSwitchView.animateFocusMove(mCurrentFocusIndex, toIndex);

            return true;
+7 −11
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.PointF;
import android.graphics.Rect;
@@ -438,6 +439,9 @@ public class TaskView extends FrameLayout implements Reusable {

        setWillNotDraw(!keyboardFocusHighlightEnabled);

        TypedArray ta = context.obtainStyledAttributes(
                attrs, R.styleable.TaskView, defStyleAttr, defStyleRes);

        mBorderAnimator = !keyboardFocusHighlightEnabled
                ? null
                : new BorderAnimator(
@@ -445,18 +449,10 @@ public class TaskView extends FrameLayout implements Reusable {
                        /* borderWidthPx= */ context.getResources().getDimensionPixelSize(
                                R.dimen.keyboard_quick_switch_border_width),
                        /* borderRadiusPx= */ (int) mCurrentFullscreenParams.mCornerRadius,
                        /* borderColor= */ attrs == null
                        ? DEFAULT_BORDER_COLOR
                        : context.getTheme()
                                .obtainStyledAttributes(
                                        attrs,
                                        R.styleable.TaskView,
                                        defStyleAttr,
                                        defStyleRes)
                                .getColor(
                                        R.styleable.TaskView_borderColor,
                                        DEFAULT_BORDER_COLOR),
                        /* borderColor= */ ta.getColor(
                                R.styleable.TaskView_borderColor, DEFAULT_BORDER_COLOR),
                        /* invalidateViewCallback= */ TaskView.this::invalidate);
        ta.recycle();
    }

    protected void updateBorderBounds(Rect bounds) {