Android彈性進度條更新:ElasticProgressBar

jopen 9年前發布 | 10K 次閱讀 Android開發 移動開發 ElasticProgressBar

彈性進度條,是為Android做了一個加載條。

alt tag

alt tag

Elastic Progress Bar , is a loading bar made for Android , the initial design is https://github.com/Tibolte/ElasticDownload , I applied some changes to make it accessible to everyone!

alt tag

USAGE

Elastic Progress Bar is pushed to JCenter, so you just need to add the following dependency to yourbuild.gradle.

compile  'it.michelelacorte.elasticprogressbar:library:1.0.4'

In alternative you can use AAR repository with:

allprojects {
    repositories {
        maven { url "https://dl.bintray.com/michelelacorte/maven/" }
        jcenter()
        mavenCentral()

    }
}

And add this dependecies

compile  'it.michelelacorte.elasticprogressbar:library:1.0.4@aar'

In youlayout.xml

<it.michelelacorte.elasticprogressbar.ElasticDownloadView
        android:id="@+id/elastic_download_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerInParent="true"/>

Then in yourMainActivity.java

ElasticDownloadView mElasticDownloadView;
mElasticDownloadView = (ElasticDownloadView)findViewById(R.id.elastic_download_view);

//Call startIntro() to start animation
mElasticDownloadView.startIntro();

//You can set progress
mElasticDownloadView.setProgress(10);

//If is finish animation
 mElasticDownloadView.success();

//Or fail
//mElasticDownloadView.fail();

You can set color background with (default iscolorPrimary), make sure to call this beforesetContentView(..)of your activity:

OptionView.setBackgroundColorSquare(int color)

For setnoBackgrounddo this (withoutsetBackgroundColorSquare, remembersetBackgroundColorSquareis priority thannoBackground

OptionView.noBackground = true;

alt tag

alt tag

SYSTEM REQUIREMENT

Android API 11+


項目主頁:http://www.baiduhome.net/lib/view/home/1448847789936

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!