介绍
本示例通过模拟下载场景介绍如何将Native的进度信息实时同步到ArkTS侧。
效果图预览
使用说明
- 点击“Start Download“按钮后,Native侧启动子线程模拟下载任务
- Native侧启动子线程模拟下载,并通过Arkts的回调函数将进度信息实时传递到Arkts侧
实现思路
- 前端进度条使用Progress绘制
Progress({ value: this.progress, total: 100, type: ProgressType.Ring }) .width($r("app.integer.progress_size")) .height($r("app.integer.progress_size")) .animation({ duration: NativeProgressNotifyConstants.PROGRESS_ANIMATION_DURATION, curve: Curve.Ease }) .style(