需要修改的文件
SettingsLib 模块下的SignalDrawable.java

   @Override    public void draw(@NonNull Canvas canvas) {        final float width = getBounds().width();        final float height = getBounds().height();        boolean isRtl = getLayoutDirection() == LayoutDirection.RTL;        if (isRtl) {            canvas.save();            // Mirror the drawable            canvas.translate(width, 0);            canvas.scale(-1.0f, 1.0f);        }        mFullPath.reset();        mFullPath.setFillType(FillType.WINDING);        final float padding = Math.round(PAD * width);        final float cornerRadius = RADIUS_RATIO * height;        // Offset from circle where the hypotenuse meets the circle        final float diagOffset = DIAG_OFFSET_MULTIPLIER * cornerRadius;        // 1 - Bottom right, above corner        mFullPath.moveTo(width - padding, height - padding - cornerRadius);        // 2 - Line to top right, below corner        mFullPath.lineTo(width - padding, padding + cornerRadius + mAppliedCornerInset);        // 3 - Arc to top right, on hypotenuse        mFullPath.arcTo(                width - padding - (2 * cornerRadius),                padding + mAppliedCornerInset,                width - padding,                padding + mAppliedCornerInset + (2 * cornerRadius),                0.f, -135.f, false        );        // 4 - Line to bottom left, on hypotenuse        mFullPath.lineTo(padding + mAppliedCornerInset + cornerRadius - diagOffset,                height - padding - cornerRadius - diagOffset);        // 5 - Arc to bottom left, on leg        mFullPath.arcTo(                padding + mAppliedCornerInset,                height - padding - (2 * cornerRadius),                padding + mAppliedCornerInset + ( 2 * cornerRadius),                height - padding,                -135.f, -135.f, false        );        // 6 - Line to bottom rght, before corner        mFullPath.lineTo(width - padding - cornerRadius, height - padding);        // 7 - Arc to beginning (bottom right, above corner)        mFullPath.arcTo(                width - padding - (2 * cornerRadius),                height - padding - (2 * cornerRadius),                width - padding,                height - padding,                90.f, -90.f, false        );        Log.d(TAG,"wjc mState = "+mState);        if (mState == STATE_CARRIER_CHANGE) {            float cutWidth = (DOT_CUT_WIDTH * width);            float cutHeight = (DOT_CUT_HEIGHT * width);            float dotSize = (DOT_SIZE * height);            float dotPadding = (DOT_PADDING * height);            mFullPath.moveTo(width - padding, height - padding);            mFullPath.rLineTo(-cutWidth, 0);            mFullPath.rLineTo(0, -cutHeight);            mFullPath.rLineTo(cutWidth, 0);            mFullPath.rLineTo(0, cutHeight);            float dotSpacing = dotPadding * 2 + dotSize;            float x = width - padding - dotSize;            float y = height - padding - dotSize;            mForegroundPath.reset();            drawDot(mFullPath, mForegroundPath, x, y, dotSize, 2);            drawDot(mFullPath, mForegroundPath, x - dotSpacing, y, dotSize, 1);            drawDot(mFullPath, mForegroundPath, x - dotSpacing * 2, y, dotSize, 0);        } else if (mState == STATE_CUT) {/*            float cut = (CUT_OUT * width);            mFullPath.moveTo(width - padding, height - padding);            mFullPath.rLineTo(-cut, 0);            mFullPath.rLineTo(0, -cut);            mFullPath.rLineTo(cut, 0);            mFullPath.rLineTo(0, cut);*/        }        if (mState == STATE_EMPTY) {            // Where the corners would be if this were a real triangle            mVirtualTop.set(                    width - padding,                    (padding + cornerRadius + mAppliedCornerInset) - (INV_TAN * cornerRadius));            mVirtualLeft.set(                    (padding + cornerRadius + mAppliedCornerInset) - (INV_TAN * cornerRadius),                    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            mCutPath.reset();            mCutPath.setFillType(FillType.WINDING);            mCutPath.moveTo(width - padding - cutWidth, height - padding - cutWidth);            mCutPath.lineTo(width - padding - cutWidth, mVirtualTop.y + cutDiagInset);            mCutPath.lineTo(mVirtualLeft.x + 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, fully drawn background            mForegroundPath.reset();            mSlash.draw((int) height, (int) width, canvas, mPaint);        } else if (mState != STATE_CARRIER_CHANGE) {            /*mForegroundPath.reset();            int sigWidth = Math.round(calcFit(mLevel / (mNumLevels - 1)) * (width - 2 * padding));            mForegroundPath.addRect(padding, padding, padding + sigWidth, height - padding,                    Direction.CW);            mForegroundPath.op(mFullPath, Op.INTERSECT);*/        }        canvas.drawPath(mFullPath, mPaint);        canvas.drawPath(mForegroundPath, mForegroundPaint);        if (mState == STATE_CUT) {            mXPath.reset();            mXPath.moveTo(X_PATH[0][0] * width, X_PATH[0][1] * height);            for (int i = 1; i < X_PATH.length; i++) {                mXPath.rLineTo(X_PATH[i][0] * width, X_PATH[i][1] * height);            }            canvas.drawPath(mXPath, mForegroundPaint);        }        if (isRtl) {            canvas.restore();        }    }

上述代码块中的

        } else if (mState == STATE_CUT) {            float cut = (CUT_OUT * width);            mFullPath.moveTo(width - padding, height - padding);            mFullPath.rLineTo(-cut, 0);            mFullPath.rLineTo(0, -cut);            mFullPath.rLineTo(cut, 0);            mFullPath.rLineTo(0, cut);        }        if (mState == STATE_CUT) {            mXPath.reset();            mXPath.moveTo(X_PATH[0][0] * width, X_PATH[0][1] * height);            for (int i = 1; i < X_PATH.length; i++) {                mXPath.rLineTo(X_PATH[i][0] * width, X_PATH[i][1] * height);            }            canvas.drawPath(mXPath, mForegroundPaint);        }        

注释调就可以了

更多相关文章

  1. android studio基础教程:3.美化按钮
  2. Android(安卓)获取包名,版本信息及VersionName名称
  3. 译:Android(安卓)N不再支持通过Intent传递“file://”scheme
  4. Android定时器实现的几种方法
  5. Android(安卓)Audio代码分析13 - AudioTrack::getPosition函数
  6. Android应用开发编程规范
  7. Android(安卓)密码的隐藏和显示
  8. android 发布时去除Log
  9. 在Android中通过代码切换到指定 WiFi

随机推荐

  1. Android(安卓)Binder IPC详解-Android学
  2. Android的消息机制之ThreadLocal的工作原
  3. Android(安卓)sax解析XML数据
  4. Android(安卓)Bitmap图片处理,防止内存溢
  5. Android(安卓)socket 编程 实现消息推送(
  6. Android拾萃- Android(安卓)进程层次
  7. Android实现可拖动的悬浮按钮控件
  8. 【Android】学习笔记(5)——浅谈Handler
  9. [Android]Thread线程入门4--多线程
  10. Android(安卓)的 intent (手抄)