注: 我们说明文档分为两部分,第一部分为中文文档,第二部分为英文文档。
Note: The document is divided into two parts, the first part of the Chinese document, the second part of the English document.
成功状态:
失败状态:
目前实现了原型中99%左右的内容,剩下的1%留给大家自行发挥,😄;
注:
1.整体实现均使用色值,未使用任何图片资源,核心色彩都已添加自定义属性;
2.整体宽高自行定义,内部元素均根据整体宽高自动缩放适应,但由于整体效果限制,建议宽度不要低于100dp,否则效果不佳;
获取项目资源的两种形式为:
1).直接使用JitPack上的库;
2).拷贝工程的的GADownloadingView及其他资源;
step 1 :在项目的build.gradle中加入如下代码:
allprojects {
repositories {
...
// add the follow code
maven { url 'https://jitpack.io' }
}
}
step 2 :在相应的模块的build.gradle中加入如下代码:
dependencies {
compile 'com.github.Ajian-studio:GADownloading:v1.0.2'
}
直接复制src/ui/GADownloadingView 及 res/values/attr.xml文件复制到相应的目录下
<xxx.xxx.xxxx.GADownloadingView
android:id="@+id/ga_downloading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/show_failed"
android:layout_centerHorizontal="true" />
mGADownloadingView = (GADownloadingView) findViewById(R.id.ga_downloading);
启动动画,包括背景和下载箭头抖动部分、背景镂空、圆变换为进度条、进度条抖动、下载箭头变换为承载文字的线框;
更新进度;
下载失败、调用则执行失败部分动效;
<declare-styleable name="GADownloadingView">
<attr name="arrow_color" format="color" />
<attr name="loading_circle_back_color" format="color" />
<attr name="loading_line_color" format="color" />
<attr name="progress_line_color" format="color" />
<attr name="progress_text_color" format="color" />
<attr name="done_text_color" format="color" />
</declare-styleable>
添加自定义属性命名空间:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gastudio="http://schemas.android.com/apk/res-auto"
... ...
/>
添加自定义属性
<com.gastudio.gadownloading.ui.GADownloadingView
android:id="@+id/ga_downloading"
android:layout_width="match_parent"
android:layout_height="match_parent"
gastudio:arrow_color="@android:color/white"
gastudio:done_text_color="@android:color/white"
gastudio:loading_circle_back_color="@android:color/white"
gastudio:loading_line_color="@android:color/white"
gastudio:progress_line_color="@android:color/white"
gastudio:progress_text_color="@android:color/white" />
最后,如果你觉得还不错,欢迎Star!
欢迎加入GAStudio交流qq群: 277582728 ;
State of success:
State of fail:
We have achieved most of the results, the rest to you, ha ha,😄;
Note:
1.The project does not use any image resources, most of the colors can be changed by custom attributes;
2.LoadingView will automatically adjust the width and height, the proposed width of not less than 100dp, otherwise ineffective;
The two forms of obtaining project resources are:
1).Use libraries directly on JitPack;
2).Copy the project's GADownloadingView and associated resources;
step 1. In the project build.gradle add the following code:
allprojects {
repositories {
...
// add the follow code
maven { url 'https://jitpack.io' }
}
}
step 2. In the module's build.gradle add the following code:
dependencies {
compile 'com.github.Ajian-studio:GADownloading:v1.0.2'
}
Copy the src/ui/GADownloadingView and res/values/attr.xml files directly into the appropriate directory
<xxx.xxx.xxxx.GADownloadingView
android:id="@+id/ga_downloading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/show_failed"
android:layout_centerHorizontal="true" />
mGADownloadingView = (GADownloadingView) findViewById(R.id.ga_downloading);
Start the animation;
Update progress;
The download fails, and the execution fails with some animation;
<declare-styleable name="GADownloadingView">
<attr name="arrow_color" format="color" />
<attr name="loading_circle_back_color" format="color" />
<attr name="loading_line_color" format="color" />
<attr name="progress_line_color" format="color" />
<attr name="progress_text_color" format="color" />
<attr name="done_text_color" format="color" />
</declare-styleable>
Add a custom property namespace:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gastudio="http://schemas.android.com/apk/res-auto"
... ...
/>
Add some custom properties
<com.gastudio.gadownloading.ui.GADownloadingView
android:id="@+id/ga_downloading"
android:layout_width="match_parent"
android:layout_height="match_parent"
gastudio:arrow_color="@android:color/white"
gastudio:done_text_color="@android:color/white"
gastudio:loading_circle_back_color="@android:color/white"
gastudio:loading_line_color="@android:color/white"
gastudio:progress_line_color="@android:color/white"
gastudio:progress_text_color="@android:color/white" />
Finally, if you feel pretty good, please click the Star!
Welcome to join the GAStudio exchang
4CAC
e qq group: 277582728;