ProgressWheel:Android开源圆环进度条

这是一个自定义Android组件,用于代替标准进度条组件。实现各种进度条样式,包括圆环,扫描等。

XML:

在你的attr.xml(res/value)中加入以下


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16


<declare-styleable name="ProgressWheel">

<attr name="text"format="string"/>

<attr name="textColor"format="color"/>

<attr name="textSize"format="dimension"/>

<attr name="barColor"format="color"/>

<attr name="rimColor"format="color"/>

<attr name="rimWidth"format="dimension"/>

<attr name="spinSpeed"format="integer"/>

<attr name="circleColor"format="color"/>

<attr name="radius"format="dimension"/>

<attr name="barWidth"format="dimension"/>

<attr name="barLength"format="dimension"/>

<attr name="delayMillis"format="dimension"/>

<attr name="contourColor"format="color"/>

<attr name="contourSize"format="float"/>

</declare-styleable>

在你的root view 中加入


1

xmlns:ProgressWheel="http://schemas.android.com/apk/res/com.visualdenim.schooltraq"

1

在你的xml合适的地方加入 组件

1

2

3

4

5

6

7

8

9

10

11

12

13


<com.todddavies.components.progressbar.ProgressWheel

android:id="@+id/pw_spinner"

android:layout_width="200dp"

android:layout_height="200dp"

android:layout_centerInParent="true"

ProgressWheel:text="Authenticating..."

ProgressWheel:textColor="#222"

ProgressWheel:textSize="14sp"

ProgressWheel:rimColor="#330097D6"

ProgressWheel:barLength="60dp"

ProgressWheel:barColor="#0097D6"

ProgressWheel:barWidth="5dp"

ProgressWheel:rimWidth="2dp"/>

Java:

你需要从layout中获得进度条,或者初始化


1

2


ProgressWheel pw = newProgressWheel(myContext, myAttributes);

ProgressWheel pw = (ProgressWheel) findViewById(R.id.pw_spinner);

使用.spin() 开始进度条滚动, .stopSpinning 停止进度条滚动

增加进度有点棘手,  你可以调用.incrementProgress(), 但是这样就超过了360度, 因为一个圆有360度, 你超过360度就会自动重置, 一个百分百自动分配

http://c.tieba.baidu.com/p/3425898733

http://c.tieba.baidu.com/p/3425900530

http://c.tieba.baidu.com/p/3425907267

http://c.tieba.baidu.com/p/3425908675

http://c.tieba.baidu.com/p/3425909347

http://c.tieba.baidu.com/p/3425911528

http://c.tieba.baidu.com/p/3425912792

http://c.tieba.baidu.com/p/3425912875

http://c.tieba.baidu.com/p/3425914867

http://c.tieba.baidu.com/p/3425926733

http://c.tieba.baidu.com/p/3441567009

http://c.tieba.baidu.com/p/3441568050

http://c.tieba.baidu.com/p/3441570708

http://c.tieba.baidu.com/p/3441571432

http://c.tieba.baidu.com/p/3441572824

http://c.tieba.baidu.com/p/3451501811

http://c.tieba.baidu.com/p/3451508181

http://c.tieba.baidu.com/p/3451512569

http://c.tieba.baidu.com/p/3451517520

http://c.tieba.baidu.com/p/3451528407

http://c.tieba.baidu.com/p/3451517520

http://c.tieba.baidu.com/p/3451528407

http://c.tieba.baidu.com/p/3451546650

http://c.tieba.baidu.com/p/3451552596

http://c.tieba.baidu.com/p/3451558511

http://c.tieba.baidu.com/p/3451564361

http://c.tieba.baidu.com/p/3451570242

http://c.tieba.baidu.com/p/3451575955

http://c.tieba.baidu.com/p/3451581805

http://c.tieba.baidu.com/p/3451587508

http://c.tieba.baidu.com/p/3451593096

http://c.tieba.baidu.com/p/3451598614

http://c.tieba.baidu.com/p/3451604155

http://c.tieba.baidu.com/p/3451609517

