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

Commit 6d8473ed authored by James O'Leary's avatar James O'Leary Committed by android-build-merger
Browse files

Merge "Render invocation lights as beziers, not circles" into qt-dev

am: 18fff174

Change-Id: Ifcefc71af46f1043fe78ee910c61fd6c0f65b1a8
parents f67706c4 18fff174
Loading
Loading
Loading
Loading
+17 −5
Original line number Original line Diff line number Diff line
@@ -92,15 +92,14 @@ public class InvocationLightsView extends View
        mPaint.setStrokeJoin(Paint.Join.MITER);
        mPaint.setStrokeJoin(Paint.Join.MITER);
        mPaint.setAntiAlias(true);
        mPaint.setAntiAlias(true);


        int cornerRadiusBottom = DisplayUtils.getCornerRadiusBottom(context);

        int cornerRadiusTop = DisplayUtils.getCornerRadiusTop(context);
        int displayWidth = DisplayUtils.getWidth(context);
        int displayWidth = DisplayUtils.getWidth(context);
        int displayHeight = DisplayUtils.getHeight(context);
        int displayHeight = DisplayUtils.getHeight(context);
        CircularCornerPathRenderer cornerPathRenderer = new CircularCornerPathRenderer(
        mGuide = new PerimeterPathGuide(context, createCornerPathRenderer(context),
                cornerRadiusBottom, cornerRadiusTop, displayWidth, displayHeight);
        mGuide = new PerimeterPathGuide(context, cornerPathRenderer,
                mStrokeWidth / 2, displayWidth, displayHeight);
                mStrokeWidth / 2, displayWidth, displayHeight);


        int cornerRadiusBottom = DisplayUtils.getCornerRadiusBottom(context);
        int cornerRadiusTop = DisplayUtils.getCornerRadiusTop(context);
        mViewHeight = Math.max(cornerRadiusBottom, cornerRadiusTop);
        mViewHeight = Math.max(cornerRadiusBottom, cornerRadiusTop);


        final int dualToneDarkTheme = Utils.getThemeAttr(mContext, R.attr.darkIconTheme);
        final int dualToneDarkTheme = Utils.getThemeAttr(mContext, R.attr.darkIconTheme);
@@ -242,6 +241,19 @@ public class InvocationLightsView extends View
        mAssistInvocationLights.get(index).setLength(length);
        mAssistInvocationLights.get(index).setLength(length);
    }
    }


    /**
     * Returns CornerPathRenderer to be used for rendering invocation lights.
     *
     * To render corners that aren't circular, override this method in a subclass.
     */
    protected CornerPathRenderer createCornerPathRenderer(Context context) {
        int displayWidth = DisplayUtils.getWidth(context);
        int displayHeight = DisplayUtils.getHeight(context);
        int cornerRadiusBottom = DisplayUtils.getCornerRadiusBottom(context);
        int cornerRadiusTop = DisplayUtils.getCornerRadiusTop(context);
        return new CircularCornerPathRenderer(
                cornerRadiusBottom, cornerRadiusTop, displayWidth, displayHeight);
    }
    /**
    /**
     * Receives an intensity from 0 (lightest) to 1 (darkest) and sets the handle color
     * Receives an intensity from 0 (lightest) to 1 (darkest) and sets the handle color
     * appropriately. Intention is to match the home handle color.
     * appropriately. Intention is to match the home handle color.