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

Commit 73b5a27b authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Updating some non-final static objects

Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
parent 4f37a5e2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
     */
    public static final AsyncCommand SET_SHELF_HEIGHT = (context, arg1, arg2) ->
            SystemUiProxy.INSTANCE.get(context).setShelfHeight(arg1 != 0, arg2);
    public static RotationMode ROTATION_LANDSCAPE = new RotationMode(-90) {
    public static final RotationMode ROTATION_LANDSCAPE = new RotationMode(-90) {
        @Override
        public void mapRect(int left, int top, int right, int bottom, Rect out) {
            out.left = top;
@@ -89,7 +89,7 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
            }
        }
    };
    public static RotationMode ROTATION_SEASCAPE = new RotationMode(90) {
    public static final RotationMode ROTATION_SEASCAPE = new RotationMode(90) {
        @Override
        public void mapRect(int left, int top, int right, int bottom, Rect out) {
            out.left = bottom;
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ public class FallbackSwipeHandler extends BaseSwipeUpHandler<RecentsActivity, Fa
            mLauncherAlpha = launcherAlpha;
        }
    }
    private static ArrayMap<GestureEndTarget, EndTargetAnimationParams>
    private final ArrayMap<GestureEndTarget, EndTargetAnimationParams>
            mEndTargetAnimationParams = new ArrayMap();

    private final AnimatedFloat mLauncherAlpha = new AnimatedFloat(this::onLauncherAlphaChanged);
+4 −4
Original line number Diff line number Diff line
@@ -544,7 +544,7 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>

        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            if (mRecentsAnimationTargets != null) {
                LiveTileOverlay.getInstance().update(
                LiveTileOverlay.INSTANCE.update(
                        mAppWindowAnimationHelper.getCurrentRectWithInsets(),
                        mAppWindowAnimationHelper.getCurrentCornerRadius());
            }
@@ -829,7 +829,7 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
            setShelfState(ShelfAnimState.CANCEL, LINEAR, 0);
            duration = Math.max(MIN_OVERSHOOT_DURATION, duration);
        } else if (endTarget == RECENTS) {
            LiveTileOverlay.getInstance().startIconAnimation();
            LiveTileOverlay.INSTANCE.startIconAnimation();
            if (mRecentsView != null) {
                int nearestPage = mRecentsView.getPageNearestToCenterOfScreen();
                if (mRecentsView.getNextPage() != nearestPage) {
@@ -1231,13 +1231,13 @@ public class LauncherSwipeHandler<T extends BaseDraggingActivity>
    }

    private void addLiveTileOverlay() {
        if (LiveTileOverlay.getInstance().attach(mActivity.getRootView().getOverlay())) {
        if (LiveTileOverlay.INSTANCE.attach(mActivity.getRootView().getOverlay())) {
            mRecentsView.setLiveTileOverlayAttached(true);
        }
    }

    private void removeLiveTileOverlay() {
        LiveTileOverlay.getInstance().detach(mActivity.getRootView().getOverlay());
        LiveTileOverlay.INSTANCE.detach(mActivity.getRootView().getOverlay());
        mRecentsView.setLiveTileOverlayAttached(false);
    }

+2 −9
Original line number Diff line number Diff line
@@ -37,18 +37,11 @@ public class LiveTileOverlay extends Drawable {
                }
            };

    private static LiveTileOverlay sInstance;

    public static LiveTileOverlay getInstance() {
        if (sInstance == null) {
            sInstance = new LiveTileOverlay();
        }
        return sInstance;
    }
    public static final LiveTileOverlay INSTANCE = new LiveTileOverlay();

    private final Paint mPaint = new Paint();
    private final Rect mBoundsRect = new Rect();

    private Rect mBoundsRect = new Rect();
    private RectF mCurrentRect;
    private float mCornerRadius;
    private Drawable mIcon;
+2 −2
Original line number Diff line number Diff line
@@ -886,7 +886,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
    public void onSwipeUpAnimationSuccess() {
        if (getRunningTaskView() != null) {
            float startProgress = ENABLE_QUICKSTEP_LIVE_TILE.get() && mLiveTileOverlayAttached
                    ? LiveTileOverlay.getInstance().cancelIconAnimation()
                    ? LiveTileOverlay.INSTANCE.cancelIconAnimation()
                    : 0f;
            animateUpRunningTaskIconScale(startProgress);
        }
@@ -1739,7 +1739,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl

    public void updateLiveTileIcon(Drawable icon) {
        if (mLiveTileOverlayAttached) {
            LiveTileOverlay.getInstance().setIcon(icon);
            LiveTileOverlay.INSTANCE.setIcon(icon);
        }
    }

Loading