Loading packages/SystemUI/res/values/dimens.xml +0 −3 Original line number Diff line number Diff line Loading @@ -776,7 +776,4 @@ <dimen name="qs_gutter_height">6dp</dimen> <!-- Width of the hollow triangle for empty signal state --> <dimen name="mobile_signal_empty_strokewidth">2dp</dimen> </resources> packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java +14 −21 Original line number Diff line number Diff line Loading @@ -85,12 +85,8 @@ public class SignalDrawable extends Drawable { {-1.9f / VIEWPORT, -1.9f / VIEWPORT}, }; // 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 final float mEmptyDiagInset; // == mEmptyStrokeWidth * INV_TAN private static final float CUT_WIDTH_DP = 1f / 12f; private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private final Paint mForegroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); Loading Loading @@ -126,11 +122,6 @@ public class SignalDrawable extends Drawable { Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_fill); 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(); setDarkIntensity(0); } Loading Loading @@ -262,20 +253,22 @@ public class SignalDrawable extends Drawable { } if (mState == STATE_EMPTY) { final float cutWidth = CUT_WIDTH_DP * height; final float cutDiagInset = cutWidth * INV_TAN; // Cut out a smaller triangle from the center of mFullPath mCutPath.reset(); mCutPath.setFillType(FillType.WINDING); mCutPath.moveTo(width - padding - mEmptyStrokeWidth, height - padding - mEmptyStrokeWidth); mCutPath.lineTo(width - padding - mEmptyStrokeWidth, padding + mEmptyDiagInset); mCutPath.lineTo(padding + mEmptyDiagInset, height - padding - mEmptyStrokeWidth); mCutPath.lineTo(width - padding - mEmptyStrokeWidth, height - padding - mEmptyStrokeWidth); // In empty state, draw the full path as the foreground paint mForegroundPath.set(mFullPath); mFullPath.reset(); mForegroundPath.op(mCutPath, Path.Op.DIFFERENCE); mCutPath.moveTo(width - padding - cutWidth, height - padding - cutWidth); mCutPath.lineTo(width - padding - cutWidth, padding + cutDiagInset); mCutPath.lineTo(padding + cutDiagInset, height - padding - cutWidth); mCutPath.lineTo(width - padding - cutWidth, height - padding - cutWidth); // Draw empty state as only background mForegroundPath.reset(); mFullPath.op(mCutPath, Path.Op.DIFFERENCE); } else if (mState == STATE_AIRPLANE) { // Airplane mode is slashed, full-signal mForegroundPath.set(mFullPath); Loading Loading
packages/SystemUI/res/values/dimens.xml +0 −3 Original line number Diff line number Diff line Loading @@ -776,7 +776,4 @@ <dimen name="qs_gutter_height">6dp</dimen> <!-- Width of the hollow triangle for empty signal state --> <dimen name="mobile_signal_empty_strokewidth">2dp</dimen> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/phone/SignalDrawable.java +14 −21 Original line number Diff line number Diff line Loading @@ -85,12 +85,8 @@ public class SignalDrawable extends Drawable { {-1.9f / VIEWPORT, -1.9f / VIEWPORT}, }; // 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 final float mEmptyDiagInset; // == mEmptyStrokeWidth * INV_TAN private static final float CUT_WIDTH_DP = 1f / 12f; private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); private final Paint mForegroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); Loading Loading @@ -126,11 +122,6 @@ public class SignalDrawable extends Drawable { Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_fill); 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(); setDarkIntensity(0); } Loading Loading @@ -262,20 +253,22 @@ public class SignalDrawable extends Drawable { } if (mState == STATE_EMPTY) { final float cutWidth = CUT_WIDTH_DP * height; final float cutDiagInset = cutWidth * INV_TAN; // Cut out a smaller triangle from the center of mFullPath mCutPath.reset(); mCutPath.setFillType(FillType.WINDING); mCutPath.moveTo(width - padding - mEmptyStrokeWidth, height - padding - mEmptyStrokeWidth); mCutPath.lineTo(width - padding - mEmptyStrokeWidth, padding + mEmptyDiagInset); mCutPath.lineTo(padding + mEmptyDiagInset, height - padding - mEmptyStrokeWidth); mCutPath.lineTo(width - padding - mEmptyStrokeWidth, height - padding - mEmptyStrokeWidth); // In empty state, draw the full path as the foreground paint mForegroundPath.set(mFullPath); mFullPath.reset(); mForegroundPath.op(mCutPath, Path.Op.DIFFERENCE); mCutPath.moveTo(width - padding - cutWidth, height - padding - cutWidth); mCutPath.lineTo(width - padding - cutWidth, padding + cutDiagInset); mCutPath.lineTo(padding + cutDiagInset, height - padding - cutWidth); mCutPath.lineTo(width - padding - cutWidth, height - padding - cutWidth); // Draw empty state as only background mForegroundPath.reset(); mFullPath.op(mCutPath, Path.Op.DIFFERENCE); } else if (mState == STATE_AIRPLANE) { // Airplane mode is slashed, full-signal mForegroundPath.set(mFullPath); Loading