成功状态:
失败状态:
目前实现了原型中99%左右的内容,剩下的1%留给大家自行发挥,😄;
注:
1.整体实现均使用色值,未使用任何图片资源,核心色彩都已添加自定义属性;
2.整体宽高自行定义,内部元素均根据整体宽高自动缩放适应,但由于整体效果限制,建议宽度不要低于100dp,否则效果不佳;
<com.gastudio.gadownloading.ui.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);
1.performAnimation():
启动动画,包括背景和下载箭头抖动部分、背景镂空、圆变换为进度条、进度条抖动、下载箭头变换为承载文字的线框;
2.updateProgress(int progress):
更新进度;
3.onFail():
下载失败、调用则执行失败部分动效;
4.自定义属性:
<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>
5.自定义属性使用方式:
添加自定义属性命名空间:
<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 ;
$ claude mcp add GADownloading \
-- python -m otcore.mcp_server <graph>