android动态添加圆,Android实现的动态效果,一个数字圆圈进度效果

CircularBarPager 625332134c6f4d4600884b99daebf603.png

A Lollipop material design styled CircularBarPager library (API 10+).

To include in your project, add this to your build.gradle file:

//CircularBarPager

compile 'com.github.orangegangsters:library:1.3.4@aar'

//CirclePageIndicator

compile 'com.viewpagerindicator:library:2.4.1@aar'

//Animations and progress value easing

compile 'com.daimajia.easing:library:2.1@aar'

Starting from version 1.3.10, we are moving to a new package name (we skipped from 1.3.4 to 1.3.10):

//CircularBarPager

compile 'com.github.omadahealth:library:1.3.11@aar'

//CirclePageIndicator

compile 'com.viewpagerindicator:library:2.4.1@aar'

//Animations and progress value easing

compile 'com.daimajia.easing:library:2.1@aar'

625332134c6f4d4600884b99daebf603.png

========

By

Usage

Look at the example app for a live example on how to use the library.

Preparing dependencies

In order to use the CirclePageIndicator by Square, you need to add a repo to your main build.gradle file:

allprojects {

repositories {

maven { url 'http://dl.bintray.com/populov/maven/' }

jcenter()

}

}

In XML:

android:id="@+id/circularBarPager"

android:layout_height="match_parent"

android:layout_width="match_parent"

android:paddingLeft="30dp"

android:paddingRight="30dp"

android:layout_centerInParent="true"

style="@style/CircularBarPagerStyle"/>

In styles.xml

match_parent

match_parent

100

0

0.75dp

0.75dp

8dp

8dp

true

true

#00000000

========

Customization

You can change several attributes in the XML file:

app:arc_progress [integer def:0 0-100] --> The default arc progress when start up

app:progress_arc_max [integer def:100 0-100] --> The maximum arc progress

app:progress_arc_clockwise_color [color hex] --> The main color in clockwise mode

app:progress_arc_clockwise_outline_color [color hex] --> The outline color in clockwise mode

app:progress_arc_counter_clockwise_color [color hex] --> The outline color in counter-clockwise mode

app:progress_arc_counter_clockwise_outline_color [color hex] --> The outline color in counter-clockwise mode

app:progress_arc_clockwise_width [integer dp] --> The width size of the main color in clockwise mode

app:progress_arc_clockwise_outline_width [integer dp] --> The width size of the outline color in clockwise mode

app:progress_arc_counter_clockwise_width [integer dp] --> The width size of the color in counter-clockwise mode

app:progress_arc_counter_clockwise_outline_width [integer dp] --> The width size of the outline color in counter-clockwise mode

app:progress_pager_on_click_enabled [boolean] --> The boolean that enables or disables the click enabled (on click, changes page)

app:progress_start_line_enabled [boolean] --> The boolean that enables the line that displays the starting position of the pager

app:progress_pager_on_click_enabled [boolean] --> The boolean that enables the user to change pages with a click as well as a slide

app:progress_pager_fill_circle_color [color hex] --> The color to fill the circle, transparent as default

app:progress_pager_fill_mode [enum int] --> The mode to fill the circle, "default_mode" or "pie_mode"

You can access every components programmatically by getting the CircularBarPager object:

CircularBarPager mCircularBarPager = (CircularBarPager) findViewById(R.id.circularBarPager);

CircularBar circularBar = mCircularBarPager.getCircularBar();

ViewPager viewPager = mCircularBarPager.getViewPager();

CirclePageIndicator circlePageIndicator = mCircularBarPager.getCirclePageIndicator();

========

Credits

We used ViewPagerIndicator from JakeWharton (https://github.com/JakeWharton/ViewPagerIndicator) for the page indicator at the bottom of the CircularBarPager

We used AnimationEasingFunctions from daimajia (https://github.com/daimajia/AnimationEasingFunctions) to also use beautiful animations on API 10+

========

License

The MIT License (MIT)

Copyright (c) 2017 Omada Health

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值