From 9e3eca72f8a5b61242c6909235691232e92af8f8 Mon Sep 17 00:00:00 2001 From: JiangJun <2680104782@qq.com> Date: Wed, 22 Sep 2021 11:33:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=80=91=EF=BC=9Amd=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index eaedcb9..b16fa65 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,60 @@ dependencies { ohos:top_margin="60vp"/> ``` +2.调用lib包MagicProgressCircle公共方法setpercent,setSmoothPercent,分别设定和传入随机进度和时间,可以根据自身需要来 + +```java +MagicProgressCircle mc = (MagicProgressCircle) findComponentById(ResourceTable.Id_mpb_mpc); +MagicProgressBar mb = (MagicProgressBar) findComponentById(ResourceTable.Id_mpb_one); +mc.setPercent(xxx); +mc.setSmoothPercent(xxx); +mb.setPercent(xxx); +mb.setSmoothPercent(xxx); +``` + +3.根据lib包提供的接口,获取进度和动画执行时间 + +```java +public interface Imag { + /** + * 获取当前进度 + * + * @return 当前进度 + */ + float getPercent(); + + /** + * 设置第一次的进度 + * + * @param percent 第一次的进度(from = 0.0, to = 1.0) + */ + void setPercent(float percent); + + /** + * 设置第一次的进度 + * + * @param percent 第一次的进度(from = 0.0, to = 1.0) + * @param durationMillis 动画执行时间 + */ + void setPercent(float percent, long durationMillis); + + /** + * 设置当前进度 + * + * @param percent 当前进度 + */ + void setSmoothPercent(float percent); + + /** + * 设置当前进度 + * + * @param percent 当前进度 + * @param durationMillis 动画执行时间 + */ + void setSmoothPercent(float percent, long durationMillis); +} +``` + ## 测试信息 CodeCheck代码测试无异常 -- Gitee