diff --git a/build-profile.json5 b/build-profile.json5 index bd46025bb742d22dfcf8218ceb5694229b7161df..5653ed880ca12edab4854bd5b6e19f022051ee6a 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,4 +1,3 @@ -// [Start lock] { "app": { "signingConfigs": [], @@ -86,5 +85,4 @@ ] } ] -} -// [End lock] \ No newline at end of file +} \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 2feb210724d3d0ebcec0fc745cfa7f483b6c9c99..fb20b581509887918d9ba3a24cc15d0381bb7475 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -17,7 +17,6 @@ } }, ], - // [Start targets] "targets": [ { "name": "official", @@ -53,6 +52,5 @@ ] } }, - ], - // [End targets] + ] } \ No newline at end of file diff --git a/entry/oh_modules/myhar/build-profile.json5 b/entry/oh_modules/myhar/build-profile.json5 deleted file mode 100644 index 965610ea7d3ca50109bab62631e7999f20c1bf4b..0000000000000000000000000000000000000000 --- a/entry/oh_modules/myhar/build-profile.json5 +++ /dev/null @@ -1,86 +0,0 @@ -{ - "apiType": "stageMode", - "buildOptionSet": [ - { - "name": "release", - "arkOptions": { - "obfuscation": { - "ruleOptions": { - "enable": false, - "files": [ - "./obfuscation-rules.txt" - ] - }, - "consumerFiles": [ - "./consumer-rules.txt" - ] - } - }, - }, - ], - // [Start official] - "targets": [ - { - "name": "official", - "config": { - "buildOption": { - "arkOptions": { - "buildProfileFields": { - "productName": "official" - } - }, - "nativeLib": { - "filter": { - "excludes": [ - "../libs/arm64-v8a/libentry.so" - ] - } - } - } - }, - "runtimeOS": "HarmonyOS", - "output": { - "artifactName": "official" - }, - "source": { - "sourceRoots": [ - "./src/official_pages" - ] - }, - "resource": { - "directories": [ - "./src/main/official/resources", - "./src/main/resources" - ] - } - }, - { - "name": "test", - "config": { - "buildOption": { - "arkOptions": { - "buildProfileFields": { - "productName": "test" - } - } - } - }, - "runtimeOS": "HarmonyOS", - "output": { - "artifactName": "test" - }, - "source": { - "sourceRoots": [ - "./src/test_pages" - ] - }, - "resource": { - "directories": [ - "./src/main/test/resources", - "./src/main/resources" - ] - } - } - ], - // [End official] -} diff --git a/entry/oh_modules/myhar/src/main/ets/components/MainPage.ets b/entry/oh_modules/myhar/src/main/ets/components/MainPage.ets deleted file mode 100644 index b0781b02821d83c9bbc7ebc2e49db118f7434b05..0000000000000000000000000000000000000000 --- a/entry/oh_modules/myhar/src/main/ets/components/MainPage.ets +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2024 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. - */ -// [Start import] -import BuildProfile from '../../../../BuildProfile'; -import { OfficialSecond } from '../../../official_pages/OfficialSecondPage'; -import { TestSecond } from '../../../test_pages/TestSecondPage'; -// [End import] -@Component -export struct MainPage { - // [Start page_Info] - @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); - - @Builder - PagesMap(name: string) { - if (name == 'official') { //According to the user-defined parameter value, if the value is Official, the second page of official will jump correspondingly. - OfficialSecond(); - } else { - TestSecond(); - } - } - // [End page_Info] - - build() { - Navigation(this.pageInfos) { - Row() { - Column() { - // [Start text_Area] - TextArea({ text: $r('app.string.title_description') }) - .fontSize(16) - .width('100%') - .fontColor('#e6000000') - .fontWeight(FontWeight.Normal) - .borderRadius(16) - .focusable(false) - Image($r('app.media.HarImage')) - .width('100%') - .borderRadius(12) - .padding({ top: 16 }) - // [End text_Area] - Blank() - // [Start btn] - Button($r('app.string.button_describe')) - .fontSize(16) - .height(40) - .width('100%') - .onClick(() => { - this.pageInfos.pushPath({ name: BuildProfile.productName }); - }) - // [End btn] - } - .width('100%') - .height('100%') - .padding({ left: 16, right: 16, bottom: 16 }) - } - .height('100%') - } - .navDestination(this.PagesMap) - .hideTitleBar(true) - } -} \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 7db78edd13758206126b42268d73649f192ad3bc..e13a98bb3e0c5a0f24840857e7a272869d8ed302 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -13,7 +13,6 @@ * limitations under the License. */ import { MainPage } from 'myhar' -// [Start main_page] import { getName, getTitleName } from 'entry/VersionInfo' @Entry @@ -37,7 +36,6 @@ struct Index { .height(19) .margin({ top: 2 }) } - // [StartExclude main_page] .height(78) .width('100%') .alignItems(HorizontalAlign.Start) @@ -53,14 +51,10 @@ struct Index { .backgroundColor('#F1F3F5') } .layoutWeight(1) - // [EndExclude main_page] } - // [StartExclude main_page] .width('100%') .height('100%') .backgroundColor('#F1F3F5') .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) - // [EndExclude main_page] } -} -// [End main_page] \ No newline at end of file +} \ No newline at end of file diff --git a/entry/src/official_pages/VersionInfo.ets b/entry/src/official_pages/VersionInfo.ets index 38bd207fa3fa2948f2a0fa1833ba09bcd3d62b58..ffbd127da422fcb1657aec5de867642ea4630341 100644 --- a/entry/src/official_pages/VersionInfo.ets +++ b/entry/src/official_pages/VersionInfo.ets @@ -12,7 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start getName] export const getName = () => "This is official version." -export const getTitleName = () => $r('app.string.title') -// [End getName] \ No newline at end of file +export const getTitleName = () => $r('app.string.title') \ No newline at end of file diff --git a/entry/src/test_pages/VersionInfo.ets b/entry/src/test_pages/VersionInfo.ets index 3796036af6db2272ffe02b6e6ed7c1837878a4b4..c38a68b517274e806b6d1983df7b6880da2cfbce 100644 --- a/entry/src/test_pages/VersionInfo.ets +++ b/entry/src/test_pages/VersionInfo.ets @@ -12,7 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start test] export const getName = () => "This is test version." -export const getTitleName = () => $r('app.string.title') -// [End test] \ No newline at end of file +export const getTitleName = () => $r('app.string.title') \ No newline at end of file diff --git a/myhar/build-profile.json5 b/myhar/build-profile.json5 index 965610ea7d3ca50109bab62631e7999f20c1bf4b..95a23bdfb828ff83c348b8e504c419ad0d90b257 100644 --- a/myhar/build-profile.json5 +++ b/myhar/build-profile.json5 @@ -18,7 +18,6 @@ }, }, ], - // [Start official] "targets": [ { "name": "official", @@ -81,6 +80,5 @@ ] } } - ], - // [End official] + ] } diff --git a/myhar/src/main/ets/components/MainPage.ets b/myhar/src/main/ets/components/MainPage.ets index b0781b02821d83c9bbc7ebc2e49db118f7434b05..4fed1c1172b5e4f9044de664ea328a55b0300d25 100644 --- a/myhar/src/main/ets/components/MainPage.ets +++ b/myhar/src/main/ets/components/MainPage.ets @@ -12,31 +12,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// [Start import] import BuildProfile from '../../../../BuildProfile'; import { OfficialSecond } from '../../../official_pages/OfficialSecondPage'; import { TestSecond } from '../../../test_pages/TestSecondPage'; -// [End import] + @Component export struct MainPage { - // [Start page_Info] @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); @Builder PagesMap(name: string) { - if (name == 'official') { //According to the user-defined parameter value, if the value is Official, the second page of official will jump correspondingly. + if (name == 'official') { OfficialSecond(); } else { TestSecond(); } } - // [End page_Info] build() { Navigation(this.pageInfos) { Row() { Column() { - // [Start text_Area] TextArea({ text: $r('app.string.title_description') }) .fontSize(16) .width('100%') @@ -48,9 +44,7 @@ export struct MainPage { .width('100%') .borderRadius(12) .padding({ top: 16 }) - // [End text_Area] Blank() - // [Start btn] Button($r('app.string.button_describe')) .fontSize(16) .height(40) @@ -58,7 +52,6 @@ export struct MainPage { .onClick(() => { this.pageInfos.pushPath({ name: BuildProfile.productName }); }) - // [End btn] } .width('100%') .height('100%') diff --git a/myhar/src/official_pages/OfficialSecondPage.ets b/myhar/src/official_pages/OfficialSecondPage.ets index 77f169331f06b18973ed91dd0082f2a7b236660d..c5b9e430a6fa76448ddb7d1cc52561cfbc732971 100644 --- a/myhar/src/official_pages/OfficialSecondPage.ets +++ b/myhar/src/official_pages/OfficialSecondPage.ets @@ -30,7 +30,7 @@ export struct OfficialSecond { } customToast(str: ResourceStr) { - this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }) + promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) } build() { diff --git a/myhar/src/test_pages/TestSecondPage.ets b/myhar/src/test_pages/TestSecondPage.ets index 91ff3e74e851b2072703e86fb59f013f71a27f5c..f6d492bed7a11cf44585713ae87a02806474c2fa 100644 --- a/myhar/src/test_pages/TestSecondPage.ets +++ b/myhar/src/test_pages/TestSecondPage.ets @@ -44,7 +44,7 @@ export struct TestSecond { } customToast(str: ResourceStr) { - this.getUIContext().getPromptAction().showToast({ message: str, duration: 2000, bottom: '80vp' }) + promptAction.showToast({ message: str, duration: 2000, bottom: '80vp' }) } build() {