Giter Club home page Giter Club logo

circularscore's Introduction

CircularScore

A lightweight custom circular view for android.

Download

alt text

Gradle

dependencies {
    compile 'com.wssholmes.stark:circular-score:0.1.1'
}

Usage

<com.wssholmes.stark.circular_score.CircularScoreView
            android:id="@+id/two"
            android:layout_width="100dp"
            android:layout_height="100dp"
            app:score="50"
            app:setPrimaryColor="@color/color_primary"
            app:setSecondaryColor="@color/color_secondary"
            app:setBackgroundColor="@color/color_background"
            app:setTextColor="@color/color_text"/>
CircularScoreView circularScoreView = (CircularScoreView) findViewById(R.id.score_view);
circularScoreView.setScore(20);

Properties

  • app:score : int to set score/progress.
  • app:setPrimaryColor : used to set color of score indicator.
  • app:setSecondaryColor : used to set color of reamaining indicator.
  • app:setBackgroundColor : used to set color of background circle.
  • app:setTextColor : used to set color of the text in the middle.

Methods

  • void setScore(int score) : used to set the score.
  • void setPrimaryColor(int color) : used to set the color of score indicator.
  • void setSecondaryColor(int color): used to set color of remaining indicator.
  • void setBackgroundColor(int color): used to set color of background circle.
  • void setTextColor(int color) : used to set color of the text in the middle.

Animation

CircularScoreAnimation circularScoreAnimation = new CircularScoreAnimation(circularScoreView, 25);
circularScoreAnimation.setDuration(2000); //duration in millisecond.
circularScoreView.startAnimation(circularScoreAnimation);
CircularScoreAnimation circularScoreAnimation = new CircularScoreAnimation(circularScoreView, 25, 75);
circularScoreAnimation.setDuration(1500); //duration in millisecond.
circularScoreView.startAnimation(circularScoreAnimation);

Constructors

  • CircularScoreAnimation(CircularScoreView circularScoreView, int endScore) : use to set animation from 0 to endScore.
  • CircularScoreAnimation(CircularScoreView circularScoreView, int starScore, int endScore) : use to set animation from startScore to endScore.

License

The contents of this repository are covered under the Apache License

circularscore's People

Contributors

47rajat avatar

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.