一個支持顯示下載進度的,帶有酷酷的動畫的View-----FreshDownloadView

FreshDownloadView

簡介

一個Android平臺下的View,顯示下載進度,支持顯示下載進度,開始,結束,或者出現錯誤的時候都會帶有動畫(還是有點酷的動畫),部分靈感來自Dribbble

Demo展示

這裏寫圖片描述

Github地址

Github

使用方法

第1步:

Gradle:

 compile 'com.pitt.fresh.library:freshdownloadview:1.0'

Maven:

<dependency>
  <groupId>com.pitt.fresh.library</groupId>
  <artifactId>freshdownloadview</artifactId>
  <version>1.0</version>
  <type>pom</type>
</dependency>

第2步:

在代碼中添加View

<com.pitt.library.fresh.FreshDownloadView
        android:id="@+id/pitt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="#006cc7" />

XML attributes

Name Type Default Description
circular_radius dimension 80dp the circular’s radius
circular_color color 4c99d9 the base circular’s color
circular_progress_color color ffffff It’s the circular’s color when the circular show progress,and it is also text color when show progress,it’s the symbol’√’ and ‘×”s color
circular_width dimension 3.5dp the circular width(not means the circular’s radius)
progress_text_size dimension 50sp the text’s size when show progress

In java

freshDownloadView.upDateProgress(float progress);
freshDownloadView.upDateProgress(int progress);

以上方法用來更新Progress

freshDownloadView.reset();

以上方法重置View所有狀態

freshDownloadView.showDownloadError();

以上方法在下載失敗的情況下調用

關於我

微博

Gmail:[email protected]

簡書地址

知乎地址

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章