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

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

简书地址

知乎地址

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容