http://c.tieba.baidu.com/p/3451614868

http://c.tieba.baidu.com/p/3451620307

http://c.tieba.baidu.com/p/3451625535

http://c.tieba.baidu.com/p/3451630601

http://c.tieba.baidu.com/p/3451635676

http://c.tieba.baidu.com/p/3451640781

http://c.tieba.baidu.com/p/3451660347

http://c.tieba.baidu.com/p/3451635676

http://c.tieba.baidu.com/p/3451640781

http://c.tieba.baidu.com/p/3451645843

http://c.tieba.baidu.com/p/3451650855

http://c.tieba.baidu.com/p/3451660347

http://c.tieba.baidu.com/p/3451665622

http://c.tieba.baidu.com/p/3451671457

http://c.tieba.baidu.com/p/3451676723

http://c.tieba.baidu.com/p/3451682028

http://c.tieba.baidu.com/p/3451687339

http://c.tieba.baidu.com/p/3451692782

http://c.tieba.baidu.com/p/3451698271

http://c.tieba.baidu.com/p/3451703740

http://c.tieba.baidu.com/p/3451714240

http://c.tieba.baidu.com/p/3451719491

http://c.tieba.baidu.com/p/3451724944

http://c.tieba.baidu.com/p/3451730537

http://c.tieba.baidu.com/p/3451735926

http://c.tieba.baidu.com/p/3451741336

http://c.tieba.baidu.com/p/3451752396

http://c.tieba.baidu.com/p/3451757960

http://c.tieba.baidu.com/p/3451763540

http://c.tieba.baidu.com/p/3451769087

http://c.tieba.baidu.com/p/3451780071

http://c.tieba.baidu.com/p/3451785507

http://c.tieba.baidu.com/p/3451790926

http://c.tieba.baidu.com/p/3451796475

http://c.tieba.baidu.com/p/3451801995

http://c.tieba.baidu.com/p/3451807533

http://c.tieba.baidu.com/p/3451813061

http://c.tieba.baidu.com/p/3451818556

http://c.tieba.baidu.com/p/3451824066

http://c.tieba.baidu.com/p/3451824066

http://c.tieba.baidu.com/p/3451835426

http://c.tieba.baidu.com/p/3451841091

http://c.tieba.baidu.com/p/3451846715

http://c.tieba.baidu.com/p/3451852555

http://c.tieba.baidu.com/p/3451858334

http://c.tieba.baidu.com/p/3452256667

http://c.tieba.baidu.com/p/3452191167

http://c.tieba.baidu.com/p/3452196681

http://c.tieba.baidu.com/p/3452200615

http://c.tieba.baidu.com/p/3452206320

http://c.tieba.baidu.com/p/3452256667

http://c.tieba.baidu.com/p/3452495966

http://c.tieba.baidu.com/p/3452500595

http://c.tieba.baidu.com/p/3452511669

http://c.tieba.baidu.com/p/3452518385

http://c.tieba.baidu.com/p/3452550987

http://c.tieba.baidu.com/p/3452564833

http://c.tieba.baidu.com/p/3452577465

http://c.tieba.baidu.com/p/3452619864

http://c.tieba.baidu.com/p/3452630773

http://c.tieba.baidu.com/p/3452619864

http://c.tieba.baidu.com/p/3453239963

http://c.tieba.baidu.com/p/3453242249

http://c.tieba.baidu.com/p/3453244530

http://c.tieba.baidu.com/p/3453258210

http://c.tieba.baidu.com/p/3453260354

http://c.tieba.baidu.com/p/3453263167

http://c.tieba.baidu.com/p/3453265983

http://c.tieba.baidu.com/p/3453268894

http://c.tieba.baidu.com/p/3453271934

http://c.tieba.baidu.com/p/3453275054

http://c.tieba.baidu.com/p/3453391863

http://c.tieba.baidu.com/p/3453401234

http://c.tieba.baidu.com/p/3453406659

http://c.tieba.baidu.com/p/3453412300

http://c.tieba.baidu.com/p/3453417928

http://c.tieba.baidu.com/p/3453423562

