Giter Club home page Giter Club logo

netsscoreview's Introduction

NetsScoreView

NetsScoreView一个网状评分自定义控件,支持多种自定义属性

先看看效果吧

img

集成步骤

在根项目gradle添加

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

在项目gradle添加

  dependencies {
	        compile 'com.github.HanJinLiang:NetsScoreView:V1.0.1'
	}

使用说明

在XML布局直接使用

<com.hanjinliang.netsscore.NetsScoreView
        android:id="@+id/NetsScoreView"
        android:layout_width="300dp"
        android:layout_height="300dp"
        netsscore:NetsColor="#afafaf"
        netsscore:ScoreFillColor="#60FF4081"
        netsscore:ScoreLineColor="#FF4081"
        netsscore:ScoreTxtColor="#2b2b2b"
        netsscore:MaxScore="100"
        netsscore:EdgeCount="6"
        netsscore:TxtSize="14sp" />

也可以直接new NetsScoreView() 使用

设置数据源

     /**
     * 设置数据源
     * @param edgeCount 多边形变数
     * @param scores  数据源
     */
    public void setData(int edgeCount,float[] scores){}

支持自定义分数Format

    mNetsScoreView.setTxtFormat(new NetsScoreView.TxtFormat() {
            @Override
            public String originalDataFormat(int index, float value) {
                return value+"分数";//格式化显示数值
            }
        });

自定义属性说明

属性名称 解释
NetsColor 网格线的颜色
ScoreLineColor 分数覆盖物边缘线颜色
ScoreFillColor 分数覆盖物填充颜色
EdgeCount 多边形边数
MaxScore 分数最大值
ScoreTxtColor 分数字体颜色
TxtSize 分数字体大小

其他

参考自SpiderWebScoreView,纯粹当做自己练习

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.