​自定义圆形仪表盘 View CircleRangeView

码农软件 · 软件分类 · Android UI 组件 · 2019-04-23 18:42:45

软件介绍

CircleRangeView是自定义圆形仪表盘View,适合根据数值显示不同等级范围的场景

一、效果图

二、用法

1.布局文件引入:

<com.ganxin.circlerangeview.CircleRangeView
        android:id="@+id/circleRangeView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:rangeColorArray="@array/circlerangeview_colors"
        app:rangeTextArray="@array/circlerangeview_txts"
        app:rangeValueArray="@array/circlerangeview_values"/>
  • 自定义属性:

  • rangeColorArray:等级颜色数组,必填

  • rangeValueArray:等级数值数组,数组长度同rangeColorArray保持一致,必填

  • rangeTextArray:等级文本数组,数组长度同rangeColorArray保持一致,必填

  • borderColor:外圆弧颜色,可选

  • cursorColor:指示标颜色,可选

  • extraTextColor:附加文本颜色,可选 

  • rangeTextSize:等级文本字体大小,可选 

  • extraTextSize:附加文本字体大小,可选

2.在你的onCreate方法或者fragment的onCreateView方法中,根据id绑定该控件

 CircleRangeView circleRangeView= (CircleRangeView) findViewById(R.id.circleRangeView);

3.在合适的时机,调用方法给控件设值

    List<String> extras =new ArrayList<>();
    extras.add("收缩压:116");
    extras.add("舒张压:85  ");

    //circleRangeView.setValueWithAnim(value);
    circleRangeView.setValueWithAnim(value,extras);

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

Practical Vim, Second Edition

Practical Vim, Second Edition

Drew Neil / The Pragmatic Bookshelf / 2015-10-31 / USD 29.00

Vim is a fast and efficient text editor that will make you a faster and more efficient developer. It’s available on almost every OS, and if you master the techniques in this book, you’ll never need an......一起来看看 《Practical Vim, Second Edition》 这本书的介绍吧!

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

在线 XML 格式化压缩工具

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换