http://c.tieba.baidu.com/p/3453429315

http://c.tieba.baidu.com/p/3453435244

http://c.tieba.baidu.com/p/3453441305

http://c.tieba.baidu.com/p/3453447385

http://c.tieba.baidu.com/p/3453453547

http://c.tieba.baidu.com/p/3453459320

http://c.tieba.baidu.com/p/3453465288

http://c.tieba.baidu.com/p/3453471161

http://c.tieba.baidu.com/p/3453477161

http://c.tieba.baidu.com/p/3453483087

http://c.tieba.baidu.com/p/3453488996

http://c.tieba.baidu.com/p/3453495011

http://c.tieba.baidu.com/p/3453500792

http://c.tieba.baidu.com/p/3453506739

http://c.tieba.baidu.com/p/3453512953

http://c.tieba.baidu.com/p/3453519007

http://c.tieba.baidu.com/p/3454342449

http://c.tieba.baidu.com/p/3454346699

http://c.tieba.baidu.com/p/3454353334

http://c.tieba.baidu.com/p/3454359200

http://c.tieba.baidu.com/p/3454365360

http://c.tieba.baidu.com/p/3454371222

http://c.tieba.baidu.com/p/3454377261

http://c.tieba.baidu.com/p/3454383443

http://c.tieba.baidu.com/p/3454389543

http://c.tieba.baidu.com/p/3454395700

http://c.tieba.baidu.com/p/3454401877

http://c.tieba.baidu.com/p/3454408176

http://c.tieba.baidu.com/p/3454414465

http://c.tieba.baidu.com/p/3454420609

http://c.tieba.baidu.com/p/3454427170

http://c.tieba.baidu.com/p/3454445983

http://c.tieba.baidu.com/p/3454452546

http://c.tieba.baidu.com/p/3454459087

http://c.tieba.baidu.com/p/3454465738

http://c.tieba.baidu.com/p/3454472255

http://c.tieba.baidu.com/p/3454478736

http://c.tieba.baidu.com/p/3454485160

http://c.tieba.baidu.com/p/3454491608

http://c.tieba.baidu.com/p/3454498094

http://c.tieba.baidu.com/p/3454504776

http://c.tieba.baidu.com/p/3454511404

http://c.tieba.baidu.com/p/3454517946

http://c.tieba.baidu.com/p/3454524646

http://c.tieba.baidu.com/p/3454531331

http://c.tieba.baidu.com/p/3454537973

http://c.tieba.baidu.com/p/3454544653

http://c.tieba.baidu.com/p/3454551180

http://c.tieba.baidu.com/p/3454557749

http://c.tieba.baidu.com/p/3454564332

http://c.tieba.baidu.com/p/3454571118

http://c.tieba.baidu.com/p/3454670701

http://c.tieba.baidu.com/p/3454677894

http://c.tieba.baidu.com/p/3454685116

http://c.tieba.baidu.com/p/3454692366

http://c.tieba.baidu.com/p/3454699467

http://c.tieba.baidu.com/p/3454706718

http://c.tieba.baidu.com/p/3454714120

http://c.tieba.baidu.com/p/3454721866

http://c.tieba.baidu.com/p/3454729537

http://c.tieba.baidu.com/p/3454736804

http://c.tieba.baidu.com/p/3454743987

http://c.tieba.baidu.com/p/3454751197

http://c.tieba.baidu.com/p/3454758449

http://c.tieba.baidu.com/p/3454765819

http://c.tieba.baidu.com/p/3454772944

http://c.tieba.baidu.com/p/3454780462

http://c.tieba.baidu.com/p/3454787581

http://c.tieba.baidu.com/p/3454794665

http://c.tieba.baidu.com/p/3454801730

http://c.tieba.baidu.com/p/3454808639

http://c.tieba.baidu.com/p/3454815784

http://c.tieba.baidu.com/p/3454822720

http://c.tieba.baidu.com/p/3454829562

http://c.tieba.baidu.com/p/3454836204

http://c.tieba.baidu.com/p/3454842696

