GithubHelp home page GithubHelp logo

circleindexview's Introduction

CircleIndexView

A Smooth Circular digital indicator with text ##Demo images

##How to Use

If you want to use this libray,you only have to download circleindexview project,import it into your workspace and add the project as a library in your android project settings.

Or you can also use gradle dependency in your Project/Module build.gradle file like this:

allprojects {
    repositories {
        jcenter()
        maven { url "https://dl.bintray.com/gaoyuyu/Maven" }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.0'
//    compile project(path: ':circleindexview')
    compile 'com.gaoyy.circleindexview:circleindexview:1.0.0'
}

Then define the view in xml like this:

    <com.gaoyy.circleindexview.CircleIndexView
        android:id="@+id/circle_index_view"
        android:layout_width="200dp"
        android:layout_height="200dp"
        circleindexview:outCircleColor="@color/circleindexview_out_gray"
        circleindexview:inCircleColor="@color/circleindexview_in_green"
        circleindexview:numberColor="@color/circleindexview_in_green"
        circleindexview:numberTextSize="20sp"
        circleindexview:middleText="Pm25"
        circleindexview:middleTextColor="@color/circleindexview_sub_gray"
        circleindexview:middleTextSize="15sp"
        circleindexview:bottomText="空气污染指数"
        circleindexview:bottomTextColor="@color/circleindexview_main_text"
        circleindexview:bottomTextSize="15sp"
        />

the Customized properties are in the follow table:

Property Format Default
outCircleColor color Color.LTGRAY
inCircleColor color Color.GREEN
numberColor color Color.GREEN
numberTextSize dimension 20sp
middleText string N/A
middleTextColor color Color.LTGRAY
middleTextSize dimension 15sp
bottomText string
bottomTextColor color Color.LTGRAY
bottomTextSize dimension 15sp

This picture will give you guys a more clear explanation.

images

When you want to update data,just do like this:

circleIndexView.updateIndex(50);

##Tips In order to make CircleIndexView pretty nice,you might be best to set its layout_width/layout_height attributes an exact value(sp),and the values of layout_width and layout_height are equal.(NOTICE. it will be 200sp as default value whether you set layout_width/layout_height to match_parent or wrap_content)

##Why do I want to Customize This Stuff I saw the built-in Weather App on my MIUI8 OS,all of its layout and interface effect are very good-looking,but this type of indicator is indeed rigid,didn't see any animations (may be,it's under another Layout,so can't see the effect when finished loading data?who knows...) , so I write for my own satisfaction.

Simple Reason.

License

Copyright 2015, gaoyuyu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

circleindexview's People

Contributors

gaoyuyu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

circleindexview's Issues

最低版本问题

Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 19 declared in library [com.gaoyy.circleindexview:circleindexview:1.0.0]
导入时会遇到这个问题。
建议作者是不是在库里把最低版本调低一点?

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.