diff --git a/AnimationDemo/LICENSE b/AnimationDemo/LICENSE
deleted file mode 100644
index 7c357dc828cf7d8c783f10ed6bb1bac8a1e903c1..0000000000000000000000000000000000000000
--- a/AnimationDemo/LICENSE
+++ /dev/null
@@ -1,78 +0,0 @@
- 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 a 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.
-
-Apache License, Version 2.0
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-1.You must give any other recipients of the Work or Derivative Works a copy of this License; and
-2.You must cause any modified files to carry prominent notices stating that You changed the files; and
-3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/AnimationDemo/README.md b/AnimationDemo/README.md
deleted file mode 100644
index dca5d5e4acedf88f26ea2adf6c485a87b6be6258..0000000000000000000000000000000000000000
--- a/AnimationDemo/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# AnimationDemo
-简介
-• 此demo使用的是通用动画样式,我们通过一个简单的样例,实现了平移、旋转、缩放以及透明度变化的效果。
-
-安装要求
-• 安装DevEco Studio
-• 设置DevEco Studio开发环境。DevEco Studio开发环境需要连接到网络,以确保该正常使用。可以根据以下两种情况配置开发环境:
- 1.如果您可以直接访问Internet,则只需下载HarmonyOS SDK
- 2.如果网络无法直接访问Internet,则可以通过代理服务器进行访问
-• 生成密钥并申请证书
-
-用户指南
-• 下载此项目
-• 打开HUAWEI DevEco Studio,单击File> Open选择此ComponentCodelab
-• 单击Build> Build App(s)/Hap(s)>Build Debug Hap(s)以编译hap软件包
-• 单击Run> Run 'entry'以运行hap包
-
-注意
-• 您可以选择在模拟器或真机上运行hap软件包。
-• 如果在真机上运行它,则需要在项目的File> Project Structure> Modules> Signing Configs中配置签名和证书信息。
-
-许可
-请参阅LICENSE文件以获得更多信息。
-
-What is it?
-This demo uses the general animation style. We use a simple example to implement translation, rotation, scaling, and transparency changes.
-
-Installation requirements
-• Install DevEco Studio
-• Set up the DevEco Studio development environment.The DevEco Studio development environment needs to depend on the network environment. It needs to be connected to the network to ensure the normal use of the tool.The development environment can be configured according to the following two situations
- 1.If you can directly access the Internet, just download the HarmonyOS SDK
- 2.If the network cannot access the Internet directly, it can be accessed through a proxy server
-• Generate secret key and apply for certificate
-
-User guide
-• Download this Project
-• Open HUAWEI DevEco Studio, click File> Open> Then select and open this Project
-• Click Build> Build App(s)/Hap(s)>Build Debug Hap(s) to compile the hap package
-• Click Run> Run 'entry' to run the hap package
-
-Note
-• You can choose to run the hap package on the simulator or the phone.
-• If you run it on the phone, you need to configure the signature and certificate information in the project's File> Project Structure> Modules> Signing Configs.
-
-Licensing
-Please see LICENSE for more info.
-
diff --git a/AnimationDemo/RELEASE-NOTES.MD b/AnimationDemo/RELEASE-NOTES.MD
deleted file mode 100644
index 9087a1482627f316280b762b6c5adc73c0d438d1..0000000000000000000000000000000000000000
--- a/AnimationDemo/RELEASE-NOTES.MD
+++ /dev/null
@@ -1 +0,0 @@
-1.0.0.1 Initial version
\ No newline at end of file
diff --git a/AnimationDemo/build.gradle b/AnimationDemo/build.gradle
index 053b598314427762ef9ed02bced2d2b234093d42..9cf74c205fc884ae2c6796ce2298ecbe3f40672d 100644
--- a/AnimationDemo/build.gradle
+++ b/AnimationDemo/build.gradle
@@ -3,10 +3,7 @@ apply plugin: 'com.huawei.ohos.app'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 5
- defaultConfig {
- compatibleSdkVersion 4
- }
+ compileSdkVersion 6
}
buildscript {
@@ -19,8 +16,8 @@ buildscript {
}
}
dependencies {
- classpath 'com.huawei.ohos:hap:2.4.5.0'
- classpath 'com.huawei.ohos:decctest:1.2.4.1'
+ classpath 'com.huawei.ohos:hap:2.4.5.5'
+ classpath 'com.huawei.ohos:decctest:1.2.5.1'
}
}
diff --git a/ToolbarApplication/entry/.gitignore b/AnimationDemo/entry/.gitignore
similarity index 100%
rename from ToolbarApplication/entry/.gitignore
rename to AnimationDemo/entry/.gitignore
diff --git a/AnimationDemo/entry/build.gradle b/AnimationDemo/entry/build.gradle
index 6618a979327905114e1a5efa61aca8805144d664..cccb71cae91018743841ab76aeb19c595f4ed847 100644
--- a/AnimationDemo/entry/build.gradle
+++ b/AnimationDemo/entry/build.gradle
@@ -1,10 +1,9 @@
apply plugin: 'com.huawei.ohos.hap'
-apply plugin: 'com.huawei.ohos.decctest'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 5
+ compileSdkVersion 6
defaultConfig {
- compatibleSdkVersion 4
+ compatibleSdkVersion 6
}
buildTypes {
release {
@@ -14,13 +13,11 @@ ohos {
}
}
}
+
+ supportSystem "standard"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testImplementation 'junit:junit:4.13'
- ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200'
-}
-decc {
- supportType = ['html', 'xml']
}
diff --git a/AnimationDemo/entry/src/main/config.json b/AnimationDemo/entry/src/main/config.json
index dcd3b9daf8d4224dabc681cceb30fc5dd52d8108..0e3106cec6b0a40eb2ea7bd1cf28e3acab4d8b19 100644
--- a/AnimationDemo/entry/src/main/config.json
+++ b/AnimationDemo/entry/src/main/config.json
@@ -1,6 +1,6 @@
{
"app": {
- "bundleName": "com.huawei.codelab",
+ "bundleName": "com.huawei.cookbook",
"vendor": "huawei",
"version": {
"code": 1000000,
@@ -9,9 +9,9 @@
},
"deviceConfig": {},
"module": {
- "package": "com.huawei.codelab",
+ "package": "com.huawei.animationdemo",
"name": ".MyApplication",
- "mainAbility": "com.huawei.codelab.MainAbility",
+ "mainAbility": "com.huawei.animationdemo.MainAbility",
"deviceType": [
"phone"
],
@@ -19,7 +19,7 @@
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
- "installationFree": true
+ "installationFree": false
},
"abilities": [
{
@@ -33,9 +33,11 @@
]
}
],
- "name": "com.huawei.codelab.MainAbility",
+ "orientation": "unspecified",
+ "name": "com.huawei.animationdemo.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
+ "formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
@@ -44,12 +46,13 @@
"js": [
{
"pages": [
- "pages/index/index"
+ "pages/index/index",
+ "pages/second/second"
],
"name": "default",
"window": {
"designWidth": 720,
- "autoDesignWidth": true
+ "autoDesignWidth": false
}
}
]
diff --git a/AnimationDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java b/AnimationDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java
deleted file mode 100644
index dc322f31e26af610b5dc38d763fb0499fc5768bd..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 a 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.huawei.codelab;
-
-import ohos.aafwk.content.Intent;
-import ohos.ace.ability.AceAbility;
-
-/**
- * MainAbility
- *
- * @since 2021-08-13
- */
-public class MainAbility extends AceAbility {
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- }
-
- @Override
- public void onStop() {
- super.onStop();
- }
-}
diff --git a/AnimationDemo/entry/src/main/java/com/huawei/codelab/MyApplication.java b/AnimationDemo/entry/src/main/java/com/huawei/codelab/MyApplication.java
deleted file mode 100644
index 187dc063c4a35a429e2be829805292c21a510910..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/main/java/com/huawei/codelab/MyApplication.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 a 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.huawei.codelab;
-
-import ohos.aafwk.ability.AbilityPackage;
-
-/**
- * MyApplication
- *
- * @since 2021-08-13
- */
-public class MyApplication extends AbilityPackage {
- @Override
- public void onInitialize() {
- super.onInitialize();
- }
-}
diff --git a/AnimationDemo/entry/src/main/js/default/app.js b/AnimationDemo/entry/src/main/js/default/app.js
index b6ace9fa8c02f05c988f27c74b5552bfc26dac95..6d060ffe5682c19fc83e2274a9e62cbc40a655f8 100644
--- a/AnimationDemo/entry/src/main/js/default/app.js
+++ b/AnimationDemo/entry/src/main/js/default/app.js
@@ -1,23 +1,8 @@
-/*
- * 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 a 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.
- */
-
export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
+ onCreate() {
+ console.info("Application onCreate");
+ },
+ onDestroy() {
+ console.info("Application onDestroy");
+ }
};
diff --git a/AnimationDemo/entry/src/main/js/default/i18n/en-US.json b/AnimationDemo/entry/src/main/js/default/i18n/en-US.json
index e63c70d978a3a53be988388c87182f81785e170c..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 100644
--- a/AnimationDemo/entry/src/main/js/default/i18n/en-US.json
+++ b/AnimationDemo/entry/src/main/js/default/i18n/en-US.json
@@ -1,6 +1,11 @@
{
"strings": {
"hello": "Hello",
- "world": "World"
+ "world": "World",
+ "page": "Second Page",
+ "next": "Next Page",
+ "back": "Back"
+ },
+ "Files": {
}
}
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/main/js/default/i18n/zh-CN.json b/AnimationDemo/entry/src/main/js/default/i18n/zh-CN.json
index de6ee5748322f44942c1b003319d8e66c837675f..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a 100644
--- a/AnimationDemo/entry/src/main/js/default/i18n/zh-CN.json
+++ b/AnimationDemo/entry/src/main/js/default/i18n/zh-CN.json
@@ -1,6 +1,11 @@
{
"strings": {
"hello": "您好",
- "world": "世界"
+ "world": "世界",
+ "page": "第二页",
+ "next": "下一页",
+ "back": "返回"
+ },
+ "Files": {
}
}
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/main/js/default/pages/index/index.css b/AnimationDemo/entry/src/main/js/default/pages/index/index.css
index d94b82e831ac9c1f9cb3441bab4f7ed0efa47b69..1bdd23324887c7a53bf512a796910ecb235ff36d 100644
--- a/AnimationDemo/entry/src/main/js/default/pages/index/index.css
+++ b/AnimationDemo/entry/src/main/js/default/pages/index/index.css
@@ -1,23 +1,10 @@
-/*
- * 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 a 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.
- */
-
.container {
background-color: #F8FCF5;
flex-direction: column;
justify-content: center;
align-items: center;
+ height: 100%;
+ width: 100%;
}
.img {
@@ -112,6 +99,4 @@
to {
opacity: 1;
}
-}
-
-
+}
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/main/js/default/pages/index/index.hml b/AnimationDemo/entry/src/main/js/default/pages/index/index.hml
index 0cef0f1c9f7af94237fb319af366bafa964465c5..48aadd9c129ab2f362381b0d08e68d576303ea5a 100644
--- a/AnimationDemo/entry/src/main/js/default/pages/index/index.hml
+++ b/AnimationDemo/entry/src/main/js/default/pages/index/index.hml
@@ -1,16 +1,3 @@
-
-
translate
diff --git a/AnimationDemo/entry/src/main/js/default/pages/index/index.js b/AnimationDemo/entry/src/main/js/default/pages/index/index.js
index c89a4e391f4a1ea4cd60dce468d20d61ec781ca7..b1c6ea436a540020ff61f01dea449d5b39367b27 100644
--- a/AnimationDemo/entry/src/main/js/default/pages/index/index.js
+++ b/AnimationDemo/entry/src/main/js/default/pages/index/index.js
@@ -1,16 +1 @@
-/*
- * 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 a 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.
- */
-
export default {}
diff --git a/ToolbarApplication/entry/src/main/js/default/common/fifth/second.css b/AnimationDemo/entry/src/main/js/default/pages/second/second.css
similarity index 43%
rename from ToolbarApplication/entry/src/main/js/default/common/fifth/second.css
rename to AnimationDemo/entry/src/main/js/default/pages/second/second.css
index ce4a2184b50f8339f6b31ae524ad77e22a1cd531..31a367638424feefb8cc68f60cb809bef8443197 100644
--- a/ToolbarApplication/entry/src/main/js/default/common/fifth/second.css
+++ b/AnimationDemo/entry/src/main/js/default/pages/second/second.css
@@ -1,5 +1,6 @@
.container {
display: flex;
+ flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
@@ -8,3 +9,16 @@
height: 100%;
}
+.title {
+ font-size: 60px;
+ text-align: center;
+ width: 100%;
+ height: 40%;
+ margin: 10px;
+}
+
+.btn {
+ width: 50%;
+ height: 100px;
+ font-size: 40px;
+}
diff --git a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.hml b/AnimationDemo/entry/src/main/js/default/pages/second/second.hml
similarity index 34%
rename from AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.hml
rename to AnimationDemo/entry/src/main/js/default/pages/second/second.hml
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..d75ce9375e151799d8f0a9ad4cb56138751561d3 100644
--- a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.hml
+++ b/AnimationDemo/entry/src/main/js/default/pages/second/second.hml
@@ -1,5 +1,6 @@
diff --git a/AnimationDemo/entry/src/main/js/default/pages/second/second.js b/AnimationDemo/entry/src/main/js/default/pages/second/second.js
new file mode 100644
index 0000000000000000000000000000000000000000..ac4f4f83da1d046e0dd8f5aa7d625092e99cc805
--- /dev/null
+++ b/AnimationDemo/entry/src/main/js/default/pages/second/second.js
@@ -0,0 +1,12 @@
+import router from '@system.router'
+
+export default {
+ data: {
+ title: 'World'
+ },
+ onclick: function () {
+ router.replace({
+ uri: "pages/index/index"
+ })
+ }
+}
diff --git a/AnimationDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java b/AnimationDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java
deleted file mode 100644
index ac163632818a978d48332f85e6c6b4fb366af624..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.huawei.codelab;
-
-import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class ExampleOhosTest {
- @Test
- public void testBundleName() {
- final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
- assertEquals("com.huawei.cookbook", actualBundleName);
- }
-}
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/ohosTest/js/default/app.js b/AnimationDemo/entry/src/ohosTest/js/default/app.js
deleted file mode 100644
index 55b67e96deb821033f71d30b6fff05efdeb0d901..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/js/default/app.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- onCreate() {
- console.info('TestApplication onCreate');
- },
- onDestroy() {
- console.info('TestApplication onDestroy');
- }
-};
diff --git a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.css b/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.js b/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.js
deleted file mode 100644
index 8be2df2479a8da755ed800ad70d2b6247e21b8a2..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/js/default/pages/index/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {Core, Constant, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- const reportExtend = new ReportExtend(file)
- const instrumentLog = new InstrumentLog({
- 'id': 'report',
- 'version': '1.0.3'
- })
- core.addService('expect', expectExtend)
- core.addService('report', reportExtend)
- core.addService('report', instrumentLog)
- core.init()
- core.subscribeEvent('spec', instrumentLog)
- core.subscribeEvent('suite', instrumentLog)
- core.subscribeEvent('task', instrumentLog)
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {
- },
-}
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js b/AnimationDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js
deleted file mode 100644
index b6d74caed96ddede98edd1bc9292f6568cd1cfd1..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import app from '@system.app'
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-describe('appInfoTest', function () {
- it('app_info_test_001', 0, function () {
- var info = app.getInfo()
- expect(info.versionName).assertEqual('1.0')
- expect(info.versionCode).assertEqual('3')
- })
-})
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/ohosTest/js/test/List.test.js b/AnimationDemo/entry/src/ohosTest/js/test/List.test.js
deleted file mode 100644
index 305eb5bb254cd4802afaffebe68fca2f9436159f..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/js/test/List.test.js
+++ /dev/null
@@ -1 +0,0 @@
-require('./ExampleJsunit.test.js')
\ No newline at end of file
diff --git a/AnimationDemo/entry/src/ohosTest/resources/base/element/string.json b/AnimationDemo/entry/src/ohosTest/resources/base/element/string.json
deleted file mode 100644
index c9a7178aa896d985f3ae55b48178b37de4380c77..0000000000000000000000000000000000000000
--- a/AnimationDemo/entry/src/ohosTest/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "AnimationDemo"
- },
- {
- "name": "mainability_description",
- "value": "hap sample empty page"
- }
- ]
-}
diff --git a/AudioDemo/LICENSE b/AudioDemo/LICENSE
deleted file mode 100644
index b36a10d589119cb8557ff572ca3f5b0aab970604..0000000000000000000000000000000000000000
--- a/AudioDemo/LICENSE
+++ /dev/null
@@ -1,78 +0,0 @@
- 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 a 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.
-
-Apache License, Version 2.0
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-1.You must give any other recipients of the Work or Derivative Works a copy of this License; and
-2.You must cause any modified files to carry prominent notices stating that You changed the files; and
-3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
diff --git a/AudioDemo/README.md b/AudioDemo/README.md
deleted file mode 100644
index f956cc95f3411aca797d9b922a93e861aab48db9..0000000000000000000000000000000000000000
--- a/AudioDemo/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# AudioDemo
-简介
-• 此Demo用于使用播放器播放音乐、声音采集、录音播放和多媒体音量控制。
-
-安装要求
-• 安装DevEco Studio
-• 设置DevEco Studio开发环境。DevEco Studio开发环境需要连接到网络,以确保该正常使用。可以根据以下两种情况配置开发环境:
- 1.如果您可以直接访问Internet,则只需下载HarmonyOS SDK
- 2.如果网络无法直接访问Internet,则可以通过代理服务器进行访问
-• 生成密钥并申请证书
-
-用户指南
-• 下载此项目
-• 打开HUAWEI DevEco Studio,单击File> Open选择此项目
-• 单击Build> Build App(s)/Hap(s)>Build Debug Hap(s)以编译hap软件包
-• 单击Run> Run 'entry'以运行hap包
-
-注意
-• 您可以选择在模拟器或真机上运行hap软件包。
-• 如果在真机上运行它,则需要在项目的File> Project Structure> Modules> Signing Configs中配置签名和证书信息。
-
-许可
-请参阅LICENSE文件以获得更多信息。
-
-What is it?
-This demo is used to play music using the player, capture sound, record playback, and multimedia volume control.
-
-Installation requirements
-• Install DevEco Studio
-• Set up the DevEco Studio development environment.The DevEco Studio development environment needs to depend on the network environment. It needs to be connected to the network to ensure the normal use of the tool.The development environment can be configured according to the following two situations
- 1.If you can directly access the Internet, just download the HarmonyOS SDK
- 2.If the network cannot access the Internet directly, it can be accessed through a proxy server
-• Generate secret key and apply for certificate
-
-User guide
-• Download this Project
-• Open HUAWEI DevEco Studio, click File> Open> Then select and open this Project
-• Click Build> Build App(s)/Hap(s)>Build Debug Hap(s) to compile the hap package
-• Click Run> Run 'entry' to run the hap package
-
-Note
-• You can choose to run the hap package on the simulator or the phone.
-• If you run it on the phone, you need to configure the signature and certificate information in the project's File> Project Structure> Modules> Signing Configs.
-
-Licensing
-Please see LICENSE for more info.
diff --git a/AudioDemo/RELEASE-NOTES.md b/AudioDemo/RELEASE-NOTES.md
deleted file mode 100644
index ea23a13e3d4407d06cba3aa7155a23e5081b50b4..0000000000000000000000000000000000000000
--- a/AudioDemo/RELEASE-NOTES.md
+++ /dev/null
@@ -1,2 +0,0 @@
-1.0.0
-1.Initial version
\ No newline at end of file
diff --git a/AudioDemo/build.gradle b/AudioDemo/build.gradle
deleted file mode 100644
index 06dd00dc762e906aae9d3bbe99b958eb024f1999..0000000000000000000000000000000000000000
--- a/AudioDemo/build.gradle
+++ /dev/null
@@ -1,37 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-apply plugin: 'com.huawei.ohos.app'
-
-ohos {
- compileSdkVersion 5
- defaultConfig {
- compatibleSdkVersion 5
- }
-}
-
-buildscript {
- repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
- jcenter()
- }
- dependencies {
- classpath 'com.huawei.ohos:hap:2.4.2.7'
- classpath 'com.huawei.ohos:decctest:1.0.0.7'
- }
-}
-
-allprojects {
- repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
- jcenter()
- }
-}
diff --git a/AudioDemo/entry/build.gradle b/AudioDemo/entry/build.gradle
deleted file mode 100644
index 09716d2e58d750c54a41fff04b066ac4ddf8fafe..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/build.gradle
+++ /dev/null
@@ -1,16 +0,0 @@
-apply plugin: 'com.huawei.ohos.hap'
-apply plugin: 'com.huawei.ohos.decctest'
-ohos {
- compileSdkVersion 5
- defaultConfig {
- compatibleSdkVersion 5
- }
-}
-
-dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
- testCompile'junit:junit:4.12'
-}
-decc {
- supportType = ['html','xml']
-}
diff --git a/AudioDemo/entry/src/main/config.json b/AudioDemo/entry/src/main/config.json
deleted file mode 100644
index 7dbd6ba8152861f7b56a2f9298b637b15b4062df..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/config.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "app": {
- "bundleName": "com.huawei.cookbook",
- "vendor": "huawei",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.huawei.harmonyaudiodemo",
- "name": ".MyApplication",
- "deviceType": [
- "default"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry",
- "installationFree": false
- },
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home",
- "action.sound.play.system",
- "action.sound.play.music",
- "action.sound.record",
- "action.sound.volume"
- ]
- }
- ],
- "orientation": "unspecified",
- "name": "com.huawei.harmonyaudiodemo.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "formsEnabled": true,
- "launchType": "standard"
- }
- ],
- "reqPermissions": [
- {
- "name": "ohos.permission.MICROPHONE"
- },
- {
- "name": "ohos.permission.WRITE_MEDIA"
- },
- {
- "name": "ohos.permission.WRITE_USER_STORAGE"
- },
- {
- "name": "ohos.permission.READ_USER_STORAGE"
- },
- {
- "name": "ohos.permission.READ_MEDIA"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MainAbility.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MainAbility.java
deleted file mode 100644
index d844f291acea6981eb6e45b4f60806ceb42636ec..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MainAbility.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo;
-
-import static ohos.bundle.IBundleManager.PERMISSION_GRANTED;
-
-import com.huawei.harmonyaudiodemo.slice.MainAbilitySlice;
-import com.huawei.harmonyaudiodemo.slice.MusicPlayerAbilitySlice;
-import com.huawei.harmonyaudiodemo.slice.SoundRecordSlice;
-import com.huawei.harmonyaudiodemo.slice.SoundSystemSlice;
-import com.huawei.harmonyaudiodemo.slice.SoundVolumeSlice;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.aafwk.ability.Ability;
-import ohos.aafwk.content.Intent;
-import ohos.security.SystemPermission;
-
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * MainAbility
- *
- * @since 2021-04-04
- */
-public class MainAbility extends Ability {
- private static final String TAG = MainAbility.class.getSimpleName();
- private static final int PERMISSION_REQUEST_CODE = 1;
-
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- super.setMainRoute(MainAbilitySlice.class.getName());
- addActionRoute("action.sound.play.music", MusicPlayerAbilitySlice.class.getName());
- addActionRoute("action.sound.play.system", SoundSystemSlice.class.getName());
- addActionRoute("action.sound.record", SoundRecordSlice.class.getName());
- addActionRoute("action.sound.volume", SoundVolumeSlice.class.getName());
-
- requestPermission();
- }
-
- private void requestPermission() {
- List permissions;
- permissions = new LinkedList<>(
- Arrays.asList(
- SystemPermission.WRITE_MEDIA,
- SystemPermission.READ_MEDIA,
- SystemPermission.WRITE_USER_STORAGE,
- SystemPermission.READ_USER_STORAGE,
- SystemPermission.MICROPHONE));
- permissions.removeIf(permission ->
- verifySelfPermission(permission) == PERMISSION_GRANTED || !canRequestPermission(permission));
- if (!permissions.isEmpty()) {
- requestPermissionsFromUser(permissions.toArray(new String[0]), PERMISSION_REQUEST_CODE);
- }
- }
-
- @Override
- public void onRequestPermissionsFromUserResult(int requestCode, String[] permissions, int[] grantResults) {
- if (requestCode != PERMISSION_REQUEST_CODE) {
- return;
- }
- for (int grantResult : grantResults) {
- if (grantResult != PERMISSION_GRANTED) {
- LogUtil.info(TAG, grantResult + " is denied , Some functions may be affected.");
- }
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MyApplication.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MyApplication.java
deleted file mode 100644
index a7fcbd9bd6ecced2315f7ac86e1fc6491670d728..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/MyApplication.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo;
-
-import ohos.aafwk.ability.AbilityPackage;
-
-/**
- * MyApplication
- *
- * @since 2021-04-04
- */
-public class MyApplication extends AbilityPackage {
- @Override
- public void onInitialize() {
- super.onInitialize();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/constant/Const.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/constant/Const.java
deleted file mode 100644
index 819cad4d92a379a3c7392acb6e6a855f97a32f02..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/constant/Const.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.constant;
-
-/**
- * HmSounder Const
- *
- * @since 2021-01-17
- */
-public class Const {
- /**
- * -1
- */
- public static final int NUMBER_NEGATIVE_1 = -1;
- /**
- * 100
- */
- public static final int NUMBER_100 = 100;
- /**
- * 60
- */
- public static final int NUMBER_60 = 60;
- /**
- * 114
- */
- public static final int NUMBER_114 = 114;
- /**
- * 300
- */
- public static final int NUMBER_300 = 300;
- /**
- * 500
- */
- public static final int NUMBER_500 = 500;
- /**
- * BUFFERSIZE
- */
- public static final int BUFFERSIZE = 1024;
-
- /**
- * SAMPLE RATE
- */
- public static final int SAMPLE_RATE = 44100;
-
- /**
- * BUFFER SIZE IN BYTES
- */
- public static final int BUFFER_SIZE_IN_BYTES = 100;
-
- /**
- * VOICE FILE PREFIX
- */
- public static final String VOICE_FILE_PREFIX = "VID_";
-
- /**
- * VOICE FILE PREFIX
- */
- public static final String VOICE_FILE_MUSIC = "MUSIC_";
-
- /**
- * VOICE FILE NAME
- */
- public static final String VOICE_FILE_NAME = "test";
-
- /**
- * VOICE FILE TYPE
- */
- public static final String VOICE_FILE_TYPE_MP3 = ".mp3";
-
- /**
- * VOICE FILE TYPE
- */
- public static final String VOICE_FILE_TYPE_M4A = ".m4a";
-
- private Const() {
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRecorder.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRecorder.java
deleted file mode 100644
index cae4e517fd3566544c991a7952293f5aeb7944a5..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRecorder.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media;
-
-import com.huawei.harmonyaudiodemo.constant.Const;
-import com.huawei.harmonyaudiodemo.media.api.AudioRecordListener;
-import com.huawei.harmonyaudiodemo.media.constant.MediaConst;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.agp.utils.TextTool;
-import ohos.eventhandler.EventHandler;
-import ohos.eventhandler.EventRunner;
-import ohos.media.audio.AudioCapturer;
-import ohos.media.audio.AudioCapturerInfo;
-import ohos.media.audio.AudioStreamInfo;
-
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-/**
- * Hm AudioRecorder
- *
- * @since 2021-04-04
- */
-public class AudioRecorder {
- private static final String TAG = AudioRecorder.class.getSimpleName();
- private AudioCapturer audioCapturer;
- private AudioStreamInfo audioStreamInfo;
- private EventHandler audioRecorderHandler;
- private Builder builder;
- private int bufferSize;
- private boolean isRecording;
- private boolean isSaveFile;
-
- private AudioRecordListener audioRecordListener;
-
- private AudioRecorder(Builder builder) {
- this.builder = builder;
- isSaveFile = !TextTool.isNullOrEmpty(builder.savefilePath);
- bufferSize =
- AudioCapturer.getMinBufferSize(
- builder.inputSampleRate,
- AudioStreamInfo.getChannelCount(builder.channelMask),
- builder.encodingFormat.getValue());
- audioRecorderHandler = new EventHandler(EventRunner.create(AudioRecorder.class.getSimpleName()));
- initRecord();
- }
-
- private void initRecord() {
- if (audioStreamInfo == null) {
- audioStreamInfo = new AudioStreamInfo.Builder()
- .encodingFormat(builder.encodingFormat)
- .channelMask(builder.channelMask)
- .sampleRate(builder.inputSampleRate)
- .build();
- AudioCapturerInfo audioCapturerInfo = new AudioCapturerInfo.Builder()
- .audioStreamInfo(audioStreamInfo)
- .audioInputSource(builder.inputSource)
- .build();
- audioCapturer = new AudioCapturer(audioCapturerInfo);
- }
- }
-
- private void startRecord() {
- isRecording = true;
- BufferedOutputStream dos = null;
- try {
- if (isSaveFile) {
- dos = new BufferedOutputStream(new FileOutputStream(builder.savefilePath));
- }
- byte[] buffers = new byte[bufferSize];
- int length = audioCapturer.read(buffers, 0, bufferSize);
- while (length != Const.NUMBER_NEGATIVE_1) {
- if (audioRecordListener != null) {
- audioRecordListener.onGetRecordBuffer(buffers, length);
- }
- if (dos != null) {
- dos.write(buffers);
- }
- length = audioCapturer.read(buffers, 0, bufferSize);
- }
- } catch (IOException e) {
- LogUtil.error(TAG, "start record failed!");
- } finally {
- if (dos != null) {
- try {
- dos.close();
- } catch (IOException e) {
- LogUtil.error(TAG, "start record failed!");
- }
- }
- }
- }
-
- /**
- * record
- */
- public void record() {
- if (!isRecording) {
- initRecord();
- audioRecorderHandler.postTask(() -> {
- if (audioCapturer.start()) {
- startRecord();
- }
- });
- }
- }
-
- /**
- * stopRecord
- */
- public void stopRecord() {
- if (isRecording && audioCapturer.stop()) {
- isRecording = false;
- }
- }
-
- /**
- * setAudioRecordListener
- *
- * @param listener listener
- */
- public void setAudioRecordListener(AudioRecordListener listener) {
- audioRecordListener = listener;
- }
-
- /**
- * release recorder
- */
- public void release() {
- stopRecord();
- if (audioCapturer != null) {
- audioCapturer.release();
- }
- audioStreamInfo = null;
- }
-
- /**
- * is recording in current time
- *
- * @return isRecording
- */
- public boolean isRecording() {
- return isRecording;
- }
-
- /**
- * Builder
- *
- * @since 2020-12-04
- */
- public static class Builder {
- private String savefilePath;
- private AudioStreamInfo.EncodingFormat encodingFormat;
- private AudioStreamInfo.ChannelMask channelMask;
- private AudioCapturerInfo.AudioInputSource inputSource;
- private int inputSampleRate;
-
- /**
- * constructor of Builder
- */
- public Builder() {
- encodingFormat = AudioStreamInfo.EncodingFormat.ENCODING_PCM_16BIT; // 16-bit PCM
- channelMask = AudioStreamInfo.ChannelMask.CHANNEL_IN_STEREO; // 双声道
- inputSource = AudioCapturerInfo.AudioInputSource.AUDIO_INPUT_SOURCE_VOICE_COMMUNICATION; // 消除回声,降噪
- inputSampleRate = MediaConst.SAMPLE_RATE;
- }
-
- /**
- * setSaveFilePath of Builder
- *
- * @param filePath filePath
- * @return builder
- */
- public Builder setSaveFilePath(String filePath) {
- this.savefilePath = filePath;
- return this;
- }
-
- /**
- * create of Builder
- *
- * @return AudioRecorder
- */
- public AudioRecorder create() {
- return new AudioRecorder(this);
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRender.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRender.java
deleted file mode 100644
index d45b76e6c97c4ad2656e7bb1432971cbdf70713e..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/AudioRender.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media;
-
-import com.huawei.harmonyaudiodemo.media.api.AudioPlayListener;
-import com.huawei.harmonyaudiodemo.media.constant.MediaConst;
-import com.huawei.harmonyaudiodemo.media.constant.MediaStatu;
-
-import ohos.eventhandler.EventHandler;
-import ohos.eventhandler.EventRunner;
-import ohos.media.audio.AudioCapturer;
-import ohos.media.audio.AudioRenderer;
-import ohos.media.audio.AudioRendererInfo;
-import ohos.media.audio.AudioStreamInfo;
-
-/**
- * AudioRender
- *
- * @since 2021-04-09
- */
-public class AudioRender {
- private static final String TAG = AudioRender.class.getSimpleName();
- private AudioRendererInfo audioRenderInfo;
- private AudioRenderer audioRender;
- private EventHandler audioRenderHandler;
- private MediaStatu audioRenderStatu = MediaStatu.IDEL;
- private Builder builder;
- private int bufferSize;
- private AudioPlayListener audioPlayListener;
-
- private AudioRender(Builder builder) {
- this.builder = builder;
- bufferSize =
- AudioCapturer.getMinBufferSize(
- builder.inputSampleRate,
- AudioStreamInfo.getChannelCount(builder.channelMask),
- builder.encodingFormat.getValue());
- audioRenderHandler = new EventHandler(EventRunner.create(AudioRender.class.getSimpleName()));
- initRender();
- }
-
- private void initRender() {
- AudioStreamInfo asi = new AudioStreamInfo.Builder()
- .encodingFormat(builder.encodingFormat)
- .channelMask(builder.channelMask)
- .sampleRate(builder.inputSampleRate)
- .audioStreamFlag(builder.streamFlag)
- .streamUsage(builder.streamUsage)
- .build();
- audioRenderInfo = new AudioRendererInfo.Builder()
- .audioStreamInfo(asi)
- .audioStreamOutputFlag(builder.streamOutputFlag)
- .bufferSizeInBytes(bufferSize)
- .isOffload(builder.isOneOffLoad) // false表示分段传输buffer并播放,true表示整个音频流一次性传输到HAL层播放
- .build();
- audioRender = new AudioRenderer(audioRenderInfo, AudioRenderer.PlayMode.MODE_STREAM);
- audioRender.setFrameIntervalObserver(() -> {
- if (audioRender.getAudioTime().getFramePosition() != 0) {
- if (audioPlayListener != null) {
- audioPlayListener.onComplete();
- }
- release();
- }
- }, MediaConst.READ_RENDER_INTERVAL, audioRenderHandler);
- }
-
- /**
- * start
- */
- public void start() {
- if (audioRenderStatu == MediaStatu.STOP || audioRenderStatu == MediaStatu.IDEL) {
- if (audioRender != null) {
- if (audioRender.start()) {
- audioRenderStatu = MediaStatu.START;
- }
- }
- }
- }
-
- /**
- * pause
- */
- public void pause() {
- if (audioRender != null) {
- if (audioRender.pause()) {
- audioRenderStatu = MediaStatu.PAUSE;
- }
- }
- }
-
- /**
- * setSpeed
- *
- * @param speed speed
- */
- public void setSpeed(float speed) {
- if (audioRender != null) {
- audioRender.setSpeed(speed);
- }
- }
-
- /**
- * setVolume
- *
- * @param volume volume
- */
- public void setVolume(float volume) {
- if (audioRender != null) {
- audioRender.setVolume(volume);
- }
- }
-
- /**
- * stop
- */
- public void stop() {
- if (audioRender != null) {
- if (audioRender.stop()) {
- audioRenderStatu = MediaStatu.STOP;
- if (audioPlayListener != null) {
- audioPlayListener.onComplete();
- }
- }
- }
- }
-
- /**
- * playRecord
- *
- * @param bytes bytes
- * @param length length
- */
- public void play(byte[] bytes, int length) {
- if (audioRenderInfo == null) {
- initRender();
- }
- start();
- audioRenderHandler.postTask(() -> {
- byte[] datas = new byte[length];
- System.arraycopy(bytes, 0, datas, 0, datas.length);
- audioRender.write(datas, 0, datas.length);
- });
- }
-
- /**
- * release recorder
- */
- public void release() {
- if (audioRender != null) {
- if (audioRender.release()) {
- audioRenderStatu = MediaStatu.IDEL;
- audioRenderInfo = null;
- }
- }
- }
-
- /**
- * release recorder
- *
- * @param listener listener
- */
- public void setPlayListener(AudioPlayListener listener) {
- audioPlayListener = listener;
- }
-
- /**
- * Builder
- *
- * @since 2020-12-04
- */
- public static class Builder {
- private boolean isOneOffLoad;
- private AudioStreamInfo.EncodingFormat encodingFormat;
- private AudioStreamInfo.ChannelMask channelMask;
- private int inputSampleRate;
- private AudioStreamInfo.AudioStreamFlag streamFlag;
- private AudioStreamInfo.StreamUsage streamUsage;
- private AudioRendererInfo.AudioStreamOutputFlag streamOutputFlag;
-
- /**
- * constructor of Builder
- */
- public Builder() {
- isOneOffLoad = true;
- encodingFormat = AudioStreamInfo.EncodingFormat.ENCODING_PCM_16BIT; // 16-bit PCM
- channelMask = AudioStreamInfo.ChannelMask.CHANNEL_OUT_STEREO; // 双声道
- inputSampleRate = MediaConst.SAMPLE_RATE;
- streamFlag = AudioStreamInfo.AudioStreamFlag.AUDIO_STREAM_FLAG_MAY_DUCK; // 混音
- streamUsage = AudioStreamInfo.StreamUsage.STREAM_USAGE_MEDIA; // 媒体类音频
- streamOutputFlag = AudioRendererInfo.AudioStreamOutputFlag.AUDIO_STREAM_OUTPUT_FLAG_DIRECT_PCM;
- }
-
- /**
- * setOneOffLoad of Builder
- *
- * @param isOneOffLoadDatas isOneOffLoad
- * @return builder
- */
- public Builder setOneOffLoad(boolean isOneOffLoadDatas) {
- this.isOneOffLoad = isOneOffLoadDatas;
- return this;
- }
-
- /**
- * create of Builder
- *
- * @return AudioRender
- */
- public AudioRender create() {
- return new AudioRender(this);
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioPlayListener.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioPlayListener.java
deleted file mode 100644
index 12981f05636407cd326bfaee04f11324e0aa5509..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioPlayListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media.api;
-
-/**
- * AudioPlayListener
- *
- * @since 2021-04-09
- */
-public interface AudioPlayListener {
- /**
- * onComplete
- */
- void onComplete();
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioRecordListener.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioRecordListener.java
deleted file mode 100644
index bb9111a6c83031cf271878846c60bf60281a2870..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/api/AudioRecordListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media.api;
-
-/**
- * AudioRecordListener
- *
- * @since 2021-04-09
- */
-public interface AudioRecordListener {
- /**
- * onGetRecordBuffer
- *
- * @param length length
- * @param buffer buffer
- */
- void onGetRecordBuffer(byte[] buffer, int length);
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaConst.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaConst.java
deleted file mode 100644
index a586540651ca5624acd72bc09783895f69c8d162..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaConst.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media.constant;
-
-/**
- * Camera ConstUtil
- *
- * @since 2021-01-17
- */
-public class MediaConst {
- /**
- * read render interval
- */
- public static final int READ_RENDER_INTERVAL = 1024;
- /**
- * VOICE FILE PREFIX
- */
- public static final String VOICE_FILE_MUSIC = "MUSIC_";
-
- /**
- * VOICE FILE TYPE
- */
- public static final String VOICE_FILE_TYPE_MP3 = ".mp3";
-
- /**
- * recorder fps
- */
- public static final int RECORDER_FPS = 30;
-
- /**
- * recorder bit rate
- */
- public static final int RECORDER_BIT_RATE = 10000000;
-
- /**
- * recorder frame rate
- */
- public static final int RECORDER_FRAME_RATE = 25;
-
- /**
- * BUFFERSIZE
- */
- public static final int BUFFERSIZE = 1024;
-
- /**
- * SAMPLE RATE
- */
- public static final int SAMPLE_RATE = 44100;
-
- private MediaConst() {
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaStatu.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaStatu.java
deleted file mode 100644
index c4e856c98fb803de11f7e1e65df1d6958f943417..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/media/constant/MediaStatu.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.media.constant;
-
-/**
- * PlayerStatu enum
- *
- * @since 2021-04-04
- */
-public enum MediaStatu {
- /**
- * idel
- */
- IDEL,
- /**
- * preparing
- */
- PREPARED,
- /**
- * start
- */
- START,
- /**
- * pause
- */
- PAUSE,
- /**
- * stop
- */
- STOP
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/HmPlayer.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/HmPlayer.java
deleted file mode 100644
index 02c7f88e03acf7c9e1fc2474542207884d270f04..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/HmPlayer.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player;
-
-import com.huawei.harmonyaudiodemo.constant.Const;
-import com.huawei.harmonyaudiodemo.player.api.ImplHmPlayer;
-import com.huawei.harmonyaudiodemo.player.api.ImplLifecycle;
-import com.huawei.harmonyaudiodemo.player.api.ScreenChangeListener;
-import com.huawei.harmonyaudiodemo.player.api.StatuChangeListener;
-import com.huawei.harmonyaudiodemo.player.constant.PlayerStatu;
-import com.huawei.harmonyaudiodemo.player.factory.SourceFactory;
-import com.huawei.harmonyaudiodemo.player.manager.HmPlayerLifecycle;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.agp.graphics.Surface;
-import ohos.app.Context;
-import ohos.app.dispatcher.task.TaskPriority;
-import ohos.media.common.Source;
-import ohos.media.player.Player;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Hm player
- *
- * @since 2021-04-04
- */
-public class HmPlayer implements ImplHmPlayer {
- private static final String TAG = HmPlayer.class.getSimpleName();
- private static final int MICRO_MILLI_RATE = 1000;
- private Player mPlayer;
- private Surface surface;
- private HmPlayerLifecycle mLifecycle;
- private Builder mBuilder;
- private PlayerStatu mStatu = PlayerStatu.IDEL;
- private float currentVolume = 1;
- private double videoScale = Const.NUMBER_NEGATIVE_1;
- private boolean isGestureOpen = true;
-
- private List statuChangeCallbacks = new ArrayList<>(0);
- private List screenChangeCallbacks = new ArrayList<>(0);
-
- /**
- * constructor of HmPlayer
- *
- * @param builder builder
- */
- private HmPlayer(Builder builder) {
- mBuilder = builder;
- mLifecycle = new HmPlayerLifecycle(this);
- }
-
- private void initBasePlayer() {
- mPlayer = new Player(mBuilder.mContext);
- Source source = new SourceFactory(mBuilder.mContext, mBuilder.filePath).getSource();
- mPlayer.setSource(source);
- mPlayer.setPlayerCallback(new HmPlayerCallback());
- }
-
- /**
- * HmPlayer Callback
- *
- * @since 2020-12-04
- */
- private class HmPlayerCallback implements Player.IPlayerCallback {
- @Override
- public void onPrepared() {
- LogUtil.info(TAG, "onPrepared is called ");
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PREPARED;
- callback.statuCallback(PlayerStatu.PREPARED);
- }
- }
-
- @Override
- public void onMessage(int info, int i1) {
- LogUtil.info(TAG, "onMessage info is " + info + ",i1 is" + i1);
- if (i1 == 0) {
- switch (info) {
- case Player.PLAYER_INFO_VIDEO_RENDERING_START:
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PLAY;
- callback.statuCallback(PlayerStatu.PLAY);
- }
- if (mBuilder.isPause) {
- pause();
- }
- break;
- case Player.PLAYER_INFO_BUFFERING_START:
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.BUFFERING;
- callback.statuCallback(PlayerStatu.BUFFERING);
- }
- break;
- case Player.PLAYER_INFO_BUFFERING_END:
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PLAY;
- callback.statuCallback(PlayerStatu.PLAY);
- }
- break;
- default:
- break;
- }
- }
- }
-
- @Override
- public void onError(int type, int extra) {
- LogUtil.info(TAG, "onError is called ,i is " + type + ",i1 is " + extra);
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.ERROR;
- callback.statuCallback(PlayerStatu.ERROR);
- }
- release();
- }
-
- @Override
- public void onResolutionChanged(int videoX, int videoY) {
- LogUtil.info(TAG, "onResolutionChanged videoX is " + videoX + ",videoY is " + videoY);
- if (!mBuilder.isStretch && videoX != 0 && videoY != 0) {
- videoScale = (double) videoX / videoY;
- for (ScreenChangeListener screenChangeCallback : screenChangeCallbacks) {
- screenChangeCallback.screenCallback(0, 0);
- }
- }
- }
-
- @Override
- public void onPlayBackComplete() {
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.COMPLETE;
- callback.statuCallback(PlayerStatu.COMPLETE);
- }
- }
-
- @Override
- public void onRewindToComplete() {
- resume();
- }
-
- @Override
- public void onBufferingChange(int value) {
- }
-
- @Override
- public void onNewTimedMetaData(Player.MediaTimedMetaData mediaTimedMetaData) {
- }
-
- @Override
- public void onMediaTimeIncontinuity(Player.MediaTimeInfo mediaTimeInfo) {
- LogUtil.info(TAG, "onMediaTimeIncontinuity is called");
- for (Player.StreamInfo streanInfo : mPlayer.getStreamInfo()) {
- int streamType = streanInfo.getStreamType();
- if (streamType == Player.StreamInfo.MEDIA_STREAM_TYPE_AUDIO && mStatu == PlayerStatu.PREPARED) {
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PLAY;
- callback.statuCallback(PlayerStatu.PLAY);
- }
- if (mBuilder.isPause) {
- pause();
- }
- }
- }
- }
- }
-
- /**
- * start time consuming operation
- */
- private void start() {
- if (mPlayer != null) {
- mBuilder.mContext.getGlobalTaskDispatcher(TaskPriority.DEFAULT).asyncDispatch(() -> {
- if (surface != null) {
- mPlayer.setVideoSurface(surface);
- } else {
- LogUtil.error(TAG, "The surface has not been initialized.");
- }
- mPlayer.prepare();
- if (mBuilder.startMillisecond > 0) {
- int microsecond = mBuilder.startMillisecond * MICRO_MILLI_RATE;
- mPlayer.rewindTo(microsecond);
- }
- mPlayer.play();
- });
- }
- }
-
- @Override
- public ImplLifecycle getLifecycle() {
- return mLifecycle;
- }
-
- @Override
- public void addSurface(Surface videoSurface) {
- this.surface = videoSurface;
- }
-
- @Override
- public void addPlayerStatuCallback(StatuChangeListener callback) {
- if (callback != null) {
- statuChangeCallbacks.add(callback);
- }
- }
-
- @Override
- public void removePlayerStatuCallback(StatuChangeListener callback) {
- statuChangeCallbacks.remove(callback);
- }
-
- @Override
- public void addPlayerViewCallback(ScreenChangeListener callback) {
- if (callback != null) {
- screenChangeCallbacks.add(callback);
- }
- }
-
- @Override
- public void removePlayerViewCallback(ScreenChangeListener callback) {
- screenChangeCallbacks.remove(callback);
- }
-
- @Override
- public Builder getBuilder() {
- return mBuilder;
- }
-
- @Override
- public PlayerStatu getPlayerStatu() {
- return mStatu;
- }
-
- @Override
- public void resizeScreen(int width, int height) {
- for (ScreenChangeListener screenChangeCallback : screenChangeCallbacks) {
- screenChangeCallback.screenCallback(width, height);
- }
- }
-
- @Override
- public void gestureSwitch(boolean isOpen) {
- isGestureOpen = isOpen;
- }
-
- @Override
- public boolean isGestureOpen() {
- return isGestureOpen;
- }
-
- @Override
- public void play() {
- if (mPlayer != null) {
- mPlayer.reset();
- }
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PREPARING;
- callback.statuCallback(PlayerStatu.PREPARING);
- }
- initBasePlayer();
- start();
- }
-
- @Override
- public void replay() {
- if (isPlaying()) {
- rewindTo(0);
- } else {
- reload(mBuilder.filePath, 0);
- }
- }
-
- @Override
- public void reload(String filepath, int startMillisecond) {
- mBuilder.filePath = filepath;
- mBuilder.startMillisecond = startMillisecond;
- play();
- }
-
- @Override
- public void stop() {
- if (mPlayer == null) {
- return;
- }
- mPlayer.stop();
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.STOP;
- callback.statuCallback(PlayerStatu.STOP);
- }
- }
-
- @Override
- public void release() {
- if (mPlayer == null) {
- return;
- }
- if (mStatu != PlayerStatu.IDEL) {
- videoScale = Const.NUMBER_NEGATIVE_1;
- mPlayer.release();
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.IDEL;
- callback.statuCallback(PlayerStatu.IDEL);
- }
- }
- }
-
- @Override
- public void resume() {
- if (mPlayer == null) {
- return;
- }
- if (mStatu != PlayerStatu.IDEL) {
- if (!isPlaying()) {
- mPlayer.play();
- }
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PLAY;
- callback.statuCallback(PlayerStatu.PLAY);
- }
- }
- }
-
- @Override
- public void pause() {
- if (mPlayer == null) {
- return;
- }
- if (isPlaying()) {
- mPlayer.pause();
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.PAUSE;
- callback.statuCallback(PlayerStatu.PAUSE);
- }
- }
- }
-
- @Override
- public int getCurrentPosition() {
- if (mPlayer == null) {
- return 0;
- }
- return mPlayer.getCurrentTime();
- }
-
- @Override
- public int getDuration() {
- if (mPlayer == null) {
- return 0;
- }
- return mPlayer.getDuration();
- }
-
- @Override
- public float getVolume() {
- return currentVolume;
- }
-
- @Override
- public void setVolume(float volume) {
- if (mPlayer != null && mPlayer.setVolume(volume)) {
- currentVolume = volume;
- }
- }
-
- @Override
- public void setPlaySpeed(float speed) {
- if (mPlayer == null) {
- return;
- }
- if (mStatu != PlayerStatu.IDEL) {
- mPlayer.setPlaybackSpeed(speed);
- }
- }
-
- @Override
- public double getVideoScale() {
- return videoScale;
- }
-
- @Override
- public boolean isPlaying() {
- return mPlayer.isNowPlaying();
- }
-
- @Override
- public void rewindTo(int startMicrosecond) {
- if (mPlayer == null) {
- return;
- }
- if (mStatu != PlayerStatu.IDEL) {
- for (StatuChangeListener callback : statuChangeCallbacks) {
- mStatu = PlayerStatu.BUFFERING;
- callback.statuCallback(PlayerStatu.BUFFERING);
- }
- mPlayer.rewindTo(startMicrosecond * MICRO_MILLI_RATE);
- }
- }
-
- /**
- * Builder
- *
- * @since 2020-12-04
- */
- public static class Builder {
- private Context mContext;
- private String filePath;
- private int startMillisecond;
- private boolean isStretch;
- private boolean isPause;
-
- /**
- * constructor of Builder
- *
- * @param context context
- */
- public Builder(Context context) {
- mContext = context;
- filePath = "";
- startMillisecond = 0;
- }
-
- /**
- * setFilePath of Builder
- *
- * @param filePath filePath
- * @return builder
- */
- public Builder setFilePath(String filePath) {
- this.filePath = filePath;
- return this;
- }
-
- /**
- * getFilePath of Builder
- *
- * @return filePath
- */
- public String getFilePath() {
- return filePath;
- }
-
- /**
- * setStartMillisecond of Builder
- *
- * @param startMillisecond startMillisecond
- * @return builder
- */
- public Builder setStartMillisecond(int startMillisecond) {
- this.startMillisecond = startMillisecond;
- return this;
- }
-
- /**
- * getStartMillisecond of Builder
- *
- * @return startMillisecond
- */
- public int getStartMillisecond() {
- return startMillisecond;
- }
-
- /**
- * setStretch of Builder
- *
- * @param isS isStretch
- * @return Builder
- */
- public Builder setStretch(boolean isS) {
- this.isStretch = isS;
- return this;
- }
-
- /**
- * setPause of Builder
- *
- * @param isP isPause
- * @return Builder
- */
- public Builder setPause(boolean isP) {
- this.isPause = isP;
- return this;
- }
-
- /**
- * create of Builder
- *
- * @return IPlayer
- */
- public ImplHmPlayer create() {
- return new HmPlayer(this);
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/HmPlayModuler.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/HmPlayModuler.java
deleted file mode 100644
index b019323005100927bf5f5d6ef892c390579d14d3..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/HmPlayModuler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.api;
-
-/**
- * IPlayModuler
- *
- * @since 2021-04-09
- *
- */
-public interface HmPlayModuler {
- /**
- * bind
- *
- * @param player player
- */
- void bind(ImplHmPlayer player);
-
- /**
- * unbind
- *
- */
- void unbind();
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplHmPlayer.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplHmPlayer.java
deleted file mode 100644
index 832f4bc427d0d31fcaee8b5ef7e0e458a83985d2..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplHmPlayer.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.api;
-
-import com.huawei.harmonyaudiodemo.player.HmPlayer;
-import com.huawei.harmonyaudiodemo.player.constant.PlayerStatu;
-
-import ohos.agp.graphics.Surface;
-
-/**
- * IPlayer interface
- *
- * @since 2021-04-04
- */
-public interface ImplHmPlayer {
- /**
- * addSurface
- *
- * @param surface surface
- */
- void addSurface(Surface surface);
-
- /**
- * addPlayerStatuCallback
- *
- * @param callback callback
- */
- void addPlayerStatuCallback(StatuChangeListener callback);
-
- /**
- * removePlayerStatuCallback
- *
- * @param callback callback
- */
- void removePlayerStatuCallback(StatuChangeListener callback);
-
- /**
- * addPlayerViewCallback
- *
- * @param callback callback
- */
- void addPlayerViewCallback(ScreenChangeListener callback);
-
- /**
- * removePlayerViewCallback
- *
- * @param callback callback
- */
- void removePlayerViewCallback(ScreenChangeListener callback);
-
- /**
- * play
- */
- void play();
-
- /**
- * replay
- */
- void replay();
-
- /**
- * reload
- *
- * @param filepath filepath
- * @param startMillisecond startMillisecond
- */
- void reload(String filepath, int startMillisecond);
-
- /**
- * resume
- */
- void resume();
-
- /**
- * pause
- */
- void pause();
-
- /**
- * getCurrentPosition
- *
- * @return current position
- */
- int getCurrentPosition();
-
- /**
- * getDuration
- *
- * @return duration
- */
- int getDuration();
-
- /**
- * getVolume
- *
- * @return float
- */
- float getVolume();
-
- /**
- * set play volume
- *
- * @param volume 0~1
- */
- void setVolume(float volume);
-
- /**
- * set play speed
- *
- * @param speed 0~12
- */
- void setPlaySpeed(float speed);
-
- /**
- * getVideoScale
- *
- * @return double
- */
- double getVideoScale();
-
- /**
- * rewindTo
- *
- * @param startMicrosecond startMicrosecond(ms)
- */
- void rewindTo(int startMicrosecond);
-
- /**
- * isPlaying
- *
- * @return isPlaying
- */
- boolean isPlaying();
-
- /**
- * stop
- */
- void stop();
-
- /**
- * release
- */
- void release();
-
- /**
- * getLifecycle
- *
- * @return ImplLifecycle
- */
- ImplLifecycle getLifecycle();
-
- /**
- * getBuilder
- *
- * @return Builder
- */
- HmPlayer.Builder getBuilder();
-
- /**
- * getPlayerStatu
- *
- * @return PlayerStatu
- */
- PlayerStatu getPlayerStatu();
-
- /**
- * resizeScreen
- *
- * @param width width
- * @param height height
- */
- void resizeScreen(int width, int height);
-
- /**
- * openGesture
- *
- * @param isOpen isOpen
- */
- void gestureSwitch(boolean isOpen);
-
- /**
- * openGesture
- *
- * @return isGestureOpen
- */
- boolean isGestureOpen();
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplLifecycle.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplLifecycle.java
deleted file mode 100644
index 709f0bd45da46d51f5c59fd31480926753353630..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ImplLifecycle.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.api;
-
-/**
- * ImplLifecycle
- *
- * @since 2021-04-09
- *
- */
-public interface ImplLifecycle {
- /**
- * onStart
- *
- */
- void onStart();
-
- /**
- * onForeground
- *
- */
- void onForeground();
-
- /**
- * onBackground
- *
- */
- void onBackground();
-
- /**
- * onStop
- *
- */
- void onStop();
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ScreenChangeListener.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ScreenChangeListener.java
deleted file mode 100644
index 5da18584ecabf6d633f139002a35e470f39ed521..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/ScreenChangeListener.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.api;
-
-/**
- * ScreenChangeListener interface
- *
- * @since 2021-04-04
- *
- */
-public interface ScreenChangeListener {
- /**
- * screenCallback
- *
- * @param width width
- * @param height height
- */
- void screenCallback(int width, int height);
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/StatuChangeListener.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/StatuChangeListener.java
deleted file mode 100644
index 9ee167fc4ef0c3818a9a7d6c593c6b3be4758686..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/api/StatuChangeListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.api;
-
-import com.huawei.harmonyaudiodemo.player.constant.PlayerStatu;
-
-/**
- * StatuChangeListener interface
- *
- * @since 2021-04-04
- *
- */
-public interface StatuChangeListener {
- /**
- * statuCallback
- *
- * @param statu statu
- */
- void statuCallback(PlayerStatu statu);
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/Constants.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/Constants.java
deleted file mode 100644
index 6545705d03aa217639657b49084cba98fd910949..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/Constants.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.constant;
-
-/**
- * Constants
- *
- * @since 2021-04-04
- */
-public class Constants {
- /**
- * running
- */
- public static final int PLAYER_PROGRESS_RUNNING = 0;
- /**
- * hide
- */
- public static final int PLAYER_CONTROLLER_HIDE = 1;
- /**
- * hide
- */
- public static final int PLAYER_CONTROLLER_SHOW = 2;
- /**
- * 100
- */
- public static final int ONE_HUNDRED_PERCENT = 100;
- /**
- * rewind step
- */
- public static final int REWIND_STEP = 5000;
- /**
- * volume step
- */
- public static final int VOLUME_STEP = 5;
- /**
- * INTENT STARTTIME PARAM
- */
- public static final String INTENT_STARTTIME_PARAM = "intetn_starttime_param";
- /**
- * INTENT PLAYURL PARAM
- */
- public static final String INTENT_PLAYURL_PARAM = "intetn_playurl_param";
- /**
- * INTENT PLAYSTATU PARAM
- */
- public static final String INTENT_PLAYSTATU_PARAM = "intetn_playstatu_param";
- /**
- * INTENT LANDSCREEN REQUEST CODE
- */
- public static final int INTENT_LANDSCREEN_REQUEST_CODE = 1001;
-
- private Constants() {
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/PlayerStatu.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/PlayerStatu.java
deleted file mode 100644
index 55dd7eae74793b8527c046362b697d915bd63a1f..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/constant/PlayerStatu.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.constant;
-
-/**
- * PlayerStatu enum
- *
- * @since 2021-04-04
- *
- */
-public enum PlayerStatu {
- /**
- * idel
- *
- */
- IDEL,
- /**
- * preparing
- *
- */
- PREPARING,
- /**
- * prepared
- *
- */
- PREPARED,
- /**
- * play
- *
- */
- PLAY,
- /**
- * pause
- *
- */
- PAUSE,
- /**
- * stop
- *
- */
- STOP,
- /**
- * complete
- *
- */
- COMPLETE,
- /**
- * error
- *
- */
- ERROR,
- /**
- * buffering
- *
- */
- BUFFERING
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/factory/SourceFactory.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/factory/SourceFactory.java
deleted file mode 100644
index 22597d7b0b96de58133d4ebe60bacfc6b7d30a43..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/factory/SourceFactory.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.factory;
-
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.app.Context;
-import ohos.global.resource.RawFileDescriptor;
-import ohos.media.common.Source;
-
-import java.io.File;
-import java.io.FileDescriptor;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * SourceFactory
- *
- * @since 2021-04-04
- *
- */
-public class SourceFactory {
- private static final String TAG = "SourceFactory";
- private static final String NET_HTTP_MATCH = "http";
- private static final String NET_RTMP_MATCH = "rtmp";
- private static final String NET_RTSP_MATCH = "rtsp";
- private static final String STORAGE_MATCH = "/storage/";
-
- private Source mPlayerSource;
-
- /**
- * constructor of SourceFactory
- *
- * @param context context
- * @param path path
- */
- public SourceFactory(Context context, String path) {
- try {
- initSourceType(context, path);
- } catch (IOException e) {
- LogUtil.error(TAG, "Audio resource is unavailable: ");
- }
- }
-
- private void initSourceType(Context context, String path) throws IOException {
- if (context == null || path == null) {
- return;
- }
- if (path.substring(0, NET_HTTP_MATCH.length()).equalsIgnoreCase(NET_HTTP_MATCH)
- || path.substring(0, NET_RTMP_MATCH.length()).equalsIgnoreCase(NET_RTMP_MATCH)
- || path.substring(0, NET_RTSP_MATCH.length()).equalsIgnoreCase(NET_RTSP_MATCH)) {
- mPlayerSource = new Source(path);
- } else if (path.startsWith(STORAGE_MATCH)) {
- File file = new File(path);
- if (file.exists()) {
- FileInputStream fileInputStream = new FileInputStream(file);
- FileDescriptor fileDescriptor = fileInputStream.getFD();
- mPlayerSource = new Source(fileDescriptor);
- }
- } else {
- RawFileDescriptor fd = context.getResourceManager().getRawFileEntry(path).openRawFileDescriptor();
- mPlayerSource = new Source(fd.getFileDescriptor(), fd.getStartPosition(), fd.getFileSize());
- }
- }
-
- /**
- * getSource
- *
- * @return Source Source
- */
- public Source getSource() {
- return mPlayerSource;
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/manager/HmPlayerLifecycle.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/manager/HmPlayerLifecycle.java
deleted file mode 100644
index 273021ca3cf00ab53bd58d9df05d8b8733c52067..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/manager/HmPlayerLifecycle.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.manager;
-
-import com.huawei.harmonyaudiodemo.player.api.ImplHmPlayer;
-import com.huawei.harmonyaudiodemo.player.api.ImplLifecycle;
-import com.huawei.harmonyaudiodemo.player.constant.PlayerStatu;
-
-/**
- * HmPlayerLifecycle
- *
- * @since 2021-04-09
- *
- */
-public class HmPlayerLifecycle implements ImplLifecycle {
- private static final String TAG = HmPlayerLifecycle.class.getSimpleName();
- private ImplHmPlayer mPlayer;
-
- /**
- * HmPlayerLifecycle
- *
- * @param player player
- */
- public HmPlayerLifecycle(ImplHmPlayer player) {
- mPlayer = player;
- }
-
- @Override
- public void onStart() {
- }
-
- @Override
- public void onForeground() {
- String url = mPlayer.getBuilder().getFilePath();
- int startMillisecond = mPlayer.getBuilder().getStartMillisecond();
- mPlayer.reload(url, startMillisecond);
- }
-
- @Override
- public void onBackground() {
- mPlayer.getBuilder().setPause(mPlayer.getPlayerStatu() == PlayerStatu.PAUSE);
- mPlayer.getBuilder().setStartMillisecond(mPlayer.getCurrentPosition());
- mPlayer.release();
- }
-
- @Override
- public void onStop() {
- mPlayer.release();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/util/DateUtils.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/util/DateUtils.java
deleted file mode 100644
index f616b3565af0c8fd530a68ed0c552a308d3a62ae..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/util/DateUtils.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.util;
-
-import java.util.Locale;
-
-/**
- * Date util
- *
- * @since 2021-04-04
- */
-public class DateUtils {
- private static final int ONE_SECONDS_MS = 1000;
- private static final int ONE_MINS_MINUTES = 60;
- private static final int NUMBER = 16;
- private static final String TIME_FORMAT = "%02d";
- private static final String SEMICOLON = ":";
-
- private DateUtils() {
- }
-
- /**
- * conversion of msToString
- *
- * @param ms ms
- * @return string
- */
- public static String msToString(int ms) {
- StringBuilder sb = new StringBuilder(NUMBER);
- int seconds = ms / ONE_SECONDS_MS;
- int minutes = seconds / ONE_MINS_MINUTES;
- if (minutes > ONE_MINS_MINUTES) {
- sb.append(String.format(Locale.ENGLISH, TIME_FORMAT, minutes / ONE_MINS_MINUTES));
- sb.append(SEMICOLON);
- sb.append(String.format(Locale.ENGLISH, TIME_FORMAT, minutes % ONE_MINS_MINUTES));
- sb.append(SEMICOLON);
- } else {
- sb.append("00:");
- sb.append(String.format(Locale.ENGLISH, TIME_FORMAT, minutes));
- sb.append(SEMICOLON);
- }
-
- if (seconds > minutes * ONE_MINS_MINUTES) {
- sb.append(String.format(Locale.ENGLISH, TIME_FORMAT, seconds - minutes * ONE_MINS_MINUTES));
- } else {
- sb.append("00");
- }
- return sb.toString();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/PlayerLoading.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/PlayerLoading.java
deleted file mode 100644
index 71033b6c890195b584e1b92efb868510f5922ce7..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/PlayerLoading.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.view;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.player.api.HmPlayModuler;
-import com.huawei.harmonyaudiodemo.player.api.ImplHmPlayer;
-
-import ohos.agp.animation.AnimatorProperty;
-import ohos.agp.components.AttrSet;
-import ohos.agp.components.Component;
-import ohos.agp.components.Component.TouchEventListener;
-import ohos.agp.components.ComponentContainer;
-import ohos.agp.components.Image;
-import ohos.agp.components.LayoutScatter;
-import ohos.app.Context;
-import ohos.multimodalinput.event.TouchEvent;
-
-/**
- * PlayerLoading
- *
- * @since 2021-04-04
- */
-public class PlayerLoading extends ComponentContainer implements HmPlayModuler, TouchEventListener {
- private static final int HALF_NUMBER = 2;
- private static final int ANIM_ROTATE = 360;
- private static final int ANIM_DURATION = 2000;
- private static final int ANIM_LOOPED_COUNT = -1;
- private ImplHmPlayer mPlayer;
- private Image mLoading;
- private AnimatorProperty mLoadingAnim;
-
- /**
- * constructor of PlayerLoading
- *
- * @param context context
- */
- public PlayerLoading(Context context) {
- this(context, null);
- }
-
- /**
- * constructor of PlayerLoading
- *
- * @param context context
- * @param attrSet attSet
- */
- public PlayerLoading(Context context, AttrSet attrSet) {
- this(context, attrSet, null);
- }
-
- /**
- * constructor of PlayerLoading
- *
- * @param context context
- * @param attrSet attSet
- * @param styleName styleName
- */
- public PlayerLoading(Context context, AttrSet attrSet, String styleName) {
- super(context, attrSet, styleName);
- initView(context);
- }
-
- private void initView(Context context) {
- Component loadingContainer =
- LayoutScatter.getInstance(context).parse(ResourceTable.Layout_player_loading_layout, null, false);
- if (loadingContainer.findComponentById(ResourceTable.Id_image_loading) instanceof Image) {
- mLoading = (Image) loadingContainer.findComponentById(ResourceTable.Id_image_loading);
- initAnim();
- }
- addComponent(loadingContainer);
- hide();
- setTouchEventListener(this);
- }
-
- private void initAnim() {
- int with = mLoading.getWidth() / HALF_NUMBER;
- int height = mLoading.getHeight() / HALF_NUMBER;
- mLoading.setPivotX(with);
- mLoading.setPivotY(height);
- mLoadingAnim = mLoading.createAnimatorProperty();
- mLoadingAnim.rotate(ANIM_ROTATE).setDuration(ANIM_DURATION).setLoopedCount(ANIM_LOOPED_COUNT);
- }
-
- private void initListener() {
- mPlayer.addPlayerStatuCallback(statu -> mContext.getUITaskDispatcher().asyncDispatch(() -> {
- switch (statu) {
- case PREPARING:
- case BUFFERING:
- show();
- break;
- case PLAY:
- hide();
- break;
- default:
- break;
- }
- }));
- }
-
- /**
- * show of PlayerLoading
- */
- public void show() {
- if (mLoadingAnim.isPaused()) {
- mLoadingAnim.resume();
- } else {
- mLoadingAnim.start();
- }
- setVisibility(VISIBLE);
- }
-
- /**
- * hide of PlayerLoading
- */
- public void hide() {
- setVisibility(INVISIBLE);
- mLoadingAnim.pause();
- }
-
- @Override
- public void bind(ImplHmPlayer player) {
- mPlayer = player;
- initListener();
- }
-
- @Override
- public void unbind() {
- mLoadingAnim.release();
- }
-
- @Override
- public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
- return true;
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/SimplePlayerController.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/SimplePlayerController.java
deleted file mode 100644
index 3a066f32f6029ee18877c8d2c3bdde0df0637cf2..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/player/view/SimplePlayerController.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.player.view;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.player.api.HmPlayModuler;
-import com.huawei.harmonyaudiodemo.player.api.ImplHmPlayer;
-import com.huawei.harmonyaudiodemo.player.api.StatuChangeListener;
-import com.huawei.harmonyaudiodemo.player.constant.Constants;
-import com.huawei.harmonyaudiodemo.player.constant.PlayerStatu;
-import com.huawei.harmonyaudiodemo.player.util.DateUtils;
-
-import ohos.agp.colors.RgbColor;
-import ohos.agp.components.AttrSet;
-import ohos.agp.components.Component;
-import ohos.agp.components.ComponentContainer;
-import ohos.agp.components.DependentLayout;
-import ohos.agp.components.DirectionalLayout;
-import ohos.agp.components.Image;
-import ohos.agp.components.LayoutScatter;
-import ohos.agp.components.Slider;
-import ohos.agp.components.Text;
-import ohos.agp.components.element.ShapeElement;
-import ohos.app.Context;
-import ohos.eventhandler.EventHandler;
-import ohos.eventhandler.EventRunner;
-import ohos.eventhandler.InnerEvent;
-
-/**
- * PlayerController
- *
- * @since 2021-04-04
- */
-public class SimplePlayerController extends ComponentContainer implements HmPlayModuler {
- private static final int THUMB_RED = 255;
- private static final int THUMB_GREEN = 255;
- private static final int THUMB_BLUE = 240;
- private static final int THUMB_WIDTH = 40;
- private static final int THUMB_HEIGHT = 40;
- private static final int THUMB_RADIUS = 20;
- private static final int CONTROLLER_HIDE_DLEY_TIME = 5000;
- private static final int PROGRESS_RUNNING_TIME = 1000;
- private boolean mIsDragMode = false;
- private Context mContext;
- private ImplHmPlayer mPlayer;
- private DependentLayout topLayout;
- private DirectionalLayout bottomLayout;
- private Image mBack;
- private Image mPlayToogle;
- private Image mForward;
- private Image mBackward;
- private Slider mProgressBar;
- private Text mCurrentTime;
- private Text mTotleTime;
- private ControllerHandler mHandler;
- private StatuChangeListener mStatuChangeListener = new StatuChangeListener() {
- @Override
- public void statuCallback(PlayerStatu statu) {
- mContext.getUITaskDispatcher().asyncDispatch(() -> {
- switch (statu) {
- case PREPARING:
- mPlayToogle.setClickable(false);
- mProgressBar.setEnabled(false);
- mProgressBar.setProgressValue(0);
- break;
- case PREPARED:
- mProgressBar.setMaxValue(mPlayer.getDuration());
- mTotleTime.setText(DateUtils.msToString(mPlayer.getDuration()));
- break;
- case PLAY:
- showController(false);
- mPlayToogle.setPixelMap(ResourceTable.Media_ic_music_stop);
- mPlayToogle.setClickable(true);
- mProgressBar.setEnabled(true);
- break;
- case PAUSE:
- mPlayToogle.setPixelMap(ResourceTable.Media_ic_music_play);
- break;
- case STOP:
- case COMPLETE:
- mPlayToogle.setPixelMap(ResourceTable.Media_ic_update);
- mProgressBar.setEnabled(false);
- break;
- default:
- break;
- }
- });
- }
- };
-
- /**
- * constructor of SimplePlayerController
- *
- * @param context context
- */
- public SimplePlayerController(Context context) {
- this(context, null);
- }
-
- /**
- * constructor of SimplePlayerController
- *
- * @param context context
- * @param attrSet attSet
- */
- public SimplePlayerController(Context context, AttrSet attrSet) {
- this(context, attrSet, null);
- }
-
- /**
- * constructor of SimplePlayerController
- *
- * @param context context
- * @param attrSet attSet
- * @param styleName styleName
- */
- public SimplePlayerController(Context context, AttrSet attrSet, String styleName) {
- super(context, attrSet, styleName);
- mContext = context;
- createHandler();
- initView();
- initListener();
- }
-
- private void createHandler() {
- EventRunner runner = EventRunner.create(true);
- if (runner == null) {
- return;
- }
- mHandler = new ControllerHandler(runner);
- }
-
- private void initView() {
- Component playerController =
- LayoutScatter.getInstance(mContext)
- .parse(ResourceTable.Layout_simple_player_controller_layout, null, false);
- addComponent(playerController);
- if (playerController.findComponentById(ResourceTable.Id_controller_top_layout) instanceof DependentLayout) {
- topLayout = (DependentLayout) playerController.findComponentById(ResourceTable.Id_controller_top_layout);
- }
- if (playerController.findComponentById(ResourceTable.Id_controller_bottom_layout)
- instanceof DirectionalLayout) {
- bottomLayout = (DirectionalLayout) playerController
- .findComponentById(ResourceTable.Id_controller_bottom_layout);
- }
- if (playerController.findComponentById(ResourceTable.Id_back) instanceof Image) {
- mBack = (Image) playerController.findComponentById(ResourceTable.Id_back);
- }
- if (playerController.findComponentById(ResourceTable.Id_play_controller) instanceof Image) {
- mPlayToogle = (Image) playerController.findComponentById(ResourceTable.Id_play_controller);
- }
- if (playerController.findComponentById(ResourceTable.Id_play_forward) instanceof Image) {
- mForward = (Image) playerController.findComponentById(ResourceTable.Id_play_forward);
- }
- if (playerController.findComponentById(ResourceTable.Id_play_backward) instanceof Image) {
- mBackward = (Image) playerController.findComponentById(ResourceTable.Id_play_backward);
- }
- if (playerController.findComponentById(ResourceTable.Id_progress) instanceof Slider) {
- mProgressBar = (Slider) playerController.findComponentById(ResourceTable.Id_progress);
- }
- ShapeElement shapeElement = new ShapeElement();
- shapeElement.setRgbColor(new RgbColor(THUMB_RED, THUMB_GREEN, THUMB_BLUE));
- shapeElement.setBounds(0, 0, THUMB_WIDTH, THUMB_HEIGHT);
- shapeElement.setCornerRadius(THUMB_RADIUS);
- mProgressBar.setThumbElement(shapeElement);
- if (playerController.findComponentById(ResourceTable.Id_current_time) instanceof Text) {
- mCurrentTime = (Text) playerController.findComponentById(ResourceTable.Id_current_time);
- }
- if (playerController.findComponentById(ResourceTable.Id_end_time) instanceof Text) {
- mTotleTime = (Text) playerController.findComponentById(ResourceTable.Id_end_time);
- }
- }
-
- private void initListener() {
- topLayout.setTouchEventListener((component, touchEvent) -> true);
- bottomLayout.setTouchEventListener((component, touchEvent) -> true);
- mBack.setClickedListener(component -> mContext.terminateAbility());
- }
-
- private void initPlayListener() {
- mPlayer.addPlayerStatuCallback(mStatuChangeListener);
- mPlayToogle.setClickedListener(component -> {
- if (mPlayer.isPlaying()) {
- mPlayer.pause();
- } else {
- if (mPlayer.getPlayerStatu() == PlayerStatu.STOP) {
- mPlayer.replay();
- } else {
- mPlayer.resume();
- }
- }
- });
- mForward.setClickedListener(component ->
- mPlayer.rewindTo(mPlayer.getCurrentPosition() + Constants.REWIND_STEP));
- mBackward.setClickedListener(component ->
- mPlayer.rewindTo(mPlayer.getCurrentPosition() - Constants.REWIND_STEP));
- mProgressBar.setValueChangedListener(
- new Slider.ValueChangedListener() {
- @Override
- public void onProgressUpdated(Slider slider, int value, boolean isB) {
- mContext.getUITaskDispatcher().asyncDispatch(() ->
- mCurrentTime.setText(DateUtils.msToString(value)));
- }
-
- @Override
- public void onTouchStart(Slider slider) {
- mIsDragMode = true;
- mHandler.removeEvent(Constants.PLAYER_PROGRESS_RUNNING, EventHandler.Priority.IMMEDIATE);
- }
-
- @Override
- public void onTouchEnd(Slider slider) {
- mIsDragMode = false;
- if (slider.getProgress() == mPlayer.getDuration()) {
- mPlayer.stop();
- } else {
- mPlayer.rewindTo(slider.getProgress());
- }
- }
- });
- }
-
- /**
- * showController of PlayerController
- *
- * @param isAutoHide isAutoHide
- */
- public void showController(boolean isAutoHide) {
- mHandler.sendEvent(Constants.PLAYER_CONTROLLER_SHOW, EventHandler.Priority.HIGH);
- if (isAutoHide) {
- hideController(CONTROLLER_HIDE_DLEY_TIME);
- } else {
- mHandler.removeEvent(Constants.PLAYER_CONTROLLER_HIDE);
- }
- }
-
- /**
- * hideController of PlayerController
- *
- * @param delay delay
- */
- public void hideController(int delay) {
- mHandler.removeEvent(Constants.PLAYER_CONTROLLER_HIDE);
- mHandler.sendEvent(Constants.PLAYER_CONTROLLER_HIDE, delay, EventHandler.Priority.HIGH);
- }
-
- @Override
- public void bind(ImplHmPlayer player) {
- mPlayer = player;
- initPlayListener();
- }
-
- @Override
- public void unbind() {
- mHandler.removeAllEvent();
- mHandler = null;
- }
-
- /**
- * ControllerHandler
- *
- * @author chenweiquan
- * @since 2020-12-04
- */
- private class ControllerHandler extends EventHandler {
- private ControllerHandler(EventRunner runner) {
- super(runner);
- }
-
- @Override
- public void processEvent(InnerEvent event) {
- super.processEvent(event);
- if (event == null) {
- return;
- }
- switch (event.eventId) {
- case Constants.PLAYER_PROGRESS_RUNNING:
- if (mPlayer != null && mPlayer.isPlaying() && !mIsDragMode) {
- mContext.getUITaskDispatcher().asyncDispatch(() -> {
- mProgressBar.setProgressValue(mPlayer.getCurrentPosition());
- mCurrentTime.setText(DateUtils.msToString(mPlayer.getCurrentPosition()));
- });
- mHandler.sendEvent(
- Constants.PLAYER_PROGRESS_RUNNING, PROGRESS_RUNNING_TIME, Priority.IMMEDIATE);
- }
- break;
- case Constants.PLAYER_CONTROLLER_HIDE:
- mContext.getUITaskDispatcher().asyncDispatch(() -> setVisibility(INVISIBLE));
- mHandler.removeEvent(Constants.PLAYER_PROGRESS_RUNNING);
- break;
- case Constants.PLAYER_CONTROLLER_SHOW:
- mHandler.removeEvent(Constants.PLAYER_PROGRESS_RUNNING);
- mHandler.sendEvent(Constants.PLAYER_PROGRESS_RUNNING, Priority.IMMEDIATE);
- mContext.getUITaskDispatcher().asyncDispatch(() -> setVisibility(VISIBLE));
- break;
- default:
- break;
- }
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MainAbilitySlice.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MainAbilitySlice.java
deleted file mode 100644
index 9df0bbeafeebc8b220c22dec657b313d3f5eac1a..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MainAbilitySlice.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.slice;
-
-import com.huawei.harmonyaudiodemo.MainAbility;
-import com.huawei.harmonyaudiodemo.ResourceTable;
-
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.content.Intent;
-import ohos.aafwk.content.Operation;
-import ohos.agp.components.Component;
-
-/**
- * MainAbilitySlice
- *
- * @since 2021-04-04
- */
-public class MainAbilitySlice extends AbilitySlice implements Component.ClickedListener {
- @Override
- protected void onStart(Intent intent) {
- super.onStart(intent);
- setUIContent(ResourceTable.Layout_ability_main);
- initView();
- }
-
- @Override
- protected void onStop() {
- super.onStop();
- }
-
- private void initView() {
- findComponentById(ResourceTable.Id_sound_music_play_btn).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound_system_play_btn).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound_record_btn).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound_volume_btn).setClickedListener(this);
- }
-
- @Override
- public void onClick(Component view) {
- Intent intent = new Intent();
- String actionName = "";
- switch (view.getId()) {
- case ResourceTable.Id_sound_music_play_btn:
- actionName = "action.sound.play.music";
- break;
- case ResourceTable.Id_sound_system_play_btn:
- actionName = "action.sound.play.system";
- break;
- case ResourceTable.Id_sound_record_btn:
- actionName = "action.sound.record";
- break;
- case ResourceTable.Id_sound_volume_btn:
- actionName = "action.sound.volume";
- break;
- default:
- break;
- }
- Operation operation =
- new Intent.OperationBuilder()
- .withBundleName(getBundleName())
- .withAbilityName(MainAbility.class.getName())
- .withAction(actionName)
- .build();
- intent.setOperation(operation);
- startAbility(intent);
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MusicPlayerAbilitySlice.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MusicPlayerAbilitySlice.java
deleted file mode 100644
index 388e039b32a556a6db484d3a588534dda736d0e8..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/MusicPlayerAbilitySlice.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.slice;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.constant.Const;
-import com.huawei.harmonyaudiodemo.player.HmPlayer;
-import com.huawei.harmonyaudiodemo.player.api.ImplHmPlayer;
-import com.huawei.harmonyaudiodemo.player.view.PlayerLoading;
-import com.huawei.harmonyaudiodemo.player.view.SimplePlayerController;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.content.Intent;
-import ohos.app.dispatcher.task.TaskPriority;
-import ohos.global.resource.NotExistException;
-import ohos.global.resource.WrongTypeException;
-
-import java.io.IOException;
-
-/**
- * SimplePlayerAbilitySlice
- *
- * @since 2021-04-04
- */
-public class MusicPlayerAbilitySlice extends AbilitySlice {
- private static final String TAG = MusicPlayerAbilitySlice.class.getSimpleName();
- private ImplHmPlayer player;
- private PlayerLoading playerLoading;
- private SimplePlayerController controllerView;
-
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- super.setUIContent(ResourceTable.Layout_ability_music_player);
- try {
- String mUrl = getResourceManager().getMediaPath(ResourceTable.Media_test);
- player = new HmPlayer.Builder(this)
- .setFilePath(mUrl)
- .create();
- initView();
- getGlobalTaskDispatcher(TaskPriority.DEFAULT).delayDispatch(() -> player.play(), Const.NUMBER_100);
- } catch (IOException | NotExistException | WrongTypeException e) {
- LogUtil.error(TAG, "get media path failed!");
- }
- }
-
- private void initView() {
- if (findComponentById(ResourceTable.Id_loadint_view) instanceof PlayerLoading) {
- playerLoading = (PlayerLoading) findComponentById(ResourceTable.Id_loadint_view);
- }
- if (findComponentById(ResourceTable.Id_controller_view) instanceof SimplePlayerController) {
- controllerView = (SimplePlayerController) findComponentById(ResourceTable.Id_controller_view);
- }
- playerLoading.bind(player);
- controllerView.bind(player);
- }
-
- @Override
- public void onActive() {
- super.onActive();
- }
-
- @Override
- protected void onInactive() {
- LogUtil.info(TAG, "onInactive is called");
- super.onInactive();
- }
-
- @Override
- public void onForeground(Intent intent) {
- player.getLifecycle().onForeground();
- super.onForeground(intent);
- }
-
- @Override
- protected void onBackground() {
- LogUtil.info(TAG, "onBackground is called");
- player.getLifecycle().onBackground();
- super.onBackground();
- }
-
- @Override
- protected void onStop() {
- LogUtil.info(TAG, "onStop is called");
- playerLoading.unbind();
- controllerView.unbind();
- super.onStop();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundRecordSlice.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundRecordSlice.java
deleted file mode 100644
index c1362e975ac187f3188c855d46889daa5ffa0931..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundRecordSlice.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.slice;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.constant.Const;
-import com.huawei.harmonyaudiodemo.media.AudioRecorder;
-import com.huawei.harmonyaudiodemo.media.AudioRender;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.content.Intent;
-import ohos.agp.components.Button;
-import ohos.agp.components.Component;
-import ohos.agp.components.LayoutScatter;
-import ohos.agp.components.RoundProgressBar;
-import ohos.agp.components.SlideDrawer;
-import ohos.agp.components.Switch;
-import ohos.agp.components.element.FrameAnimationElement;
-import ohos.app.Environment;
-import ohos.multimodalinput.event.TouchEvent;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * SoundRecordSlice
- *
- * @since 2021-04-04
- */
-public class SoundRecordSlice extends AbilitySlice {
- private static final String TAG = SoundRecordSlice.class.getSimpleName();
- private FrameAnimationElement frameAnimationElement;
- private RoundProgressBar recordProgressBar;
- private Button recordButton;
- private SlideDrawer slideDrawer;
- private Component playAnimView;
- private AudioRecorder audioRecorder;
- private AudioRender recordWithPlayRender;
- private AudioRender oneOffLoadRender;
- private boolean isRealTimePlay;
- private String savefilePath;
- private int recordTag;
-
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- super.setUIContent(ResourceTable.Layout_media_sound_audio);
- initAnimation();
- initView();
- initListener();
- initRecorder();
- setupRecordWithPlayRender();
- setupOneOffLoadRender();
- }
-
- private void initAnimation() {
- frameAnimationElement = new FrameAnimationElement(getContext(), ResourceTable.Graphic_animation_record_play);
- }
-
- private void initView() {
- if (findComponentById(ResourceTable.Id_real_time_switch) instanceof Switch) {
- Switch realTimeSwitch = (Switch) findComponentById(ResourceTable.Id_real_time_switch);
- realTimeSwitch.setCheckedStateChangedListener((absButton, bool) -> {
- isRealTimePlay = bool;
- if (isRealTimePlay) {
- slideDrawer.closeSmoothly();
- oneOffLoadRender.stop();
- }
- });
- }
- initRecordView();
- initPlayView();
- }
-
- private void initListener() {
- recordButton.setTouchEventListener(new Component.TouchEventListener() {
- private int progress = 0;
-
- @Override
- public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
- if (touchEvent.getAction() == TouchEvent.PRIMARY_POINT_DOWN
- || touchEvent.getAction() == TouchEvent.OTHER_POINT_DOWN) {
- progress = 0;
- oneOffLoadRender.stop();
- recordWithPlayRender.stop();
- }
- int action = progress >= Const.NUMBER_500 ? TouchEvent.CANCEL : touchEvent.getAction();
- recordButton.setPressState(true);
- switch (action) {
- case TouchEvent.PRIMARY_POINT_UP:
- case TouchEvent.OTHER_POINT_UP:
- case TouchEvent.CANCEL:
- recordButton.setPressState(false);
- recordProgressBar.setProgressValue(0);
- shutdownRecord();
- return false;
- default:
- progress++;
- beginRecord();
- break;
- }
- recordProgressBar.setProgressValue(progress);
- return true;
- }
- });
- }
-
- private void initRecordView() {
- if (findComponentById(ResourceTable.Id_progressbar_record) instanceof RoundProgressBar) {
- recordProgressBar = (RoundProgressBar) findComponentById(ResourceTable.Id_progressbar_record);
- }
- if (findComponentById(ResourceTable.Id_button_record) instanceof Button) {
- recordButton = (Button) findComponentById(ResourceTable.Id_button_record);
- }
- recordProgressBar.setMaxValue(Const.NUMBER_500);
- }
-
- private void initPlayView() {
- if (findComponentById(ResourceTable.Id_slide_drawer_record) instanceof SlideDrawer) {
- slideDrawer = (SlideDrawer) findComponentById(ResourceTable.Id_slide_drawer_record);
- }
- slideDrawer.setDisplayMode(SlideDrawer.DisplayMode.WITH_ANIMATION);
- slideDrawer.setSlideEnabled(false);
- slideDrawer.setTouchForClose(false);
- Component playButton = LayoutScatter
- .getInstance(this)
- .parse(ResourceTable.Layout_record_play_button, null, false);
- playAnimView = playButton.findComponentById(ResourceTable.Id_animation_view);
- playAnimView.setBackground(frameAnimationElement);
- SlideDrawer.LayoutConfig layoutConfig = new SlideDrawer
- .LayoutConfig(Const.NUMBER_300, Const.NUMBER_114, SlideDrawer.SlideDirection.START);
- layoutConfig.setMarginsLeftAndRight(Const.NUMBER_60, 0);
- playButton.setLayoutConfig(layoutConfig);
- slideDrawer.addComponent(playButton);
- playButton.setClickedListener(component -> {
- oneOffLoadRender.stop();
- getUITaskDispatcher().asyncDispatch(() -> playAnimView.setVisibility(Component.VISIBLE));
- frameAnimationElement.start();
- playLocalAudioFile();
- });
- }
-
- private void initRecorder() {
- savefilePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC) + File.separator + "AudioTest.mp3";
- audioRecorder = new AudioRecorder.Builder().setSaveFilePath(savefilePath).create();
- }
-
- private void setupRecordWithPlayRender() {
- recordWithPlayRender = new AudioRender.Builder().setOneOffLoad(false).create();
- audioRecorder.setAudioRecordListener((buffer, length) -> {
- if (recordTag == 0) {
- recordWithPlayRender.play(buffer, length);
- }
- });
- }
-
- private void setupOneOffLoadRender() {
- oneOffLoadRender = new AudioRender.Builder().create();
- oneOffLoadRender.setPlayListener(() -> {
- frameAnimationElement.stop();
- getUITaskDispatcher().asyncDispatch(() -> playAnimView.setVisibility(Component.INVISIBLE));
- });
- }
-
- private void shutdownRecord() {
- if (audioRecorder.isRecording()) {
- audioRecorder.stopRecord();
- }
- if (!isRealTimePlay) {
- slideDrawer.openSmoothly();
- }
- }
-
- private void beginRecord() {
- if (!audioRecorder.isRecording()) {
- recordTag = isRealTimePlay ? 0 : 1;
- audioRecorder.record();
- }
- }
-
- private void playLocalAudioFile() {
- BufferedInputStream bis = null;
- try {
- bis = new BufferedInputStream(new FileInputStream(savefilePath));
- byte[] buffers = new byte[bis.available()];
- int len;
- while ((len = bis.read(buffers)) != Const.NUMBER_NEGATIVE_1) {
- oneOffLoadRender.play(buffers, len);
- }
- } catch (IOException e) {
- LogUtil.error(TAG, "play local audio file failed");
- } finally {
- if (bis != null) {
- try {
- bis.close();
- } catch (IOException e) {
- LogUtil.error(TAG, "play local audio file failed");
- }
- }
- }
- }
-
- @Override
- public void onActive() {
- super.onActive();
- }
-
- @Override
- public void onForeground(Intent intent) {
- super.onForeground(intent);
- }
-
- @Override
- protected void onStop() {
- recordWithPlayRender.release();
- oneOffLoadRender.release();
- audioRecorder.stopRecord();
- super.onStop();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundSystemSlice.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundSystemSlice.java
deleted file mode 100644
index 543e740995feac77874522e832eb81db3f166da8..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundSystemSlice.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.slice;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.constant.Const;
-
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.content.Intent;
-import ohos.agp.components.Component;
-import ohos.media.audio.SoundPlayer;
-import ohos.media.audio.ToneDescriptor;
-
-/**
- * SoundSystemSlice
- *
- * @since 2021-04-04
- */
-public class SoundSystemSlice extends AbilitySlice implements Component.ClickedListener {
- private SoundPlayer soundPlayer;
-
- @Override
- protected void onStart(Intent intent) {
- super.onStart(intent);
- setUIContent(ResourceTable.Layout_media_sound_tone);
- initView();
- initPlayer();
- }
-
- private void initView() {
- findComponentById(ResourceTable.Id_sound0).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound1).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound2).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound3).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound4).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound5).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound6).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound7).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound8).setClickedListener(this);
- findComponentById(ResourceTable.Id_sound9).setClickedListener(this);
- }
-
- private void initPlayer() {
- soundPlayer = new SoundPlayer();
- }
-
- @Override
- public void onClick(Component view) {
- switch (view.getId()) {
- case ResourceTable.Id_sound0:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_0, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound1:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_1, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound2:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_2, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound3:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_3, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound4:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_4, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound5:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_5, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound6:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_6, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound7:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_7, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound8:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_8, Const.NUMBER_500);
- soundPlayer.play();
- break;
- case ResourceTable.Id_sound9:
- soundPlayer.createSound(ToneDescriptor.ToneType.DTMF_9, Const.NUMBER_500);
- soundPlayer.play();
- break;
- default:
- break;
- }
- }
-
- @Override
- protected void onStop() {
- if (soundPlayer != null) {
- soundPlayer.release();
- soundPlayer = null;
- }
- super.onStop();
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundVolumeSlice.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundVolumeSlice.java
deleted file mode 100644
index 8e295f054de7ebe323fc6eaa271932b385070ff4..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/slice/SoundVolumeSlice.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.slice;
-
-import com.huawei.harmonyaudiodemo.ResourceTable;
-import com.huawei.harmonyaudiodemo.util.LogUtil;
-
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.content.Intent;
-import ohos.agp.components.Slider;
-import ohos.agp.components.Slider.ValueChangedListener;
-import ohos.media.audio.AudioManager;
-import ohos.media.audio.AudioRemoteException;
-
-/**
- * SoundVolumeSlice
- *
- * @since 2021-04-04
- */
-public class SoundVolumeSlice extends AbilitySlice implements ValueChangedListener {
- private static final String TAG = SoundVolumeSlice.class.getName();
- private AudioManager audioManager;
- private int dtmfVolume;
- private int musicVolume;
- private int callVolume;
-
- @Override
- protected void onStart(Intent intent) {
- super.onStart(intent);
- setUIContent(ResourceTable.Layout_media_sound_volume);
- audioManager = new AudioManager();
- initView();
- }
-
- private void initView() {
- try {
- initSlider(ResourceTable.Id_sound_volume_bar);
- initSlider(ResourceTable.Id_sound_volume_bar2);
- initSlider(ResourceTable.Id_sound_volume_bar3);
- } catch (AudioRemoteException e) {
- LogUtil.error(TAG, "audio remote exception");
- }
- }
-
- private void initSlider(int id) throws AudioRemoteException {
- Slider slider = null;
- if (findComponentById(id) instanceof Slider) {
- slider = (Slider) findComponentById(id);
- }
- int maxValue = 0;
- int currentValue = 0;
- switch (id) {
- case ResourceTable.Id_sound_volume_bar:
- maxValue = audioManager.getMaxVolume(AudioManager.AudioVolumeType.STREAM_DTMF);
- currentValue = audioManager.getVolume(AudioManager.AudioVolumeType.STREAM_DTMF);
- dtmfVolume = currentValue;
- break;
- case ResourceTable.Id_sound_volume_bar2:
- maxValue = audioManager.getMaxVolume(AudioManager.AudioVolumeType.STREAM_MUSIC);
- currentValue = audioManager.getVolume(AudioManager.AudioVolumeType.STREAM_MUSIC);
- musicVolume = currentValue;
- break;
- case ResourceTable.Id_sound_volume_bar3:
- maxValue = audioManager.getMaxVolume(AudioManager.AudioVolumeType.STREAM_VOICE_CALL);
- currentValue = audioManager.getVolume(AudioManager.AudioVolumeType.STREAM_VOICE_CALL);
- callVolume = currentValue;
- break;
- default:
- break;
- }
- if (slider != null) {
- slider.setMaxValue(maxValue);
- slider.setProgressValue(currentValue);
- slider.setValueChangedListener(this);
- }
- }
-
- @Override
- public void onProgressUpdated(Slider slider, int info, boolean isBool) {
- }
-
- @Override
- public void onTouchStart(Slider slider) {
- }
-
- @Override
- public void onTouchEnd(Slider slider) {
- int progress = slider.getProgress();
- switch (slider.getId()) {
- case ResourceTable.Id_sound_volume_bar:
- try {
- if (audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_DTMF, progress)) {
- dtmfVolume = progress;
- } else {
- audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_DTMF, dtmfVolume);
- }
- } catch (SecurityException e) {
- LogUtil.error(TAG, "set dtmf volume error");
- }
- break;
- case ResourceTable.Id_sound_volume_bar2:
- try {
- if (audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_MUSIC, progress)) {
- musicVolume = progress;
- } else {
- audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_MUSIC, musicVolume);
- }
- } catch (SecurityException e) {
- LogUtil.error(TAG, "set music volume error");
- }
- break;
- case ResourceTable.Id_sound_volume_bar3:
- try {
- if (audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_VOICE_CALL, progress)) {
- callVolume = progress;
- } else {
- audioManager.setVolume(AudioManager.AudioVolumeType.STREAM_VOICE_CALL, callVolume);
- }
- } catch (SecurityException e) {
- LogUtil.error(TAG, "set call volume error");
- }
- break;
- default:
- break;
- }
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/LogUtil.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/LogUtil.java
deleted file mode 100644
index 65d08bd0320d62a395b758e83d236470344199a9..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/LogUtil.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.util;
-
-import ohos.hiviewdfx.HiLog;
-import ohos.hiviewdfx.HiLogLabel;
-
-/**
- * Log util
- *
- * @since 2021-04-04
- */
-public class LogUtil {
- private static final String TAG_LOG = "LogUtil";
-
- private static final HiLogLabel LABEL_LOG = new HiLogLabel(0, 0, LogUtil.TAG_LOG);
-
- private static final String LOG_FORMAT = "%{public}s: %{public}s";
-
- private LogUtil() {
- }
-
- /**
- * Print debug log
- *
- * @param tag log tag
- * @param msg log message
- */
- public static void debug(String tag, String msg) {
- HiLog.debug(LABEL_LOG, LOG_FORMAT, tag, msg);
- }
-
- /**
- * Print info log
- *
- * @param tag log tag
- * @param msg log message
- */
- public static void info(String tag, String msg) {
- HiLog.info(LABEL_LOG, LOG_FORMAT, tag, msg);
- }
-
- /**
- * Print warn log
- *
- * @param tag log tag
- * @param msg log message
- */
- public static void warn(String tag, String msg) {
- HiLog.warn(LABEL_LOG, LOG_FORMAT, tag, msg);
- }
-
- /**
- * Print error log
- *
- * @param tag log tag
- * @param msg log message
- */
- public static void error(String tag, String msg) {
- HiLog.error(LABEL_LOG, LOG_FORMAT, tag, msg);
- }
-}
diff --git a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/ScreenUtils.java b/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/ScreenUtils.java
deleted file mode 100644
index f2cc386daad3fdd329dd6094734b9e6e416ba73a..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/java/com/huawei/harmonyaudiodemo/util/ScreenUtils.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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 a 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.huawei.harmonyaudiodemo.util;
-
-import ohos.agp.utils.Point;
-import ohos.agp.window.service.Display;
-import ohos.agp.window.service.DisplayManager;
-import ohos.app.Context;
-import ohos.global.configuration.DeviceCapability;
-
-import java.util.Optional;
-
-/**
- * Screen util
- *
- * @since 2021-04-04
- */
-public class ScreenUtils {
- private ScreenUtils() {
- }
-
- /**
- * getScreenHeight
- *
- * @param context context
- * @return Screen Height
- */
- public static int getScreenHeight(Context context) {
- DisplayManager displayManager = DisplayManager.getInstance();
- Optional optDisplay = displayManager.getDefaultDisplay(context);
- Point point = new Point(0, 0);
- if (!optDisplay.isPresent()) {
- return (int) point.position[1];
- } else {
- Display display = optDisplay.get();
- display.getSize(point);
- return (int) point.position[1];
- }
- }
-
- /**
- * getScreenWidth
- *
- * @param context context
- * @return Screen Width
- */
- public static int getScreenWidth(Context context) {
- DisplayManager displayManager = DisplayManager.getInstance();
- Optional optDisplay = displayManager.getDefaultDisplay(context);
- Point point = new Point(0, 0);
- if (!optDisplay.isPresent()) {
- return (int) point.position[0];
- } else {
- Display display = optDisplay.get();
- display.getSize(point);
- return (int) point.position[0];
- }
- }
-
- /**
- * dp2px
- *
- * @param context context
- * @param size size
- * @return int
- */
- public static int dp2px(Context context, int size) {
- int density = context.getResourceManager().getDeviceCapability().screenDensity / DeviceCapability.SCREEN_MDPI;
- return size * density;
- }
-
- /**
- * px2dip
- *
- * @param context context
- * @param size size
- * @return int
- */
- public static int px2dip(Context context, int size) {
- int density = context.getResourceManager().getDeviceCapability().screenDensity / DeviceCapability.SCREEN_MDPI;
- return size / density;
- }
-}
diff --git a/AudioDemo/entry/src/main/resources/base/element/color.json b/AudioDemo/entry/src/main/resources/base/element/color.json
deleted file mode 100644
index d4e835bddf1c1ea9ceb11cd87238bd3021e92515..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/element/color.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "color": [
- {
- "name": "red",
- "value": "#FF0000"
- },
- {
- "name": "blue",
- "value": "#0000FF"
- },
- {
- "name": "white",
- "value": "#ffffff"
- }
- ]
-}
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/element/string.json b/AudioDemo/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index bb076ba2d5a9f3a2987a43f259d17da119863aa6..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string":[
- {
- "name":"app_name",
- "value":"HarmonyAudioDemo"
- },
- {
- "name":"mainability_description",
- "value":"Java_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/animation_record_play.xml b/AudioDemo/entry/src/main/resources/base/graphic/animation_record_play.xml
deleted file mode 100644
index e90863d7699ce5a13cedaf94419f98e9c72b3f11..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/animation_record_play.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/background_ability_main.xml b/AudioDemo/entry/src/main/resources/base/graphic/background_ability_main.xml
deleted file mode 100644
index 47a2d3e00aea59206e521f2e2c2491c629528df9..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/background_ability_main.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/background_record_progress.xml b/AudioDemo/entry/src/main/resources/base/graphic/background_record_progress.xml
deleted file mode 100644
index 98942569f9cc93e902efc047a6fe9c3fd9b56c0b..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/background_record_progress.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/button_normal_ability_main.xml b/AudioDemo/entry/src/main/resources/base/graphic/button_normal_ability_main.xml
deleted file mode 100644
index 72106aa48fd77c9124c3cc99126627d562cbeada..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/button_normal_ability_main.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/button_pressed_ability_main.xml b/AudioDemo/entry/src/main/resources/base/graphic/button_pressed_ability_main.xml
deleted file mode 100644
index a29a1da66db5c0c9f5e67bfcd580f61267d4b59f..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/button_pressed_ability_main.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/button_record_normal.xml b/AudioDemo/entry/src/main/resources/base/graphic/button_record_normal.xml
deleted file mode 100644
index 82fa87c355a32b377dde3298dbd713c9c7bebbd3..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/button_record_normal.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/button_record_pressed.xml b/AudioDemo/entry/src/main/resources/base/graphic/button_record_pressed.xml
deleted file mode 100644
index 884334598914ae48bf533db9f931bd677a84a8c3..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/button_record_pressed.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/corner_yellow_bg.xml b/AudioDemo/entry/src/main/resources/base/graphic/corner_yellow_bg.xml
deleted file mode 100644
index 9bbecb50641c449f4d12f079d06888d614031415..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/corner_yellow_bg.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/gray_thumb.xml b/AudioDemo/entry/src/main/resources/base/graphic/gray_thumb.xml
deleted file mode 100644
index d417a8323687bfb6403316072e2ac50b0a0befcd..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/gray_thumb.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/gray_track.xml b/AudioDemo/entry/src/main/resources/base/graphic/gray_track.xml
deleted file mode 100644
index 2235f61227ed99cbe9dd13b183d8d3eb257c2ec2..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/gray_track.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/green_thumb.xml b/AudioDemo/entry/src/main/resources/base/graphic/green_thumb.xml
deleted file mode 100644
index f1d6074ab039aefb1826442ccf765b9963e8f12a..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/green_thumb.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/green_track.xml b/AudioDemo/entry/src/main/resources/base/graphic/green_track.xml
deleted file mode 100644
index 4854f4e01f75d959d381e8ccbd739932a8f31473..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/green_track.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/selector_ability_main.xml b/AudioDemo/entry/src/main/resources/base/graphic/selector_ability_main.xml
deleted file mode 100644
index 603ed1fbca321ba08d2f00aa83089b9cfc79ea1f..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/selector_ability_main.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/selector_button_record.xml b/AudioDemo/entry/src/main/resources/base/graphic/selector_button_record.xml
deleted file mode 100644
index 120009d0731bcb3d372cf62ed24b4d1492076086..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/selector_button_record.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/thumb.xml b/AudioDemo/entry/src/main/resources/base/graphic/thumb.xml
deleted file mode 100644
index 1c42512863fc7196a8f326be27b340bac03784f1..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/thumb.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/graphic/track.xml b/AudioDemo/entry/src/main/resources/base/graphic/track.xml
deleted file mode 100644
index ecb569ed0ad2ca43aafd7a7157301ee3e8d29829..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/graphic/track.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/layout/ability_main.xml b/AudioDemo/entry/src/main/resources/base/layout/ability_main.xml
deleted file mode 100644
index fde80782cbce9ad596f34b753e76df0254bd06ac..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/ability_main.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/layout/ability_music_player.xml b/AudioDemo/entry/src/main/resources/base/layout/ability_music_player.xml
deleted file mode 100644
index 7635847bdb9e081c590996af882931e0866c4e03..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/ability_music_player.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/AudioDemo/entry/src/main/resources/base/layout/media_sound_audio.xml b/AudioDemo/entry/src/main/resources/base/layout/media_sound_audio.xml
deleted file mode 100644
index f6554fe28ff3a8cec34910dcfa6796d4f9f2de0c..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/media_sound_audio.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/layout/media_sound_tone.xml b/AudioDemo/entry/src/main/resources/base/layout/media_sound_tone.xml
deleted file mode 100644
index e7a2ce2fd4b496196d0a9b34c76126acb6b2825a..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/media_sound_tone.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/AudioDemo/entry/src/main/resources/base/layout/media_sound_volume.xml b/AudioDemo/entry/src/main/resources/base/layout/media_sound_volume.xml
deleted file mode 100644
index 1903c0a885f553542594fb372076c7935b751ddc..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/media_sound_volume.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/layout/player_loading_layout.xml b/AudioDemo/entry/src/main/resources/base/layout/player_loading_layout.xml
deleted file mode 100644
index 498983f3b231656b23c998c91707e1882e589155..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/player_loading_layout.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
diff --git a/AudioDemo/entry/src/main/resources/base/layout/record_play_button.xml b/AudioDemo/entry/src/main/resources/base/layout/record_play_button.xml
deleted file mode 100644
index aaa6a3101a014fffcd10dbf467e5ffdc0e50d9b4..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/record_play_button.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/layout/simple_player_controller_layout.xml b/AudioDemo/entry/src/main/resources/base/layout/simple_player_controller_layout.xml
deleted file mode 100644
index fc1eba5c769804abc0e7b9136591a1053b967bfa..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/main/resources/base/layout/simple_player_controller_layout.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/AudioDemo/entry/src/main/resources/base/media/bg_music_player.jpg b/AudioDemo/entry/src/main/resources/base/media/bg_music_player.jpg
deleted file mode 100644
index 518eaacaffa7ab7e57acd179df0286e3607fcd0a..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/bg_music_player.jpg and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_back.png b/AudioDemo/entry/src/main/resources/base/media/ic_back.png
deleted file mode 100644
index 392306cdb9171897c6ca7fec1216b6fa7099c2d0..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_back.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_backward.png b/AudioDemo/entry/src/main/resources/base/media/ic_backward.png
deleted file mode 100644
index 2696217ec5156e83b88adf46d87d4c5bfd328075..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_backward.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_forward.png b/AudioDemo/entry/src/main/resources/base/media/ic_forward.png
deleted file mode 100644
index b52b99f1c209870d3c4a9b083b767eac2209bec8..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_forward.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_horns.png b/AudioDemo/entry/src/main/resources/base/media/ic_horns.png
deleted file mode 100644
index 1f7bd807998c984a55e5972240fdcb44cfdc96b9..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_horns.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_loading.png b/AudioDemo/entry/src/main/resources/base/media/ic_loading.png
deleted file mode 100644
index 8803fa85f47eacd897aff7d72952ef7bbb932a63..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_loading.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_music_play.png b/AudioDemo/entry/src/main/resources/base/media/ic_music_play.png
deleted file mode 100644
index 818369b1f29c3451ff7616ba3ca12c8fc2c2cfe4..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_music_play.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_music_stop.png b/AudioDemo/entry/src/main/resources/base/media/ic_music_stop.png
deleted file mode 100644
index 211e4757a0aa24bc9256fca076d7d998b60e10dd..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_music_stop.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_record_play1.png b/AudioDemo/entry/src/main/resources/base/media/ic_record_play1.png
deleted file mode 100644
index b31ed7d873c1f8d6ed2a29929365a6cc576ca67b..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_record_play1.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_record_play2.png b/AudioDemo/entry/src/main/resources/base/media/ic_record_play2.png
deleted file mode 100644
index d9ce54e44ba0fc5c0280967570f97f9751934319..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_record_play2.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_record_play3.png b/AudioDemo/entry/src/main/resources/base/media/ic_record_play3.png
deleted file mode 100644
index 2e58bdbc62aa63c649ce735ac957195d147a5015..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_record_play3.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_recorder.png b/AudioDemo/entry/src/main/resources/base/media/ic_recorder.png
deleted file mode 100644
index 8f247901c719a83fb202ea8ca7890e94cfa2e75d..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_recorder.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/ic_update.png b/AudioDemo/entry/src/main/resources/base/media/ic_update.png
deleted file mode 100644
index 1b63a318d863b5b236da9c83f616334b702dde82..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/ic_update.png and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/test.aac b/AudioDemo/entry/src/main/resources/base/media/test.aac
deleted file mode 100644
index 22871a8d45b4db3f4ebf8a75ffb91184d940f4d5..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/test.aac and /dev/null differ
diff --git a/AudioDemo/entry/src/main/resources/base/media/test.m4a b/AudioDemo/entry/src/main/resources/base/media/test.m4a
deleted file mode 100644
index dafd82086a78dffb98f4221e66b3535ca3764272..0000000000000000000000000000000000000000
Binary files a/AudioDemo/entry/src/main/resources/base/media/test.m4a and /dev/null differ
diff --git a/AudioDemo/entry/src/ohosTest/config.json b/AudioDemo/entry/src/ohosTest/config.json
deleted file mode 100644
index a7569cd667f81fca7f89579c63286460db087f60..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/ohosTest/config.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "app": {
- "bundleName": "com.huawei.cookbook",
- "vendor": "huawei",
- "version": {
- "code": 1,
- "name": "1.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 4
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.huawei.harmonyaudiodemo",
- "name": "testModule",
- "deviceType": ["phone"],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry_test",
- "moduleType": "feature"
- },
- "abilities":[
- {
- "name": "decc.testkit.runner.EntryAbility",
- "description": "Test Entry Ability",
- "icon": "$media:icon",
- "label": "TestAbility",
- "launchType": "standard",
- "orientation": "landscape",
- "visible": true,
- "type": "page"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/AudioDemo/entry/src/ohosTest/java/com/huawei/harmonyaudiodemo/ExampleOhosTest.java b/AudioDemo/entry/src/ohosTest/java/com/huawei/harmonyaudiodemo/ExampleOhosTest.java
deleted file mode 100644
index 7585fdedb9d870fd4cf6d8847ef0886a5483cfb4..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/ohosTest/java/com/huawei/harmonyaudiodemo/ExampleOhosTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
- *
- * 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 a 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.huawei.harmonyaudiodemo;
-
-import static org.junit.Assert.assertEquals;
-
-import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
-
-import org.junit.Test;
-
-/**
- * ExampleOhosTest
- *
- * @since 2020-12-04
- *
- */
-public class ExampleOhosTest {
- /**
- * testBundleName
- *
- */
- @Test
- public void testBundleName() {
- final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
- assertEquals("com.huawei.harmonyaudiodemo", actualBundleName);
- }
-}
diff --git a/AudioDemo/entry/src/test/java/com/huawei/harmonyaudiodemo/ExampleTest.java b/AudioDemo/entry/src/test/java/com/huawei/harmonyaudiodemo/ExampleTest.java
deleted file mode 100644
index 1f1e3c8cd64e7f3afb55efd9a5fb29cd36ee88a3..0000000000000000000000000000000000000000
--- a/AudioDemo/entry/src/test/java/com/huawei/harmonyaudiodemo/ExampleTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
- *
- * 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 a 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.huawei.harmonyaudiodemo;
-
-import org.junit.Test;
-
-/**
- * ExampleTest
- *
- * @since 2020-12-04
- *
- */
-public class ExampleTest {
- /**
- * onStart
- *
- */
- @Test
- public void onStart() {
- }
-}
diff --git a/ClickableImageJsDemo/LICENSE b/ClickableImageJsDemo/LICENSE
deleted file mode 100644
index 80576ef141485b36eea4aebf25af97020bc2de44..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/LICENSE
+++ /dev/null
@@ -1,78 +0,0 @@
- Copyright (c) 2021 Huawei Device Co., Ltd. All rights reserved.
-
- 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 a 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.
-
-Apache License, Version 2.0
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-1.You must give any other recipients of the Work or Derivative Works a copy of this License; and
-2.You must cause any modified files to carry prominent notices stating that You changed the files; and
-3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/ClickableImageJsDemo/README.md b/ClickableImageJsDemo/README.md
deleted file mode 100644
index 804c8180590cb0c48975b5b77662a18f49c9cdea..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# ClickableImageJsDemo
-简介
-• HarmonyOS JSUI提供了常用的布局、组件等页面元素,并且为这些组件提供了很多属性与可监听到的事件(例如动画属性与点击、触碰事件),开发者可以根据实际场景和开发需求,选用不同的组件、事件、属性来实现界面交互效果的设计。
-
-安装要求
-• 安装DevEco Studio
-• 设置DevEco Studio开发环境。DevEco Studio开发环境需要连接到网络,以确保该正常使用。可以根据以下两种情况配置开发环境:
- 1.如果您可以直接访问Internet,则只需下载HarmonyOS SDK
- 2.如果网络无法直接访问Internet,则可以通过代理服务器进行访问
-• 生成密钥并申请证书
-
-用户指南
-• 下载此项目
-• 打开HUAWEI DevEco Studio,单击File> Open选择此ComponentCodelab
-• 单击Build> Build App(s)/Hap(s)>Build Debug Hap(s)以编译hap软件包
-• 单击Run> Run 'entry'以运行hap包
-
-注意
-• 您可以选择在模拟器或真机上运行hap软件包。
-• 如果在真机上运行它,则需要在项目的File> Project Structure> Modules> Signing Configs中配置签名和证书信息。
-
-许可
-请参阅LICENSE文件以获得更多信息。
-
-What is it?
- HarmonyOS JSUI provides commonly used layout, components, and other page elements, and provides many properties and audible events (such as animated properties and click-and-touch events) for these components, allowing developers to design different components, events, and properties to achieve interface interaction based on actual scenes and development needs
-
-Installation requirements
-• Install DevEco Studio
-• Set up the DevEco Studio development environment.The DevEco Studio development environment needs to depend on the network environment. It needs to be connected to the network to ensure the normal use of the tool.The development environment can be configured according to the following two situations
- 1.If you can directly access the Internet, just download the HarmonyOS SDK
- 2.If the network cannot access the Internet directly, it can be accessed through a proxy server
-• Generate secret key and apply for certificate
-
-User guide
-• Download this Project
-• Open HUAWEI DevEco Studio, click File> Open> Then select and open this Project
-• Click Build> Build App(s)/Hap(s)>Build Debug Hap(s) to compile the hap package
-• Click Run> Run 'entry' to run the hap package
-
-Note
-• You can choose to run the hap package on the simulator or the phone.
-• If you run it on the phone, you need to configure the signature and certificate information in the project's File> Project Structure> Modules> Signing Configs.
-
-Licensing
-Please see LICENSE for more info.
\ No newline at end of file
diff --git a/ClickableImageJsDemo/RELEASE-NOTES.md b/ClickableImageJsDemo/RELEASE-NOTES.md
deleted file mode 100644
index ea23a13e3d4407d06cba3aa7155a23e5081b50b4..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/RELEASE-NOTES.md
+++ /dev/null
@@ -1,2 +0,0 @@
-1.0.0
-1.Initial version
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java b/ClickableImageJsDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java
deleted file mode 100644
index a650b41958d05c8cfc40e3d3f15e58067b311091..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/main/java/com/huawei/codelab/MainAbility.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 a 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.huawei.codelab;
-
-import ohos.aafwk.content.Intent;
-import ohos.ace.ability.AceAbility;
-
-/***
- * 主能力
- *
- * @since 2021-07-22
- */
-public class MainAbility extends AceAbility {
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- }
-
- @Override
- public void onStop() {
- super.onStop();
- }
-}
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/i18n/en-US.json b/ClickableImageJsDemo/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/i18n/zh-CN.json b/ClickableImageJsDemo/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.js b/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index 57aa343d7b0c2e8efc4b833073baaf37a0e34db9..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,140 +0,0 @@
-export default {
- data: {
- imageNormal: {
- classType: 'main-img-unTouch',
- src: '/common/images/sky_blue.png',
- title: '点击阴影'
- },
- imageSelect: {
- src: '/common/images/hook.png',
- title: '点击切换状态',
- hook: true
- },
- frameContainerPhone: {
- frames: [
- {src: '/common/images/frames/phone/phone_0.png'},
- {src: '/common/images/frames/phone/phone_1.png'},
- {src: '/common/images/frames/phone/phone_2.png'},
- {src: '/common/images/frames/phone/phone_3.png'},
- {src: '/common/images/frames/phone/phone_4.png'},
- {src: '/common/images/frames/phone/phone_5.png'},
- {src: '/common/images/frames/phone/phone_6.png'},
- {src: '/common/images/frames/phone/phone_7.png'},
- {src: '/common/images/frames/phone/phone_8.png'},
- {src: '/common/images/frames/phone/phone_9.png'},
- {src: '/common/images/frames/phone/phone_10.png'},
- {src: '/common/images/frames/phone/phone_11.png'},
- {src: '/common/images/frames/phone/phone_12.png'},
- {src: '/common/images/frames/phone/phone_13.png'},
- {src: '/common/images/frames/phone/phone_14.png'},
- {src: '/common/images/frames/phone/phone_15.png'},
- {src: '/common/images/frames/phone/phone_16.png'},
- {src: '/common/images/frames/phone/phone_17.png'},
- {src: '/common/images/frames/phone/phone_18.png'},
- {src: '/common/images/frames/phone/phone_19.png'},
- {src: '/common/images/frames/phone/phone_20.png'},
- {src: '/common/images/frames/phone/phone_21.png'},
- {src: '/common/images/frames/phone/phone_22.png'},
- {src: '/common/images/frames/phone/phone_23.png'},
- {src: '/common/images/frames/phone/phone_24.png'},
- {src: '/common/images/frames/phone/phone_25.png'},
- {src: '/common/images/frames/phone/phone_26.png'},
- {src: '/common/images/frames/phone/phone_27.png'},
- {src: '/common/images/frames/phone/phone_28.png'},
- {src: '/common/images/frames/phone/phone_29.png'},
- {src: '/common/images/frames/phone/phone_30.png'},
- {src: '/common/images/frames/phone/phone_31.png'},
- {src: '/common/images/frames/phone/phone_32.png'},
- {src: '/common/images/frames/phone/phone_33.png'},
- {src: '/common/images/frames/phone/phone_34.png'},
- {src: '/common/images/frames/phone/phone_35.png'}
- ],
- title: '点击动画效果',
- durationTime: 3600
- },
- frameContainerState: {
- frames: [],
- title: '点击切换状态动效',
- durationTime: 0,
- flag: true
- },
- durationTimeArray: [1400, 1400],
- back: [
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_0.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_1.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_2.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_3.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_4.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_5.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_6.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_7.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_8.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_9.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_10.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_11.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_12.png'},
- {src: '/common/images/frames/arrowheadBack/arrowhead_back_13.png'}
- ],
- collapse: [
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png'},
- {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png'}
- ]
- },
- // 初始化
- onInit() {
- this.frameContainerState.frames = this.back;
- this.frameContainerState.durationTime = 0;
- this.frameContainerPhone.durationTime = 0;
- },
- // 触碰阴影方法
- changeHookState() {
- if (this.imageSelect.hook) {
- this.imageSelect.src = '/common/images/fork.png';
- this.imageSelect.hook = false;
- } else {
- this.imageSelect.src = '/common/images/hook.png';
- this.imageSelect.hook = true;
- }
- },
- // 点击切换状态
- changeShadow(flag) {
- if (flag) {
- this.imageNormal.classType = 'main-img-touch';
- } else {
- this.imageNormal.classType = 'main-img-unTouch';
- }
- },
- // 点击动画效果方法
- handleStartFrameContainerPhone() {
- this.frameContainerPhone.durationTime = 3600;
- this.$refs.frameContainerPhone.start();
- },
- // 点击切换状态动效方法
- handleStartFrameContainerState() {
- if (this.frameContainerState.flag) {
- this.frameContainerState.frames = this.collapse;
- this.frameContainerState.durationTime = this.durationTimeArray[0];
- this.$refs.frameContainerState.start();
- this.frameContainerState.flag = false;
- this.$refs.frameContainerState.stop();
- } else {
- this.frameContainerState.frames = this.back;
- this.frameContainerState.durationTime = this.durationTimeArray[1];
- this.$refs.frameContainerState.start();
- this.frameContainerState.flag = true;
- this.$refs.frameContainerState.stop();
- }
- }
-};
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java b/ClickableImageJsDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java
deleted file mode 100644
index 14b7d6de20b7e60fd1672df6bd7c7a2e737fdd45..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/java/com/huawei/codelab/ExampleOhosTest.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.huawei.codelab;
-
-import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class ExampleOhosTest {
- @Test
- public void testBundleName() {
- final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
- assertEquals("com.huawei.codelab", actualBundleName);
- }
-}
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/default/app.js b/ClickableImageJsDemo/entry/src/ohosTest/js/default/app.js
deleted file mode 100644
index 55b67e96deb821033f71d30b6fff05efdeb0d901..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/default/app.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default {
- onCreate() {
- console.info('TestApplication onCreate');
- },
- onDestroy() {
- console.info('TestApplication onDestroy');
- }
-};
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.css b/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.hml b/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.hml
deleted file mode 100644
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.js b/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.js
deleted file mode 100644
index 8be2df2479a8da755ed800ad70d2b6247e21b8a2..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/default/pages/index/index.js
+++ /dev/null
@@ -1,41 +0,0 @@
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {Core, Constant, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index'
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- const reportExtend = new ReportExtend(file)
- const instrumentLog = new InstrumentLog({
- 'id': 'report',
- 'version': '1.0.3'
- })
- core.addService('expect', expectExtend)
- core.addService('report', reportExtend)
- core.addService('report', instrumentLog)
- core.init()
- core.subscribeEvent('spec', instrumentLog)
- core.subscribeEvent('suite', instrumentLog)
- core.subscribeEvent('task', instrumentLog)
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {
- },
-}
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js b/ClickableImageJsDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js
deleted file mode 100644
index b6d74caed96ddede98edd1bc9292f6568cd1cfd1..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/test/ExampleJsunit.test.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import app from '@system.app'
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
-
-describe('appInfoTest', function () {
- it('app_info_test_001', 0, function () {
- var info = app.getInfo()
- expect(info.versionName).assertEqual('1.0')
- expect(info.versionCode).assertEqual('3')
- })
-})
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/test/List.test.js b/ClickableImageJsDemo/entry/src/ohosTest/js/test/List.test.js
deleted file mode 100644
index 305eb5bb254cd4802afaffebe68fca2f9436159f..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/test/List.test.js
+++ /dev/null
@@ -1 +0,0 @@
-require('./ExampleJsunit.test.js')
\ No newline at end of file
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/resources/base/element/string.json b/ClickableImageJsDemo/entry/src/ohosTest/resources/base/element/string.json
deleted file mode 100644
index 528489076b491714fe10625aaf39b4cef9f590a8..0000000000000000000000000000000000000000
--- a/ClickableImageJsDemo/entry/src/ohosTest/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "ClickableImageJsDemo"
- },
- {
- "name": "mainability_description",
- "value": "hap sample empty page"
- }
- ]
-}
diff --git a/ClickableImageJsDemo/build.gradle b/ClickableJsDemo/build.gradle
similarity index 83%
rename from ClickableImageJsDemo/build.gradle
rename to ClickableJsDemo/build.gradle
index ffb7d0b2406a4957aad77fd38996e79c00dccab6..ece154750a0fd2bc4bfaaf437945f86e10851f80 100644
--- a/ClickableImageJsDemo/build.gradle
+++ b/ClickableJsDemo/build.gradle
@@ -3,12 +3,12 @@ apply plugin: 'com.huawei.ohos.app'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 5
+ compileSdkVersion 6
defaultConfig {
- compatibleSdkVersion 5
+ compatibleSdkVersion 6
}
}
-
+
buildscript {
repositories {
maven {
@@ -19,8 +19,8 @@ buildscript {
}
}
dependencies {
- classpath 'com.huawei.ohos:hap:2.4.5.0'
- classpath 'com.huawei.ohos:decctest:1.2.4.1'
+ classpath 'com.huawei.ohos:hap:2.4.5.5'
+ classpath 'com.huawei.ohos:decctest:1.2.5.1'
}
}
diff --git a/AudioDemo/entry/.gitignore b/ClickableJsDemo/entry/.gitignore
similarity index 100%
rename from AudioDemo/entry/.gitignore
rename to ClickableJsDemo/entry/.gitignore
diff --git a/InputApplication/entry/build.gradle b/ClickableJsDemo/entry/build.gradle
similarity index 72%
rename from InputApplication/entry/build.gradle
rename to ClickableJsDemo/entry/build.gradle
index 2f6bd135a45bd58668f8972730ed502860d69113..cccb71cae91018743841ab76aeb19c595f4ed847 100644
--- a/InputApplication/entry/build.gradle
+++ b/ClickableJsDemo/entry/build.gradle
@@ -1,10 +1,9 @@
apply plugin: 'com.huawei.ohos.hap'
-apply plugin: 'com.huawei.ohos.decctest'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
- compileSdkVersion 5
+ compileSdkVersion 6
defaultConfig {
- compatibleSdkVersion 5
+ compatibleSdkVersion 6
}
buildTypes {
release {
@@ -14,13 +13,11 @@ ohos {
}
}
}
+
+ supportSystem "standard"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testImplementation 'junit:junit:4.13'
- ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200'
-}
-decc {
- supportType = ['html','xml']
}
diff --git a/ClickableImageJsDemo/entry/package.json b/ClickableJsDemo/entry/package.json
similarity index 100%
rename from ClickableImageJsDemo/entry/package.json
rename to ClickableJsDemo/entry/package.json
diff --git a/ClickableImageJsDemo/entry/proguard-rules.pro b/ClickableJsDemo/entry/proguard-rules.pro
similarity index 100%
rename from ClickableImageJsDemo/entry/proguard-rules.pro
rename to ClickableJsDemo/entry/proguard-rules.pro
diff --git a/ClickableImageJsDemo/entry/src/main/config.json b/ClickableJsDemo/entry/src/main/config.json
similarity index 79%
rename from ClickableImageJsDemo/entry/src/main/config.json
rename to ClickableJsDemo/entry/src/main/config.json
index 310deec2ebab28b05cf52be23c3355ee78a087c4..ff35f48aba8b855f620ef3ff9aa0f43489426322 100644
--- a/ClickableImageJsDemo/entry/src/main/config.json
+++ b/ClickableJsDemo/entry/src/main/config.json
@@ -9,9 +9,9 @@
},
"deviceConfig": {},
"module": {
- "package": "com.huawei.codelab",
+ "package": "com.huawei.clickablejsdemo",
"name": ".MyApplication",
- "mainAbility": "com.huawei.codelab.MainAbility",
+ "mainAbility": "com.huawei.clickablejsdemo.MainAbility",
"deviceType": [
"phone"
],
@@ -33,9 +33,11 @@
]
}
],
- "name": "com.huawei.codelab.MainAbility",
+ "orientation": "unspecified",
+ "name": "com.huawei.clickablejsdemo.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
+ "formsEnabled": false,
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
@@ -49,7 +51,7 @@
"name": "default",
"window": {
"designWidth": 720,
- "autoDesignWidth": true
+ "autoDesignWidth": false
}
}
]
diff --git a/ShoppingJs/entry/src/main/js/default/app.js b/ClickableJsDemo/entry/src/main/js/default/app.js
similarity index 42%
rename from ShoppingJs/entry/src/main/js/default/app.js
rename to ClickableJsDemo/entry/src/main/js/default/app.js
index d8dfc5237086ae1af0e29ab1a8b1fd40f13a9b7a..6d060ffe5682c19fc83e2274a9e62cbc40a655f8 100644
--- a/ShoppingJs/entry/src/main/js/default/app.js
+++ b/ClickableJsDemo/entry/src/main/js/default/app.js
@@ -1,6 +1,8 @@
export default {
onCreate() {
+ console.info("Application onCreate");
},
onDestroy() {
+ console.info("Application onDestroy");
}
};
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/css/style.css b/ClickableJsDemo/entry/src/main/js/default/common/css/style.css
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/css/style.css
rename to ClickableJsDemo/entry/src/main/js/default/common/css/style.css
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/fork.png b/ClickableJsDemo/entry/src/main/js/default/common/images/fork.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/fork.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/fork.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_0.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_0.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_0.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_0.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_1.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_1.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_1.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_1.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_10.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_10.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_10.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_10.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_11.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_11.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_11.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_11.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_12.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_12.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_12.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_12.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_13.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_13.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_13.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_13.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_2.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_2.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_2.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_2.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_3.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_3.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_3.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_3.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_4.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_4.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_4.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_4.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_5.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_5.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_5.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_5.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_6.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_6.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_6.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_6.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_7.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_7.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_7.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_7.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_8.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_8.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_8.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_8.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_9.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_9.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_9.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadBack/arrowhead_back_9.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_0.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_0.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_0.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_0.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_1.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_1.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_1.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_1.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_10.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_10.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_10.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_10.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_11.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_11.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_11.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_11.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_12.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_12.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_12.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_12.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_13.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_13.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_13.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_13.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_14.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_14.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_14.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_14.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_15.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_15.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_15.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_15.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_16.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_16.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_16.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_16.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_17.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_17.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_17.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_17.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_18.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_18.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_18.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_18.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_19.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_19.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_19.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_19.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_2.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_2.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_2.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_2.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_20.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_20.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_20.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_20.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_21.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_21.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_21.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_21.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_22.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_22.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_22.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_22.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_23.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_23.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_23.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_23.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_24.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_24.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_24.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_24.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_25.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_25.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_25.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_25.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_26.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_26.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_26.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_26.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_27.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_27.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_27.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_27.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_28.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_28.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_28.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_28.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_29.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_29.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_29.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_29.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_3.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_3.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_3.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_3.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_30.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_30.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_30.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_30.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_31.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_31.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_31.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_31.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_32.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_32.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_32.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_32.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_33.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_33.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_33.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_33.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_34.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_34.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_34.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_34.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_35.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_35.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_35.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_35.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_4.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_4.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_4.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_4.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_5.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_5.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_5.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_5.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_6.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_6.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_6.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_6.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_7.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_7.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_7.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_7.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_8.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_8.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_8.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_8.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_9.png b/ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_9.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_9.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/frames/phone/phone_9.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/hook.png b/ClickableJsDemo/entry/src/main/js/default/common/images/hook.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/hook.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/hook.png
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/common/images/sky_blue.png b/ClickableJsDemo/entry/src/main/js/default/common/images/sky_blue.png
similarity index 100%
rename from ClickableImageJsDemo/entry/src/main/js/default/common/images/sky_blue.png
rename to ClickableJsDemo/entry/src/main/js/default/common/images/sky_blue.png
diff --git a/DialogDemo/entry/src/ohosTest/js/default/i18n/en-US.json b/ClickableJsDemo/entry/src/main/js/default/i18n/en-US.json
similarity index 40%
rename from DialogDemo/entry/src/ohosTest/js/default/i18n/en-US.json
rename to ClickableJsDemo/entry/src/main/js/default/i18n/en-US.json
index 55561b83737c3c31d082fbfa11e5fc987a351104..08e34eac912bf2651eefc20e26aa479b5e4e7ec2 100644
--- a/DialogDemo/entry/src/ohosTest/js/default/i18n/en-US.json
+++ b/ClickableJsDemo/entry/src/main/js/default/i18n/en-US.json
@@ -1,7 +1,10 @@
{
"strings": {
"hello": "Hello",
- "world": "World"
+ "world": "World",
+ "page": "Second Page",
+ "next": "Next Page",
+ "back": "Back"
},
"Files": {
}
diff --git a/ClickableImageJsDemo/entry/src/ohosTest/js/default/i18n/zh-CN.json b/ClickableJsDemo/entry/src/main/js/default/i18n/zh-CN.json
similarity index 40%
rename from ClickableImageJsDemo/entry/src/ohosTest/js/default/i18n/zh-CN.json
rename to ClickableJsDemo/entry/src/main/js/default/i18n/zh-CN.json
index cce1af06761a42add0cac1a0567aa3237eda8cb4..3dd53b3a8b808aec9396fa663cb00ef22ba61e0a 100644
--- a/ClickableImageJsDemo/entry/src/ohosTest/js/default/i18n/zh-CN.json
+++ b/ClickableJsDemo/entry/src/main/js/default/i18n/zh-CN.json
@@ -1,7 +1,10 @@
{
"strings": {
"hello": "您好",
- "world": "世界"
+ "world": "世界",
+ "page": "第二页",
+ "next": "下一页",
+ "back": "返回"
},
"Files": {
}
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.css b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.css
similarity index 99%
rename from ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.css
rename to ClickableJsDemo/entry/src/main/js/default/pages/index/index.css
index 5384b96419299e6f26ad872b1a882ebf01e19747..417891157e735ac2eaba8bd47af9310b1d89c87f 100644
--- a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.css
+++ b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.css
@@ -2,6 +2,7 @@
.container {
flex-direction: column;
align-items: center;
+
}
.container-son-div{
diff --git a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.hml b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.hml
similarity index 86%
rename from ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.hml
rename to ClickableJsDemo/entry/src/main/js/default/pages/index/index.hml
index 56dadb6198b79dff8d1da652dc209734763f2a3b..44166e87fdd3896d6a24840fcd874a8aa2c4c072 100644
--- a/ClickableImageJsDemo/entry/src/main/js/default/pages/index/index.hml
+++ b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.hml
@@ -5,7 +5,7 @@
diff --git a/ClickableJsDemo/entry/src/main/js/default/pages/index/index.js b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..1c4153a857e9b1ff8d7dcb3a78b04374f0346376
--- /dev/null
+++ b/ClickableJsDemo/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,140 @@
+export default {
+ data: {
+ imageNormal: {
+ classType: 'main-img-unTouch',
+ src: '/common/images/sky_blue.png',
+ title: '点击阴影'
+ },
+ imageSelect: {
+ src: '/common/images/hook.png',
+ title: '点击切换状态',
+ hook: true
+ },
+ frameContainerPhone: {
+ frames: [
+ {src: '/common/images/frames/phone/phone_0.png'},
+ {src: '/common/images/frames/phone/phone_1.png'},
+ {src: '/common/images/frames/phone/phone_2.png'},
+ {src: '/common/images/frames/phone/phone_3.png'},
+ {src: '/common/images/frames/phone/phone_4.png'},
+ {src: '/common/images/frames/phone/phone_5.png'},
+ {src: '/common/images/frames/phone/phone_6.png'},
+ {src: '/common/images/frames/phone/phone_7.png'},
+ {src: '/common/images/frames/phone/phone_8.png'},
+ {src: '/common/images/frames/phone/phone_9.png'},
+ {src: '/common/images/frames/phone/phone_10.png'},
+ {src: '/common/images/frames/phone/phone_11.png'},
+ {src: '/common/images/frames/phone/phone_12.png'},
+ {src: '/common/images/frames/phone/phone_13.png'},
+ {src: '/common/images/frames/phone/phone_14.png'},
+ {src: '/common/images/frames/phone/phone_15.png'},
+ {src: '/common/images/frames/phone/phone_16.png'},
+ {src: '/common/images/frames/phone/phone_17.png'},
+ {src: '/common/images/frames/phone/phone_18.png'},
+ {src: '/common/images/frames/phone/phone_19.png'},
+ {src: '/common/images/frames/phone/phone_20.png'},
+ {src: '/common/images/frames/phone/phone_21.png'},
+ {src: '/common/images/frames/phone/phone_22.png'},
+ {src: '/common/images/frames/phone/phone_23.png'},
+ {src: '/common/images/frames/phone/phone_24.png'},
+ {src: '/common/images/frames/phone/phone_25.png'},
+ {src: '/common/images/frames/phone/phone_26.png'},
+ {src: '/common/images/frames/phone/phone_27.png'},
+ {src: '/common/images/frames/phone/phone_28.png'},
+ {src: '/common/images/frames/phone/phone_29.png'},
+ {src: '/common/images/frames/phone/phone_30.png'},
+ {src: '/common/images/frames/phone/phone_31.png'},
+ {src: '/common/images/frames/phone/phone_32.png'},
+ {src: '/common/images/frames/phone/phone_33.png'},
+ {src: '/common/images/frames/phone/phone_34.png'},
+ {src: '/common/images/frames/phone/phone_35.png'}
+ ],
+ title: '点击动画效果',
+ durationTime: 3600
+ },
+ frameContainerState: {
+ frames: [],
+ title: '点击切换状态动效',
+ durationTime: 0,
+ flag: true
+ },
+ durationTimeArray: [1400, 1400],
+ back: [
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_0.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_1.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_2.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_3.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_4.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_5.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_6.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_7.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_8.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_9.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_10.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_11.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_12.png'},
+ {src: '/common/images/frames/arrowheadBack/arrowhead_back_13.png'}
+ ],
+ collapse: [
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_0.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_1.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_2.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_3.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_4.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_5.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_6.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_7.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_8.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_9.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_10.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_11.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_12.png'},
+ {src: '/common/images/frames/arrowheadCollapse/arrowhead_collapse_13.png'}
+ ]
+ },
+// 初始化
+ onInit() {
+ this.frameContainerState.frames = this.back;
+ this.frameContainerState.durationTime = 0;
+ this.frameContainerPhone.durationTime = 0;
+ },
+// 触碰阴影方法
+ changeHookState() {
+ if (this.imageSelect.hook) {
+ this.imageSelect.src = '/common/images/fork.png';
+ this.imageSelect.hook = false;
+ } else {
+ this.imageSelect.src = '/common/images/hook.png';
+ this.imageSelect.hook = true;
+ }
+ },
+// 点击切换状态
+ changeShadow(flag) {
+ if (flag) {
+ this.imageNormal.classType = 'main-img-touch';
+ } else {
+ this.imageNormal.classType = 'main-img-unTouch';
+ }
+ },
+// 点击动画效果方法
+ handleStartFrameContainerPhone() {
+ this.frameContainerPhone.durationTime = 3600;
+ this.$refs.frameContainerPhone.start();
+ },
+// 点击切换状态动效方法
+ handleStartFrameContainerState() {
+ if (this.frameContainerState.flag) {
+ this.frameContainerState.frames = this.collapse;
+ this.frameContainerState.durationTime = this.durationTimeArray[0];
+ this.$refs.frameContainerState.start();
+ this.frameContainerState.flag = false;
+ this.$refs.frameContainerState.stop();
+ } else {
+ this.frameContainerState.frames = this.back;
+ this.frameContainerState.durationTime = this.durationTimeArray[1];
+ this.$refs.frameContainerState.start();
+ this.frameContainerState.flag = true;
+ this.$refs.frameContainerState.stop();
+ }
+ }
+};
diff --git a/DialogDemo/entry/src/main/resources/base/element/string.json b/ClickableJsDemo/entry/src/main/resources/base/element/string.json
similarity index 100%
rename from DialogDemo/entry/src/main/resources/base/element/string.json
rename to ClickableJsDemo/entry/src/main/resources/base/element/string.json
diff --git a/AnimationDemo/entry/src/ohosTest/resources/base/media/icon.png b/ClickableJsDemo/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from AnimationDemo/entry/src/ohosTest/resources/base/media/icon.png
rename to ClickableJsDemo/entry/src/main/resources/base/media/icon.png
diff --git a/AudioDemo/gradle/wrapper/gradle-wrapper.jar b/ClickableJsDemo/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from AudioDemo/gradle/wrapper/gradle-wrapper.jar
rename to ClickableJsDemo/gradle/wrapper/gradle-wrapper.jar
diff --git a/AudioDemo/gradle/wrapper/gradle-wrapper.properties b/ClickableJsDemo/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from AudioDemo/gradle/wrapper/gradle-wrapper.properties
rename to ClickableJsDemo/gradle/wrapper/gradle-wrapper.properties
diff --git a/AudioDemo/settings.gradle b/ClickableJsDemo/settings.gradle
similarity index 100%
rename from AudioDemo/settings.gradle
rename to ClickableJsDemo/settings.gradle
diff --git a/ClockFACardDemo/LICENSE b/ClockFACardDemo/LICENSE
deleted file mode 100644
index 0d157f823e33378716f6abc657afe78e9b147793..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/LICENSE
+++ /dev/null
@@ -1,78 +0,0 @@
- 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 a 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.
-
-Apache License, Version 2.0
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-1.You must give any other recipients of the Work or Derivative Works a copy of this License; and
-2.You must cause any modified files to carry prominent notices stating that You changed the files; and
-3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/ClockFACardDemo/README.md b/ClockFACardDemo/README.md
deleted file mode 100644
index 333df7aa67004d47e2fea4dd2d2e80df8ae0a076..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/README.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# ClockFACardDemo
-简介
-• 本codelab旨在使开发人员了解HarmonyOS中JAVA卡片的开发,包含卡片的创建、更新、删除功能,实现了时分秒,年月日,星期的实时刷新效果。
-
-安装要求
-• 安装DevEco Studio
-• 设置DevEco Studio开发环境。DevEco Studio开发环境需要连接到网络,以确保该正常使用。可以根据以下两种情况配置开发环境:
- 1.如果您可以直接访问Internet,则只需下载HarmonyOS SDK
- 2.如果网络无法直接访问Internet,则可以通过代理服务器进行访问
-• 生成密钥并申请证书
-
-用户指南
-• 下载此项目
-• 打开HUAWEI DevEco Studio,单击File> Open选择此ClockFACardDemo
-• 单击Build> Build App(s)/Hap(s)>Build Debug Hap(s)以编译hap软件包
-• 单击Run> Run 'entry'以运行hap包
-
-注意
-• 您可以选择在模拟器或真机上运行hap软件包。
-• 如果在真机上运行它,则需要在项目的File> Project Structure> Modules> Signing Configs中配置签名和证书信息。
-• 由于目前暂无办法保证卡片服务不被系统销毁,需要通过手机管家> 应用启动管理> 时钟服务卡片> 点击右侧滑块> 选择开启“允许后台活动”开启后台运行权限,如需要也可开启“运行自启动”。
-
-许可
-请参阅LICENSE文件以获得更多信息。
-
-What is it?
-This codelab is designed to enable developers to understand the development of Java cards in HarmonyOS, including the creation, update, and deletion of cards, and the real-time refresh effect of hour, second, year, month, day, and week.
-
-Installation requirements
-• Install DevEco Studio
-• Set up the DevEco Studio development environment.The DevEco Studio development environment needs to depend on the network environment. It needs to be connected to the network to ensure the normal use of the tool.The development environment can be configured according to the following two situations
- 1.If you can directly access the Internet, just download the HarmonyOS SDK
- 2.If the network cannot access the Internet directly, it can be accessed through a proxy server
-• Generate secret key and apply for certificate
-
-User guide
-• Download this Project
-• Open HUAWEI DevEco Studio, click File> Open> Then select and open this Project
-• Click Build> Build App(s)/Hap(s)>Build Debug Hap(s) to compile the hap package
-• Click Run> Run 'entry' to run the hap package
-
-Note
-• You can choose to run the hap package on the simulator or the phone.
-• If you run it on the phone, you need to configure the signature and certificate information in the project's File> Project Structure> Modules> Signing Configs.
-• Currently, there is no way to ensure that the card service will not be destroyed by the system. Go to Phone Manager > App Startup Management > Pedometer Service Card, touch the slider on the right, and select Enable Background Activities to enable the background running permission. You can also enable Auto Start if necessary.
-
-Licensing
-Please see LICENSE for more info.
-
diff --git a/ClockFACardDemo/RELEASE-NOTES.md b/ClockFACardDemo/RELEASE-NOTES.md
deleted file mode 100644
index ea23a13e3d4407d06cba3aa7155a23e5081b50b4..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/RELEASE-NOTES.md
+++ /dev/null
@@ -1,2 +0,0 @@
-1.0.0
-1.Initial version
\ No newline at end of file
diff --git a/ClockFACardDemo/build.gradle b/ClockFACardDemo/build.gradle
deleted file mode 100644
index 859953eaf84cc3cff308056e618b42de0ed752e6..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/build.gradle
+++ /dev/null
@@ -1,37 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-apply plugin: 'com.huawei.ohos.app'
-
-ohos {
- compileSdkVersion 5
- defaultConfig {
- compatibleSdkVersion 4
- }
-}
-
-buildscript {
- repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
- jcenter()
- }
- dependencies {
- classpath 'com.huawei.ohos:hap:2.4.4.2'
- classpath 'com.huawei.ohos:decctest:1.0.0.7'
- }
-}
-
-allprojects {
- repositories {
- maven {
- url 'https://repo.huaweicloud.com/repository/maven/'
- }
- maven {
- url 'https://developer.huawei.com/repo/'
- }
- jcenter()
- }
-}
diff --git a/ClockFACardDemo/entry/build.gradle b/ClockFACardDemo/entry/build.gradle
deleted file mode 100644
index 90d8c89d8096320385b29451a9e804b30d7cf853..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/entry/build.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-apply plugin: 'com.huawei.ohos.hap'
-ohos {
- compileSdkVersion 5
- defaultConfig {
- compatibleSdkVersion 4
- }
- buildTypes {
- release {
- proguardOpt {
- proguardEnabled false
- rulesFiles 'proguard-rules.pro'
- }
- }
- }
- compileOptions { annotationEnabled true }
-}
-
-dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
- implementation 'android.arch.persistence.room:runtime:1.1.1'
- testCompile 'junit:junit:4.12'
-}
-
diff --git a/ClockFACardDemo/entry/src/main/config.json b/ClockFACardDemo/entry/src/main/config.json
deleted file mode 100644
index 23571a7d77d248590f8a76c1337b89ba84da018c..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/entry/src/main/config.json
+++ /dev/null
@@ -1,109 +0,0 @@
-{
- "app": {
- "bundleName": "com.huawei.cookbook",
- "vendor": "huawei",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- }
- },
- "deviceConfig": {
- "default": {
- "keepAlive": true
- }
- },
- "module": {
- "package": "com.huawei.cookbooks",
- "name": ".MyApplication",
- "mainAbility": "com.huawei.cookbooks.MainAbility",
- "deviceType": [
- "default"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry",
- "installationFree": false
- },
- "reqPermissions": [
- {
- "name": "ohos.permission.KEEP_BACKGROUND_RUNNING",
- "reason": "keep service ability backgroud running",
- "usedScene": {
- "ability": [
- ".TimerAbility"
- ],
- "when": "always"
- }
- }
- ],
- "abilities": [
- {
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "orientation": "unspecified",
- "name": "com.huawei.cookbooks.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "singleton",
- "formsEnabled": true,
- "visible": true,
- "forms": [
- {
- "landscapeLayouts": [
- "$layout:form_image_with_info_date_card_2_2",
- "$layout:form_image_with_info_date_card_2_4"
- ],
- "isDefault": true,
- "scheduledUpdateTime": "11:30",
- "defaultDimension": "2*2",
- "name": "DateCard",
- "description": "This is a service widget",
- "colorMode": "auto",
- "type": "Java",
- "supportDimensions": [
- "2*2",
- "2*4"
- ],
- "portraitLayouts": [
- "$layout:form_image_with_info_date_card_2_2",
- "$layout:form_image_with_info_date_card_2_4"
- ],
- "updateEnabled": true,
- "updateDuration": 1,
- "formVisibleNotify": true,
- "metaData": {
- "customizeData": [
- {
- "name": "needBlurBackgroundForLauncher",
- "value": "true"
- }
- ]
- }
- }
- ]
- },
- {
- "name": "com.huawei.cookbooks.TimerAbility",
- "icon": "$media:icon",
- "description": "$string:TimeAbility_description",
- "type": "service",
- "visible": true,
- "backgroundModes": [
- "dataTransfer",
- "location"
- ]
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MainAbility.java b/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MainAbility.java
deleted file mode 100644
index cdfa9f286a7b14510733e001281e20a478e70901..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MainAbility.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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 a 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.huawei.cookbooks;
-
-import com.huawei.cookbooks.database.Form;
-import com.huawei.cookbooks.database.FormDatabase;
-import com.huawei.cookbooks.slice.ClockCardSlice;
-import com.huawei.cookbooks.utils.ComponentProviderUtils;
-import com.huawei.cookbooks.utils.DatabaseUtils;
-
-import ohos.aafwk.ability.Ability;
-import ohos.aafwk.ability.AbilitySlice;
-import ohos.aafwk.ability.ProviderFormInfo;
-import ohos.aafwk.content.Intent;
-import ohos.aafwk.content.Operation;
-import ohos.agp.components.ComponentProvider;
-import ohos.data.DatabaseHelper;
-import ohos.data.orm.OrmContext;
-import ohos.hiviewdfx.HiLog;
-import ohos.hiviewdfx.HiLogLabel;
-
-/**
- * Card Main Ability
- */
-public class MainAbility extends Ability {
- private static final HiLogLabel LABEL_LOG = new HiLogLabel(0, 0, "com.huawei.cookbooks.MainAbility");
- private static final int DEFAULT_DIMENSION_2X2 = 2;
- private static final int DEFAULT_DIMENSION_2X4 = 3;
- private static final String EMPTY_STRING = "";
- private static final int INVALID_FORM_ID = -1;
- private long formId;
- private ProviderFormInfo formInfo;
- private DatabaseHelper helper = new DatabaseHelper(this);
- private OrmContext connect;
-
- @Override
- public void onStart(Intent intent) {
- super.onStart(intent);
- connect = helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class);
- // 启动TimerAbility
- Intent intentService = new Intent();
- Operation operation =
- new Intent.OperationBuilder()
- .withDeviceId("")
- .withBundleName(getBundleName())
- .withAbilityName(TimerAbility.class.getName())
- .build();
- intentService.setOperation(operation);
- startAbility(intentService);
- super.setMainRoute(ClockCardSlice.class.getName());
- }
-
- @Override
- protected ProviderFormInfo onCreateForm(Intent intent) {
- if (intent == null) {
- return new ProviderFormInfo();
- }
- // 获取卡片id
- formId = INVALID_FORM_ID;
- if (intent.hasParameter(AbilitySlice.PARAM_FORM_IDENTITY_KEY)) {
- formId = intent.getLongParam(AbilitySlice.PARAM_FORM_IDENTITY_KEY, INVALID_FORM_ID);
- } else {
- return new ProviderFormInfo();
- }
- // 获取卡片名称
- String formName = EMPTY_STRING;
- if (intent.hasParameter(AbilitySlice.PARAM_FORM_NAME_KEY)) {
- formName = intent.getStringParam(AbilitySlice.PARAM_FORM_NAME_KEY);
- }
- // 获取卡片规格
- int dimension = DEFAULT_DIMENSION_2X2;
- if (intent.hasParameter(AbilitySlice.PARAM_FORM_DIMENSION_KEY)) {
- dimension = intent.getIntParam(AbilitySlice.PARAM_FORM_DIMENSION_KEY, DEFAULT_DIMENSION_2X2);
- }
- int layoutId = ResourceTable.Layout_form_image_with_info_date_card_2_2;
- if (dimension == DEFAULT_DIMENSION_2X4) {
- layoutId = ResourceTable.Layout_form_image_with_info_date_card_2_4;
- }
- formInfo = new ProviderFormInfo(layoutId, this);
- // 存储卡片信息
- Form form = new Form(formId, formName, dimension);
- ComponentProvider componentProvider = ComponentProviderUtils.getComponentProvider(form, this);
- formInfo.mergeActions(componentProvider);
- if (connect == null) {
- connect =
- helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class);
- }
- try {
- DatabaseUtils.insertForm(form, connect);
- } catch (Exception e) {
- DatabaseUtils.deleteFormData(form.getFormId(), connect);
- }
- return formInfo;
- }
-
- @Override
- protected void onDeleteForm(long formId) {
- super.onDeleteForm(formId);
- // 删除数据库中的卡片信息
- DatabaseUtils.deleteFormData(formId, connect);
- }
-}
diff --git a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MyApplication.java b/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MyApplication.java
deleted file mode 100644
index f85d694ae60537b43c057d0bbd14690f95a6c228..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/MyApplication.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 a 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.huawei.cookbooks;
-
-import ohos.aafwk.ability.AbilityPackage;
-
-/**
- * MyApplication
- */
-public class MyApplication extends AbilityPackage {
- @Override
- public void onInitialize() {
- super.onInitialize();
- }
-}
diff --git a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/TimerAbility.java b/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/TimerAbility.java
deleted file mode 100644
index 662c82c95a9a483926496d8d5e4c43377bc13ea1..0000000000000000000000000000000000000000
--- a/ClockFACardDemo/entry/src/main/java/com/huawei/cookbooks/TimerAbility.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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 a 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.huawei.cookbooks;
-
-import com.huawei.cookbooks.database.Form;
-import com.huawei.cookbooks.database.FormDatabase;
-import com.huawei.cookbooks.utils.ComponentProviderUtils;
-import com.huawei.cookbooks.utils.DatabaseUtils;
-
-import com.huawei.cookbooks.utils.DateUtils;
-import ohos.aafwk.ability.Ability;
-import ohos.aafwk.ability.FormException;
-import ohos.aafwk.content.Intent;
-import ohos.agp.components.ComponentProvider;
-import ohos.data.DatabaseHelper;
-import ohos.data.orm.OrmContext;
-import ohos.data.orm.OrmPredicates;
-import ohos.event.notification.NotificationRequest;
-import ohos.hiviewdfx.HiLog;
-import ohos.hiviewdfx.HiLogLabel;
-import ohos.rpc.IRemoteObject;
-
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * Time PA
- */
-public class TimerAbility extends Ability {
- private static final HiLogLabel LABEL_LOG = new HiLogLabel(3, 0xD001100, "Demo");
- private static final long SEND_PERIOD = 1000L;
- private static final int NOTICE_ID = 1005;
- private DatabaseHelper helper = new DatabaseHelper(this);
- private OrmContext connect;
-
- @Override
- public void onStart(Intent intent) {
- HiLog.info(LABEL_LOG, "TimerAbility::onStart");
- connect = helper.getOrmContext("FormDatabase", "FormDatabase.db", FormDatabase.class);
- startTimer();
- super.onStart(intent);
-
- }
- private void notice() {
- // 创建通知
- NotificationRequest request = new NotificationRequest(NOTICE_ID);
- request.setAlertOneTime(true);
- NotificationRequest.NotificationNormalContent content = new NotificationRequest.NotificationNormalContent();
- content.setText(DateUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
- NotificationRequest.NotificationContent notificationContent = new NotificationRequest.NotificationContent(content);
- request.setContent(notificationContent);
- // 绑定通知
- keepBackgroundRunning(NOTICE_ID, request);
- }
- // 卡片更新定时器,每秒更新一次
- private void startTimer() {
- Timer timer = new Timer();
- timer.schedule(
- new TimerTask() {
- @Override
- public void run() {
- updateForms();
- notice();
- }
- },
- 0,
- SEND_PERIOD);
- }
-
- private void updateForms() {
- // 从数据库中获取卡片信息
- OrmPredicates ormPredicates = new OrmPredicates(Form.class);
- List