http://c.tieba.baidu.com/p/3454848962

http://c.tieba.baidu.com/p/3454855318

http://c.tieba.baidu.com/p/3454861446

http://c.tieba.baidu.com/p/3454867492

http://c.tieba.baidu.com/p/3454873305

http://c.tieba.baidu.com/p/3454879044

http://c.tieba.baidu.com/p/3454884899

http://c.tieba.baidu.com/p/3454890533

http://c.tieba.baidu.com/p/3454899742

http://c.tieba.baidu.com/p/3454906212

http://c.tieba.baidu.com/p/3455605389

http://c.tieba.baidu.com/p/3455610224

http://c.tieba.baidu.com/p/3455616325

http://c.tieba.baidu.com/p/3455622044

http://c.tieba.baidu.com/p/3455634028

http://c.tieba.baidu.com/p/3455656896

http://c.tieba.baidu.com/p/3455668823

http://c.tieba.baidu.com/p/3455674114

http://c.tieba.baidu.com/p/3455677438

时间: 2024-10-10 06:10:36

ProgressWheel:Android开源圆环进度条的相关文章

android中的进度条

Android中有多种进度条,如转圈的圆环,水平线的进度条.可拉伸的进度条等,各种进度条关系如下 SeekBar是可拉伸的进度条,RatingBar是用于评分的进度条,都属于ProgressBar的子类 ProgressBar有多种风格,如Horizontal.Small.Large.Inverse等 进度条的主要属性 进度条最大值:max 当前进度:progress 次要进度的值:SecondaryProgress progressbar.isIndeterminate(); 用于判断进度条是

【转】24. android dialog ——ProgressDialog 进度条对话框详解

原文网址:http://blog.csdn.net/jamesliulyc/article/details/6375598 首先在onCreateDialog方法里创建一个ProgressDialog,如下: [java] view plaincopy //this表示该对话框是针对当前Activity的 progressDialog = new ProgressDialog(this); //设置最大值为100 progressDialog.setMax(100); //设置进度条风格STYL

两种CSS3圆环进度条详解

晚上睡觉之前,我抽了1个多小时,研究了一下圆环进度条,结合从网上查阅的资料,我终于掌握了两种圆环的生成方法. 这次的效果就是单纯的CSS3效果,也没有写具体的JS,等以后有时间在好好整理一下吧~. 第一种:通过overflow溢出隐藏的方式: 这种方法好处在于容易理解,只需要一层一层的嵌套,即可得到效果,但是实现起来较为繁琐,HTML的结构也比较冗余. 先看HTML结构: <div class="circle-one"> <div class="circle

Android 中带有进度条效果的按钮(Button)

安卓中带有进度条效果的按钮,如下图: 1.布局文件如下activity_main.xml 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="fill_parent" 4 android:layo

[Android]组件之进度条2

这个例子不错,详细讲解了alertdialog及LayoutInflater的用法: main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:lay

Android——菜单和进度条

xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent&quo

android快递跟踪进度条

android 快递跟踪进度条 activity.class import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.app.Activity; import android.os.Bundle; import android.widget.ListView; public class MainActivity extends

Android View 之进度条+拖动条+星级评论条....

PS:将来的你会感谢现在奋斗的自己.... 学习内容: 1.进度条 2.拖动条 3.星级评论条 1.进度条...       进图条这东西想必大家是很熟悉的...为了使用户不会觉得应用程序死掉了,因此为之设置一个进度条使应用程序的运行状态更好的反馈给客户...这也就是进度条的作用...因此一般的应用程序都会加入进度条...进度条分为圆形进度条和线性的进度条...目的都是一样的,只是展示的效果是不同的...用代码讲解一下... <LinearLayout xmlns:android="htt

Android webview 显示进度条

代码: ProgressDialog dialog = null; /** * 嵌入浏览器 */ private void embedBrowser(String url) { Log.i(TAG, url); WebView browser = (WebView) this.findViewById(R.id.c131_webkit); if (browser != null) { wifi = new WifiService(this); if (wifi.isNetworkConnecte