Android 绘制圆环的控件 RingPercentView

码农软件 · 软件分类 · Android UI 组件 · 2019-04-24 21:41:41

软件介绍

绘制圆环的控件,支持时间设置,角度设置,背景设置等

一、使用方法

1)在Layout中使用如下声明

        android:id="@+id/arc_percent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:radius="100dp"
        app:isRing="false"
        />

其中radus表示半径,isRing表示是否绘制圆环

2)初始化参数

        ring.setBg(0, 360,Color.rgb(30, 96, 200));//设置圆环背景
        ring.setFrontColor(Color.rgb(255, 255, 255));//设置圆环前景
        ring.setPrimaryTextParam(primaryTextSize,Color.rgb(255, 255, 255), cpuPercent+"%");//设置主标题属性
        ring.setSecondryTextParam(secondaryTextSize, Color.rgb(255, 255, 255), "CPU");//设置负标题属性
        ring.setRingWidth(ringWidth);

3)绘制Ring
/**
    * @param startAngle开始角度
    * @param percent 百分比
    * @param radius 半径
    * @param totalDrawTime 动画总时间
    */
   //绘制圆环    public void drawCircleRing(int startAngle,int percent,int totalDrawTime)
   //绘制扇形        public void drawArcRing(int startAngle,  int  percent, int totalDrawTime)

本文地址:https://www.codercto.com/soft/d/4315.html

The Haskell School of Expression

The Haskell School of Expression

Paul Hudak / Cambridge University Press / 2000-01 / USD 95.00

Functional programming is a style of programming that emphasizes the use of functions (in contrast to object-oriented programming, which emphasizes the use of objects). It has become popular in recen......一起来看看 《The Haskell School of Expression》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具