diff --git a/README.md b/README.md index eaedcb9060a02b1cf5b7d2b801ff36bee007720e..b16fa655d9b4e4bbc84e12e6299ac5f950a7c415 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代码测试无异常