From abe29692a3561ee3226e4149b6355547927df5b2 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Fri, 2 Jul 2021 17:53:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/alterac/blurkit/ExampleOhosTest.java | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java b/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java index ecea4c9..d1f6b90 100644 --- a/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java @@ -1,6 +1,14 @@ package io.alterac.blurkit; +import ohos.aafwk.ability.Ability; import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import ohos.agp.window.service.Display; +import ohos.agp.window.service.DisplayManager; +import ohos.media.image.Image; +import ohos.media.image.PixelMap; +import ohos.media.image.common.PixelFormat; +import ohos.media.image.common.ScaleMode; +import ohos.media.image.common.Size; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -8,7 +16,20 @@ import static org.junit.Assert.assertEquals; public class ExampleOhosTest { @Test public void testBundleName() { - final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); - assertEquals("io.alterac.blurkit", actualBundleName); + Ability ability = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility(); + PixelMap.InitializationOptions initializationOptions = new PixelMap.InitializationOptions(); + initializationOptions.editable = true; + initializationOptions.scaleMode = ScaleMode.CENTER_CROP; + initializationOptions.pixelFormat = PixelFormat.ARGB_8888; + + Display display = DisplayManager.getInstance().getDefaultDisplay(ability).get(); + int width = display.getAttributes().width; + int height = display.getAttributes().height; + Size size = new Size(width, height); + initializationOptions.size = size; + PixelMap pixelMap2 = PixelMap.create(initializationOptions); + PixelMap pixelMap = BlurKit.getInstance().blur(pixelMap2); + Boolean flag = pixelMap!=null; + assertEquals(true,flag); } } \ No newline at end of file -- Gitee From 0429b01e2773f9ae42d9dce659d1f22add3f4d09 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Fri, 2 Jul 2021 18:00:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/alterac/blurkit/ExampleOhosTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java b/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java index d1f6b90..af0cfa0 100644 --- a/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java +++ b/entry/src/ohosTest/java/io/alterac/blurkit/ExampleOhosTest.java @@ -21,15 +21,14 @@ public class ExampleOhosTest { initializationOptions.editable = true; initializationOptions.scaleMode = ScaleMode.CENTER_CROP; initializationOptions.pixelFormat = PixelFormat.ARGB_8888; - Display display = DisplayManager.getInstance().getDefaultDisplay(ability).get(); int width = display.getAttributes().width; int height = display.getAttributes().height; Size size = new Size(width, height); initializationOptions.size = size; - PixelMap pixelMap2 = PixelMap.create(initializationOptions); - PixelMap pixelMap = BlurKit.getInstance().blur(pixelMap2); - Boolean flag = pixelMap!=null; - assertEquals(true,flag); + PixelMap pixelMap2 = PixelMap.create(initializationOptions); + PixelMap pixelMap = BlurKit.getInstance().blur(pixelMap2); + Boolean flag = pixelMap != null; + assertEquals(true, flag); } } \ No newline at end of file -- Gitee From 017107214c591371d6257b69e56c6192ba4ab8e5 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Mon, 5 Jul 2021 16:25:41 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blurkit/src/main/java/io/alterac/blurkit/BlurKit.java | 2 +- entry/build.gradle | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blurkit/src/main/java/io/alterac/blurkit/BlurKit.java b/blurkit/src/main/java/io/alterac/blurkit/BlurKit.java index eab86d2..c5c3e10 100644 --- a/blurkit/src/main/java/io/alterac/blurkit/BlurKit.java +++ b/blurkit/src/main/java/io/alterac/blurkit/BlurKit.java @@ -74,7 +74,7 @@ public class BlurKit { public static BlurKit getInstance() { if (instance == null) { - HiLog.warn(LABEL, "reason:%{public}d.","没有实例化Blurk对象"); + instance = new BlurKit(); } return instance; } diff --git a/entry/build.gradle b/entry/build.gradle index 2bcd547..06b9c03 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -21,7 +21,8 @@ dependencies { testImplementation 'junit:junit:4.13' ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' implementation 'com.enrique.stackblur.ohos:library:1.0.0' - implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT') +// implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT') + implementation project(path:':blurkit') } decc { supportType = ['html','xml'] -- Gitee From caaf26d1183df02814da1fe817a75b287cc232a8 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Mon, 5 Jul 2021 18:30:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=80=82=E9=85=8Dsdk6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ README.md | 6 +++--- blurkit/build.gradle | 3 ++- blurkit/src/main/config.json | 5 ----- build.gradle | 6 +++--- entry/build.gradle | 5 ++--- entry/src/main/config.json | 5 ----- .../java/io/alterac/blurkit/slice/MainAbilitySlice.java | 8 ++++---- 8 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd3ec4..d5c2aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ +## 0.0.2-SNAPSHOT +ohos 第二个版本 +* 更新sdk6 ## 0.0.1-SNAPSHOT ohos 第一个版本 * 实现了原库的大部分 api * 因为鸿蒙暂不支持view截图图片获取,导致无法模糊整体图片,暂时只支持image和pixmap模糊 * 安卓帧数是用 Choreographer 协调动画,输入和绘制的时间 安排渲染下一个frame的一部分工作 而鸿蒙是没有此功能的所有并未实现所以未实现帧数设置 + + + \ No newline at end of file diff --git a/README.md b/README.md index 705f8c2..3268a43 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ - 项目移植状态:已完成主功能 - 调用差异:无 - 基线版本:Release v1.1.1 -- 开发版本:sdk5,DevEco Studio2.1 Release +- 开发版本:sdk6,DevEco Studio2.2 Beta1 ## 演示效果 @@ -105,10 +105,10 @@ CodeCheck代码测试无异常 CloudTest代码测试无异常 -火绒安全病毒安全检测通过 +病毒安全检测通过 ## 版本迭代 -- 0.0.1-SNAPSHOT +- 0.0.2-SNAPSHOT ## 版权和许可信息 diff --git a/blurkit/build.gradle b/blurkit/build.gradle index 22eb435..1b0f0b6 100644 --- a/blurkit/build.gradle +++ b/blurkit/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.huawei.ohos.library' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -18,4 +18,5 @@ ohos { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) testImplementation 'junit:junit:4.13' + api 'com.enrique.stackblur.ohos:library:1.0.0' } diff --git a/blurkit/src/main/config.json b/blurkit/src/main/config.json index 658a8e3..6d1f385 100644 --- a/blurkit/src/main/config.json +++ b/blurkit/src/main/config.json @@ -5,11 +5,6 @@ "version": { "code": 1000000, "name": "1.0.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Release" } }, "deviceConfig": { diff --git a/build.gradle b/build.gradle index f118d6d..8c7f594 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.7' + 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 06b9c03..1249b72 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.huawei.ohos.hap' apply plugin: 'com.huawei.ohos.decctest' ohos { - compileSdkVersion 5 + compileSdkVersion 6 defaultConfig { compatibleSdkVersion 5 } @@ -21,8 +21,7 @@ dependencies { testImplementation 'junit:junit:4.13' ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' implementation 'com.enrique.stackblur.ohos:library:1.0.0' -// implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT') - implementation project(path:':blurkit') + implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT') } decc { supportType = ['html','xml'] diff --git a/entry/src/main/config.json b/entry/src/main/config.json index 2235767..d6cbd51 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -5,11 +5,6 @@ "version": { "code": 1000000, "name": "1.0.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Release" } }, "deviceConfig": {}, diff --git a/entry/src/main/java/io/alterac/blurkit/slice/MainAbilitySlice.java b/entry/src/main/java/io/alterac/blurkit/slice/MainAbilitySlice.java index 2e6d93d..06e857c 100644 --- a/entry/src/main/java/io/alterac/blurkit/slice/MainAbilitySlice.java +++ b/entry/src/main/java/io/alterac/blurkit/slice/MainAbilitySlice.java @@ -65,9 +65,9 @@ public class MainAbilitySlice extends AbilitySlice { @Override public void onUpdate(AnimatorValue animatorValue2, float v) { if (!isShangAndXia) { - goBackwards(v, blurlayout); + goBackwards((int)v, blurlayout); } else { - positive(v, blurlayout); + positive((int)v, blurlayout); } } }); @@ -107,14 +107,14 @@ public class MainAbilitySlice extends AbilitySlice { animatorValue.start(); } - private void positive(float v, BlurLayout blurlayout) { + private void positive(int v, BlurLayout blurlayout) { potiveY = (v * num500) + num500; blurlayout.setY(potiveY); // 更改组r件在父布局中的位置 blurlayout.setContentPositionY(potiveY); blurlayout.invalidate(); } - private void goBackwards(float v, BlurLayout blurlayout) { + private void goBackwards(int v, BlurLayout blurlayout) { potiveY = 0; potiveY = num1000 - (v * num500); blurlayout.setY(potiveY); -- Gitee From ec7396008af71ccc9bf4436a7c7465f60e1bc36d Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Mon, 5 Jul 2021 18:32:24 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=80=82=E9=85=8Dsdk6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entry/build.gradle b/entry/build.gradle index 1249b72..fb00ede 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation 'junit:junit:4.13' ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' implementation 'com.enrique.stackblur.ohos:library:1.0.0' - implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT') + implementation('com.gitee.chinasoft_ohos:blurkit-ohos:0.0.2-SNAPSHOT') } decc { supportType = ['html','xml'] -- Gitee From b0b72993928c605e2ec8da7b4777433449265f88 Mon Sep 17 00:00:00 2001 From: wjt983049539 Date: Mon, 5 Jul 2021 18:56:09 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3268a43..b8928bc 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ allprojects { dependencies { implementation 'com.enrique.stackblur.ohos:library:1.0.0' - implementation 'com.gitee.chinasoft_ohos:blurkit-ohos:0.0.1-SNAPSHOT' + implementation 'com.gitee.chinasoft_ohos:blurkit-ohos:0.0.2-SNAPSHOT' } ``` -- Gitee