diff --git a/CHANGLOG.md b/CHANGLOG.md index cd6e23e18ac2776a272dbe7650675d1a82488651..10020de2ba014c9d4b20f82b37b576661421374d 100644 --- a/CHANGLOG.md +++ b/CHANGLOG.md @@ -1,3 +1,5 @@ +## 0.0.2-SNAPSHOT +ohos 第二个版本 +* 更新sdk6 ## 0.0.1-SNAPSHOT - -ohos 第一个版本,使用 ohos 实现原库的所有api \ No newline at end of file +* ohos 第一个版本,完整实现了原库的全部 api \ No newline at end of file diff --git a/README.md b/README.md index ac620178c37775d0f37c2313ffe23c8462e342d9..633ecd26dce416f8301f0c55e8e97695f3b9e59d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ 方便:只需继承BaseAbilitySlice便可拥有转换功能 灵活: 封装了多个控制方法直接使用即可 - 项目移植状态:主功能完成 -- 调用差异:无 -- 开发版本:sdk5,DevEco Studio 2.1 Release +- 调用差异:使用openharmony api 与源项目调用方式不一样 +- 开发版本:sdk6,DevEco Studio2.2 Beta1 - 基线版本:Release v2.0.4 ## 演示效果 @@ -31,7 +31,7 @@ 2.在entry模块的build.gradle文件中, ``` dependencies { - implementation('com.gitee.chinasoft_ohos:speechutils:0.0.1-SNAPSHOT') + implementation('com.gitee.chinasoft_ohos:speechutils:0.0.2-SNAPSHOT') ...... } ``` @@ -88,12 +88,9 @@ CodeCheck代码测试无异常 CloudTest代码测试无异常 -火绒安全病毒安全检测通过 +病毒安全检测通过 -当前版本demo功能与原组件基本无差异 - -## 版本迭代 -0.0.1-SNAPSHOT +## 版本迭代- 0.0.2-SNAPSHOT ## 版本和许可信息 ``` diff --git a/build.gradle b/build.gradle index ab2e0e92d039e2d27bdfdf97cab4bc5d05dd98d5..a4bbee50c84428507c792bf978676f0ff6fe17a8 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.huawei.ohos.app' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -19,8 +19,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.4.2' - classpath 'com.huawei.ohos:decctest:1.0.0.6' + classpath 'com.huawei.ohos:hap:2.4.5.0' + classpath 'com.huawei.ohos:decctest:1.2.4.1' } } diff --git a/entry/build.gradle b/entry/build.gradle index 112b6fcc297b664b8a1a4bf6543b2f24c37b64e1..28f0e5d25bde93c1db37bbd2157fb83d8a00ea9b 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -19,7 +19,7 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - implementation('com.gitee.chinasoft_ohos:speechutils:0.0.1-SNAPSHOT') + implementation('com.gitee.chinasoft_ohos:speechutils:0.0.2-SNAPSHOT') testImplementation 'junit:junit:4.13' ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' } diff --git a/entry/src/main/config.json b/entry/src/main/config.json index fac804f89197de6c5af663ffce36e2c1884600d4..4f9d3cdf02c207b204ab538fea5e97bfc9bfa038 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -5,11 +5,6 @@ "version": { "code": 1000000, "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Release" } }, "deviceConfig": {}, diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/SuperButton.java b/entry/src/main/java/com/ohos/speechutilsdemo/SuperButton.java index 56a357d219d3d2c6379e8c75b5df7ea50ecfdc73..f31310e2e59b3a280dfada682345e8c4d74fc62e 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/SuperButton.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/SuperButton.java @@ -26,8 +26,6 @@ import ohos.agp.components.element.StateElement; import ohos.agp.render.Canvas; import ohos.agp.utils.Color; import ohos.app.Context; -import ohos.eventhandler.EventHandler; -import ohos.eventhandler.EventRunner; import ohos.multimodalinput.event.TouchEvent; /** @@ -38,10 +36,10 @@ import ohos.multimodalinput.event.TouchEvent; */ public class SuperButton extends Button implements Component.DrawTask, Component.TouchEventListener, Component.ComponentStateChangedListener { - private final int num255 = 255; - private final int down = 18432; - private final int up = 2048; - private final float numldq = 0.7F; + private static final int NUM_255 = 255; + private static final int DOWN = 18432; + private static final int UP = 2048; + private static final float NUMLDQ = 0.7F; private float mPhase; private float[] mDashPath; @@ -57,8 +55,6 @@ public class SuperButton extends Button implements Component.DrawTask, private StateElement mBackground; - private EventHandler mHandle = new EventHandler(EventRunner.getMainEventRunner()); - private int shape = ShapeElement.RECTANGLE; private ShapeElement.Orientation gorientation5; @@ -167,7 +163,7 @@ public class SuperButton extends Button implements Component.DrawTask, if (normalColor != null) { mStateEmptyElement.setRgbColor(normalColor); } else { - normalColor = new RgbColor(num255, num255, num255, num255); + normalColor = new RgbColor(NUM_255, NUM_255, NUM_255, NUM_255); mStateEmptyElement.setRgbColor(normalColor); } if (strokeWidth != 0 && strokeColor != null) { @@ -279,18 +275,6 @@ public class SuperButton extends Button implements Component.DrawTask, return this; } - /** - * 分别设置四个角半径 - * - * @param radius - * @return button - */ - public SuperButton setShapeCornersRadius(float[] radius) { - this.cornersRadius2 = radius; - invalidate(); - return this; - } - /** * 设置背景渐变方向 * @@ -303,18 +287,6 @@ public class SuperButton extends Button implements Component.DrawTask, return this; } - /** - * 设置渐变颜色 - * - * @param gradientColors2 - * @return button - */ - public SuperButton setShapeGradientColor(RgbColor[] gradientColors2) { - this.gradientColors = gradientColors2; - invalidate(); - return this; - } - /** * 设置不能点击状态的颜色 * @@ -327,20 +299,6 @@ public class SuperButton extends Button implements Component.DrawTask, return this; } - /** - * new float[]{10, 21, 32, 43, 54, 65}, 1 - * - * @param dashPath dashPath - * @param phase phase - * @return button - */ - public SuperButton setShapeDashPathEffectValues(float[] dashPath, float phase) { - this.mDashPath = dashPath; - this.mPhase = phase; - invalidate(); - return this; - } - @Override public boolean onTouchEvent(Component component, TouchEvent touchEvent) { if (!isClickable() || !isEnabled()) { @@ -371,12 +329,12 @@ public class SuperButton extends Button implements Component.DrawTask, @Override public void onComponentStateChanged(Component component, int state) { switch (state) { - case down: + case DOWN: if (selectColor == null) { - this.setAlpha(numldq); + this.setAlpha(NUMLDQ); } break; - case up: + case UP: default: setAlpha(1); } diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json index 8b3ef106cd53ec2074f438a363463a5c66538923..88ec2859fe3db10a265c3bd5fd924807cf199daa 100644 --- a/entry/src/ohosTest/config.json +++ b/entry/src/ohosTest/config.json @@ -5,11 +5,6 @@ "version": { "code": 1, "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Release" } }, "deviceConfig": {}, diff --git a/speechutils/build.gradle b/speechutils/build.gradle index 4d1bb44a871f857372e9c4c5a6669a5377346ccc..831442899825792b69dba253d3682bbc9919b58c 100644 --- a/speechutils/build.gradle +++ b/speechutils/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.huawei.ohos.library' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } diff --git a/speechutils/src/main/config.json b/speechutils/src/main/config.json index f6a6263c6c4b18ea84f2548285842eb886de04d9..c421888cb1664f706fc0b6fe6db43b846b8e952b 100644 --- a/speechutils/src/main/config.json +++ b/speechutils/src/main/config.json @@ -5,11 +5,6 @@ "version": { "code": 1, "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Release" } }, "deviceConfig": { @@ -21,7 +16,7 @@ ], "distro": { "deliveryWithInstall": true, - "moduleName": "speechutils", + "moduleName": "$string:app_name", "moduleType": "har" } } diff --git a/speechutils/src/main/resources/base/element/string.json b/speechutils/src/main/resources/base/element/string.json index b1712549d330191fd3b43d4eafbd65e901c4cb4a..040e54d321e20e12a4711a1cf1bec55f8c45d5f8 100644 --- a/speechutils/src/main/resources/base/element/string.json +++ b/speechutils/src/main/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "speechutils" + "value": "speechutils-speechutils" } ] }