当前位置:   article > 正文

Android弧形步数进度_android 半圆进度

android 半圆进度

Android弧形步数进度

一、效果图

在这里插入图片描述

二、代码实现

2.1 自定义属性

    <declare-styleable name="QQStepView">
        <attr name="outColor" format="color"/>
        <attr name="outWidth" format="dimension"/>
        <attr name="innerColor" format="color"/>
        <attr name="innerWidth" format="dimension"/>
        <attr name="step" format="string"/>
    </declare-styleable>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

2.2 代码实现

package com.example.layoutdemo.widget;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;

import androidx.annotation.Nullable;

import com.example.layoutdemo.R;

public class QQStepView extends View {
   
    private static final String TAG = "QQStepView";
    private int mOuterColor
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/474125
推荐阅读
相关标签
  

闽ICP备14008679号