Giter Site home page Giter Site logo

circleview's Introduction

CircleView

A colorful circle view with text.

license maven-central API

A colorful circle view with text, you can use it as a avatar! Except in addition, we can set the direction of the text, vertical or horizontal and any angle.

Screenshots

                         demo_gif                          in_rv

Getting started

Add a dependency to your build.gradle:

dependencies {
    compile 'me.songning.CircleView:library:1.0.0'
}

or Maven:

<dependency>
  <groupId>me.songning.CircleView</groupId>
  <artifactId>library</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Usage

Add the me.songning.library.CircleView to your layout XML file.

    <me.songning.library.CircleView
        android:id="@+id/circleView"
        android:layout_width="88dp"
        android:layout_height="88dp"
        app:randomColor="true"
        app:text="Hello"
        app:textOrientation="vertical"/>

XML attributes

Name Type Default Description
circleColor color #03A9F4 CircleView background color
textColor color #FFFFFF Text color
textSize dimension 16sp Text size
text string empty Text content
randomColor boolean false If true, the CircleView background color will show in random color
singleText boolean false If true, no matter how long the text, just display a text
textAngle float 0f Set the text arbitrary angle in CircleView
speed integer 4000 If it can rotate, set the rotation speed
textOrientation enum vertical Text direction
rotateOrientation enum clockwise Text rotation direction

Public Methods

Name Description
startRotateAnimation() Start rotating
stopRotateAnimation() Stop rotating
toggleRotateOrientation() If rotating, toggle direction of rotation
setRotateOrientation(int) Set rotation direction of the rotate animation, clockwise or anti-clockwise
setRotateSpeed(int) Set rotation speed
setCircleColor(int) Set CircleView background color
setTextColor(int) Set text color
setTextSize(float) Set text size
setText(int or String) Set text content
setRandomColor(boolean) If true, the CircleView background color will show in random color
setSingleText(boolean) If true, no matter how long the text, just display a text
setAngle(float) Set the text arbitrary angle in CircleView
setTextOrientation(int) Set text direction, vertical or horizontal
show() Show the CircleView with the scale animation
hide() Hide the CircleView with the scale animation
toggleShow() Toggle show or hide

Versions

1.0.0

  • Initial release

About me

License

Copyright 2016 SongNing

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.

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.