Android开发程序猿学习Android工程师

一个显示下载进度的View,带有酷酷的动画--------Fre

2016-10-06  本文已影响474人  PittFS

FreshDownloadView

简介

一个Android平台下的View,显示下载进度,支持显示下载进度,开始,结束,或者出现错误的时候都会带有动画(还是有点酷的动画),部分灵感来自Dribbble

Demo展示

screen.gif

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:fengshengq@gmail.com

简书地址

知乎地址

上一篇 下一篇

猜你喜欢

热点阅读