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

Commit 423022e8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of 91870d15 to oc-dr1-dev" into oc-dr1-dev

parents 4b535d93 2b8dac29
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -827,7 +827,4 @@
    <!-- How far to inset the rounded edges -->
    <!-- How far to inset the rounded edges -->
    <dimen name="stat_sys_mobile_signal_circle_inset">0.9dp</dimen>
    <dimen name="stat_sys_mobile_signal_circle_inset">0.9dp</dimen>


    <!-- Width of the hollow triangle for empty signal state -->
    <dimen name="mobile_signal_empty_strokewidth">2dp</dimen>

</resources>
</resources>
+12 −23
Original line number Original line Diff line number Diff line
@@ -100,12 +100,8 @@ public class SignalDrawable extends Drawable {
    // How far the circle defining the corners is inset from the edges
    // How far the circle defining the corners is inset from the edges
    private final float mAppliedCornerInset;
    private final float mAppliedCornerInset;


    // The easiest way to understand this is as if we set Style.STROKE and draw the triangle,
    // but that is only theoretically right. Instead, draw the triangle and clip out a smaller
    // one inset by this amount.
    private final float mEmptyStrokeWidth;
    private static final float INV_TAN = 1f / (float) Math.tan(Math.PI / 8f);
    private static final float INV_TAN = 1f / (float) Math.tan(Math.PI / 8f);
    private final float mEmptyDiagInset;  // == mEmptyStrokeWidth * INV_TAN
    private static final float CUT_WIDTH_DP = 1f / 12f;


    // Where the top and left points of the triangle would be if not for rounding
    // Where the top and left points of the triangle would be if not for rounding
    private final PointF mVirtualTop  = new PointF();
    private final PointF mVirtualTop  = new PointF();
@@ -145,11 +141,6 @@ public class SignalDrawable extends Drawable {
                Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_fill);
                Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_fill);
        mIntrinsicSize = context.getResources().getDimensionPixelSize(R.dimen.signal_icon_size);
        mIntrinsicSize = context.getResources().getDimensionPixelSize(R.dimen.signal_icon_size);


        // mCutPath parameters
        mEmptyStrokeWidth = context.getResources()
                .getDimensionPixelSize(R.dimen.mobile_signal_empty_strokewidth);
        mEmptyDiagInset = mEmptyStrokeWidth * INV_TAN;

        mHandler = new Handler();
        mHandler = new Handler();
        setDarkIntensity(0);
        setDarkIntensity(0);


@@ -326,22 +317,20 @@ public class SignalDrawable extends Drawable {
                    (padding + cornerRadius + mAppliedCornerInset) - (INV_TAN * cornerRadius),
                    (padding + cornerRadius + mAppliedCornerInset) - (INV_TAN * cornerRadius),
                    height - padding);
                    height - padding);


            final float cutWidth = CUT_WIDTH_DP * height;
            final float cutDiagInset = cutWidth * INV_TAN;

            // Cut out a smaller triangle from the center of mFullPath
            // Cut out a smaller triangle from the center of mFullPath
            mCutPath.reset();
            mCutPath.reset();
            mCutPath.setFillType(FillType.WINDING);
            mCutPath.setFillType(FillType.WINDING);
            mCutPath.moveTo(width - padding - mEmptyStrokeWidth,
            mCutPath.moveTo(width - padding - cutWidth, height - padding - cutWidth);
                    height - padding - mEmptyStrokeWidth);
            mCutPath.lineTo(width - padding - cutWidth, mVirtualTop.y + cutDiagInset);
            mCutPath.lineTo(width - padding - mEmptyStrokeWidth,
            mCutPath.lineTo(mVirtualLeft.x + cutDiagInset, height - padding - cutWidth);
                    mVirtualTop.y + mEmptyDiagInset);
            mCutPath.lineTo(width - padding - cutWidth, height - padding - cutWidth);
            mCutPath.lineTo(mVirtualLeft.x + mEmptyDiagInset,

                    height - padding - mEmptyStrokeWidth);
            // Draw empty state as only background
            mCutPath.lineTo(width - padding - mEmptyStrokeWidth,
            mForegroundPath.reset();
                    height - padding - mEmptyStrokeWidth);
            mFullPath.op(mCutPath, Path.Op.DIFFERENCE);

            // In empty state, draw the full path as the foreground paint
            mForegroundPath.set(mFullPath);
            mFullPath.reset();
            mForegroundPath.op(mCutPath, Path.Op.DIFFERENCE);
        } else if (mState == STATE_AIRPLANE) {
        } else if (mState == STATE_AIRPLANE) {
            // Airplane mode is slashed, full-signal
            // Airplane mode is slashed, full-signal
            mForegroundPath.set(mFullPath);
            mForegroundPath.set(mFullPath);