diff --git a/README.md b/README.md index 838d9177eb320699bf9d4c594ddb90c31c9fd45d..231bddfe41e1750d07ba8123e9b598f6b8c6ada4 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ - 功能:一个拥有与Twitter心跳动画类似效果的按钮 - 项目移植状态:主功能完成 - 调用差异:无 -- 基线版本:Release 1.0.6 -- 开发版本:sdk5,DevEco Studio 2.1 Release +- 基线版本:1.0.6 +- 开发版本:sdk6,DevEco Studio 2.2 Beta1 #### 效果演示 @@ -31,7 +31,7 @@ allprojects { ...... } ``` -在sdk5,DevEco Studio 2.1 Release下项目可直接运行,如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件,并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 +在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行,如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件,并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 #### 使用说明 diff --git a/app/build.gradle b/app/build.gradle index ef7b82d7631a712142c2ffec184d2d2fba621e07..1bd45053252cc1039f4b645ca5ba1b3eb6e2989e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { - compatibleSdkVersion 5 + compatibleSdkVersion 6 } buildTypes { release { diff --git a/build.gradle b/build.gradle index d3c9f1fef7ce4e18162867c20c11bfc65e1a8d28..bf090bb230d99f8ad4f721c56d1c8040ae52c45d 100644 --- a/build.gradle +++ b/build.gradle @@ -2,9 +2,9 @@ apply plugin: 'com.huawei.ohos.app' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { - compatibleSdkVersion 5 + compatibleSdkVersion 6 } } diff --git a/sparkbutton/build.gradle b/sparkbutton/build.gradle index 29231934ac368ab9c0731b0dca261212f7e289d4..6fd3a7828fe2a76b2898e86de8908132fc650e7d 100644 --- a/sparkbutton/build.gradle +++ b/sparkbutton/build.gradle @@ -1,9 +1,9 @@ apply plugin: 'com.huawei.ohos.library' //For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#ZH-CN_TOPIC_0000001154985555__section1112183053510 ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { - compatibleSdkVersion 5 + compatibleSdkVersion 6 } buildTypes { release { diff --git a/sparkbutton/src/main/config.json b/sparkbutton/src/main/config.json index 9e9ab383d1989793db5ace0b61654c651ef3053b..f2f8d632e11ad31f480dc74e52de7f6b9763a802 100644 --- a/sparkbutton/src/main/config.json +++ b/sparkbutton/src/main/config.json @@ -7,8 +7,8 @@ "name": "1.0.0" }, "apiVersion": { - "compatible": 5, - "target": 5, + "compatible": 6, + "target": 6, "releaseType": "Release" } }, diff --git a/sparkbutton/src/main/java/com/varunest/sparkbutton/helper/DotsComponent.java b/sparkbutton/src/main/java/com/varunest/sparkbutton/helper/DotsComponent.java index e905314ceda6b62d42883e734aad5fcf819251a6..1a56b6dcc3f9627d2ddd9a34076689c94375ba4f 100644 --- a/sparkbutton/src/main/java/com/varunest/sparkbutton/helper/DotsComponent.java +++ b/sparkbutton/src/main/java/com/varunest/sparkbutton/helper/DotsComponent.java @@ -9,6 +9,8 @@ import ohos.agp.render.Paint; import ohos.agp.utils.Color; import ohos.app.Context; +import java.math.BigDecimal; + /** * DotsComponent * @@ -153,10 +155,10 @@ public class DotsComponent extends Component implements Component.DrawTask, Comp private void updateOuterDotsPosition() { if (currentProgress < 0.3f) { this.currentRadius1 = (float) Utils.mapValueFromRangeToRange( - currentProgress, 0.0f, 0.3f, 0, maxOuterDotsRadius * 0.8f); + currentProgress, 0.0f, 0.3f, 0, maxOuterDotsRadius * BigDecimal.valueOf(0.8).floatValue()); } else { this.currentRadius1 = (float) Utils.mapValueFromRangeToRange( - currentProgress, 0.3f, 1f, 1f * maxOuterDotsRadius, maxOuterDotsRadius); + currentProgress, 0.3f, 1f, BigDecimal.valueOf(1).floatValue() * maxOuterDotsRadius, maxOuterDotsRadius); } if (currentProgress < 0.7) {