From 12e28513905fca2e2d040eef23fdd43862f0f347 Mon Sep 17 00:00:00 2001 From: fjh Date: Tue, 25 May 2021 17:09:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=20?= =?UTF-8?q?=E5=92=8C=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + CHANGELOG.md | 3 +++ README.OPENSOURCE | 2 +- README.md | 2 +- build.gradle | 12 ++++++------ changeLog.md | 11 ----------- entry/build.gradle | 18 ++++++++++++++++-- entry/src/main/config.json | 7 +++---- .../main/resources/base/element/string.json | 2 +- .../base/graphic/background_ability_main.xml | 4 ++-- .../resources/base/layout/ability_main.xml | 10 +++++----- library/build.gradle | 12 ++++++++++-- library/src/main/config.json | 5 +++-- .../com/tuyenmonkey/mkloader/MKLoader.java | 2 -- .../com/tuyenmonkey/mkloader/type/Balloon.java | 2 -- .../tuyenmonkey/mkloader/type/FishSpinner.java | 3 --- .../tuyenmonkey/mkloader/type/LoaderView.java | 1 - .../tuyenmonkey/mkloader/type/PhoneWave.java | 2 -- .../com/tuyenmonkey/mkloader/type/Pulse.java | 2 -- .../com/tuyenmonkey/mkloader/type/Radar.java | 2 -- .../tuyenmonkey/mkloader/type/Sharingan.java | 5 ----- .../tuyenmonkey/mkloader/type/Whirlpool.java | 1 - .../com/tuyenmonkey/mkloader/type/Worm.java | 2 -- .../mkloader/util/LoaderGenerator.java | 12 +----------- .../main/resources/base/element/string.json | 2 +- 25 files changed, 54 insertions(+), 71 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 changeLog.md diff --git a/.gitignore b/.gitignore index 603b140..37a4eb8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ /build /captures .externalNativeBuild +/entry/.preview .cxx diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f34df31 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1-SNAPSHOT + +ohos 第一个版本,完整实现了原库的全部 api \ No newline at end of file diff --git a/README.OPENSOURCE b/README.OPENSOURCE index c499778..f326594 100644 --- a/README.OPENSOURCE +++ b/README.OPENSOURCE @@ -6,7 +6,7 @@ "License": "Apache License", - "License File": "https://github.com/nntuyen/mkloader/blob/master/LICENSE", + "License File": "LICENSE", "Version Number": "1.4.0", diff --git a/README.md b/README.md index 804a9fb..a13fd13 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ - 项目名称:加载动画 - 所属系列:openharmony的第三方组件适配移植 - 功能:一个自定义加载的动画组件。 -- 基线版本: mkloader Tags 1.4.0 +- 基线版本: Release v1.4.0 - 项目移植状态:主功能完成 - 调用差异:无 - 开发版本:sdk5,DevEco Studio2.1.0.301 beta3 diff --git a/build.gradle b/build.gradle index ff7362f..6e73c6e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,19 +4,19 @@ apply plugin: 'com.huawei.ohos.app' ohos { compileSdkVersion 5 defaultConfig { - compatibleSdkVersion 5 + compatibleSdkVersion 4 } } - + buildscript { repositories { maven { - url 'https://mirrors.huaweicloud.com/repository/maven/' + url 'https://repo.huaweicloud.com/repository/maven/' } maven { url 'https://developer.huawei.com/repo/' } - jcenter() + jcenter() } dependencies { classpath 'com.huawei.ohos:hap:2.4.2.5' @@ -27,7 +27,7 @@ buildscript { allprojects { repositories { maven { - url 'https://mirrors.huaweicloud.com/repository/maven/' + url 'https://repo.huaweicloud.com/repository/maven/' } maven { url 'https://developer.huawei.com/repo/' @@ -35,6 +35,6 @@ allprojects { maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' } - jcenter() + jcenter() } } diff --git a/changeLog.md b/changeLog.md deleted file mode 100644 index 1d82c30..0000000 --- a/changeLog.md +++ /dev/null @@ -1,11 +0,0 @@ -# 基本功能: -* 自定义绘制的加载动画库。 - - - -# 修改点: -1. 无 - - -# 遗留问题(暂不支持的功能): -1. 无 \ No newline at end of file diff --git a/entry/build.gradle b/entry/build.gradle index 42ea041..8994faf 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,13 +1,27 @@ apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' ohos { compileSdkVersion 5 defaultConfig { - compatibleSdkVersion 5 + compatibleSdkVersion 4 } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testCompile 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' implementation('com.gitee.chinasoft_ohos:mkloader:0.0.1-SNAPSHOT') } +decc { + supportType = ['html','xml'] +} diff --git a/entry/src/main/config.json b/entry/src/main/config.json index be464d1..217c4cf 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -7,7 +7,7 @@ "name": "1.0" }, "apiVersion": { - "compatible": 5, + "compatible": 4, "target": 5 } }, @@ -16,8 +16,7 @@ "package": "com.tuyenmonkey.sample", "name": ".MyApplication", "deviceType": [ - "phone", - "tablet" + "phone" ], "distro": { "deliveryWithInstall": true, @@ -40,7 +39,7 @@ "name": "com.tuyenmonkey.sample.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", - "label": "HM_mkloader", + "label": "$string:app_name", "type": "page", "launchType": "standard" } diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 5ce91a5..031de03 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -2,7 +2,7 @@ "string": [ { "name": "app_name", - "value": "HM_mkloader" + "value": "mkloader" }, { "name": "mainability_description", diff --git a/entry/src/main/resources/base/graphic/background_ability_main.xml b/entry/src/main/resources/base/graphic/background_ability_main.xml index 47a2d3e..c0c0a3d 100644 --- a/entry/src/main/resources/base/graphic/background_ability_main.xml +++ b/entry/src/main/resources/base/graphic/background_ability_main.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/entry/src/main/resources/base/layout/ability_main.xml b/entry/src/main/resources/base/layout/ability_main.xml index b979e96..e3d488b 100644 --- a/entry/src/main/resources/base/layout/ability_main.xml +++ b/entry/src/main/resources/base/layout/ability_main.xml @@ -1,10 +1,10 @@ Date: Tue, 25 May 2021 17:12:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=20?= =?UTF-8?q?=E5=92=8C=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/proguard-rules.pro | 1 + entry/src/ohosTest/config.json | 40 +++++++++++ .../tuyenmonkey/sample/ExampleOhosTest.java | 68 +++++++++++++++++++ .../com/tuyenmonkey/mkloader/ExampleTest.java | 9 +++ 4 files changed, 118 insertions(+) create mode 100644 entry/proguard-rules.pro create mode 100644 entry/src/ohosTest/config.json create mode 100644 entry/src/ohosTest/java/com/tuyenmonkey/sample/ExampleOhosTest.java create mode 100644 library/src/test/java/com/tuyenmonkey/mkloader/ExampleTest.java diff --git a/entry/proguard-rules.pro b/entry/proguard-rules.pro new file mode 100644 index 0000000..f7666e4 --- /dev/null +++ b/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json new file mode 100644 index 0000000..6f5d06f --- /dev/null +++ b/entry/src/ohosTest/config.json @@ -0,0 +1,40 @@ +{ + "app": { + "bundleName": "com.tuyenmonkey.sample", + "vendor": "tuyenmonkey", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.tuyenmonkey.sample", + "name": "testModule", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry_test", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "name": "decc.testkit.runner.EntryAbility", + "description": "Test Entry Ability", + "icon": "$media:icon", + "label": "$string:app_name", + "launchType": "standard", + "orientation": "landscape", + "visible": true, + "type": "page" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/java/com/tuyenmonkey/sample/ExampleOhosTest.java b/entry/src/ohosTest/java/com/tuyenmonkey/sample/ExampleOhosTest.java new file mode 100644 index 0000000..af69a07 --- /dev/null +++ b/entry/src/ohosTest/java/com/tuyenmonkey/sample/ExampleOhosTest.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain an copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.tuyenmonkey.sample; + +import com.tuyenmonkey.mkloader.util.LoaderGenerator; +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import ohos.app.Context; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + + +import static org.junit.Assert.assertEquals; + +/** + * 单元测试 + * + * @author fjh + * @since 2021-05-24 + */ +public class ExampleOhosTest { + private Context context; + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.tuyenmonkey.sample", actualBundleName); + } + + /** + * 开始 + * + */ + @Before + public void setUp() { + context = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility().getContext(); + } + + /** + * 结束 + * + */ + @After + public void tearDown() { + context = null; + } + + /** + * 传不同type,实现不同效果的动画 + * + */ + @Test + public void FishSpinner() { + LoaderGenerator.generateLoaderView(context, 2); + } +} \ No newline at end of file diff --git a/library/src/test/java/com/tuyenmonkey/mkloader/ExampleTest.java b/library/src/test/java/com/tuyenmonkey/mkloader/ExampleTest.java new file mode 100644 index 0000000..24130ae --- /dev/null +++ b/library/src/test/java/com/tuyenmonkey/mkloader/ExampleTest.java @@ -0,0 +1,9 @@ +package com.tuyenmonkey.mkloader; + +import org.junit.Test; + +public class ExampleTest { + @Test + public void onStart() { + } +} -- Gitee From ac45aa3182a5a1846ff8920705c5a78f2be78788 Mon Sep 17 00:00:00 2001 From: fjh Date: Tue, 25 May 2021 17:24:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=20?= =?UTF-8?q?=E5=92=8C=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= 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 a13fd13..71ac588 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ - 项目名称:加载动画 - 所属系列:openharmony的第三方组件适配移植 - 功能:一个自定义加载的动画组件。 -- 基线版本: Release v1.4.0 +- 基线版本: Release 1.4.0 - 项目移植状态:主功能完成 - 调用差异:无 - 开发版本:sdk5,DevEco Studio2.1.0.301 beta3 -- Gitee