简单手机九宫格解锁

  • Post author:
  • Post category:其他


private void init(Context context) {
    this.context = context;
    //设置画笔
    mPaint = new Paint();
    mPaint2 = new Paint();
    mPaint3 = new Paint();
    //设置画圆的画笔
    path = new Path();
    //设置路线的画笔
    path2 = new Path();
    mPaint.setColor(Color.parseColor("#ff5f50"));
    mPaint.setAntiAlias(true);
    mPaint.setStrokeWidth(5);
    mPaint.setTextSize(30);
    mPaint.setTextAlign(Paint.Align.CENTER);
    mPaint2.setColor(Color.parseColor("#ff5f50"));
    mPaint2.setAntiAlias(true);
    mPaint2.setStrokeWidth(20);
    mPaint2.setTextSize(30);
    mPaint2.setStyle(Paint.Style.STROKE);
    mPaint2.setTextAlign(Paint.Align.CENTER);
    //设置圆的的数量
    for (int i = 1; i <= 9; i++) {
        list.add(i);
    }
    //s设置解锁密码
    list2.add(1);
    list2.add(4);
    list2.add(8);
    list2.add(9); }


@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    //圆半径
    circleRadius = 50;
 



版权声明:本文为psjx0127原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。