From f4881e439658167c94f9c4aa84828468e4d0efbc Mon Sep 17 00:00:00 2001 From: "xlleng110@163.com" Date: Mon, 13 Mar 2023 20:21:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/Logger.ets} | 81 +++--- .../main/ets/entryability/EntryAbility.ets | 38 +++ .../entry/src/main/ets/pages/IndexPage.ets | 7 +- .../PagesRouter/entry/src/main/module.json5 | 6 +- Ability/PagesRouter/package.json | 32 +-- .../main/ets/DetailsAbility/DetailsAbility.ts | 6 +- .../main/ets/common/constants/Constants.ets | 15 +- .../src/main/ets/entryability/EntryAbility.ts | 2 +- .../entry/src/main/ets/pages/DetailsPage.ets | 4 +- .../entry/src/main/ets/pages/NavPage.ets | 8 +- .../src/main/ets/view/ToolBarComponent.ets | 7 +- .../ets/view/details/ServiceItemComponent.ets | 2 +- .../ets/view/details/ServicesComponent.ets | 2 +- .../main/ets/view/home/BannerComponent.ets | 6 +- .../src/main/ets/view/home/GoodsComponent.ets | 2 +- .../entry/src/main/ets/view/home/HomePage.ets | 5 +- .../src/main/ets/view/home/MenusComponent.ets | 2 +- .../src/main/ets/view/home/TabsComponent.ets | 5 +- .../src/main/ets/viewmodel/HomeViewModel.ets | 5 +- .../entry/src/main/module.json5 | 4 + Ability/StageAbilityDemo/package.json | 32 +-- .../ets/common/constants/StyleConstants.ets | 4 +- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../src/main/ets/model/PreferenceModel.ets | 8 +- .../src/main/ets/view/ButtonComponent.ets | 2 +- Data/Preferences/entry/src/main/module.json5 | 4 + Data/Preferences/package.json | 32 +-- Data/Rdb/build-profile.json5 | 1 + .../ets/common/constants/CommonConstants.ets | 2 +- .../src/main/ets/common/database/Rdb.ets | 5 +- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../src/main/ets/view/DialogComponent.ets | 14 +- Data/Rdb/entry/src/main/module.json5 | 4 + Data/Rdb/package.json | 32 +-- .../ets/common/constants/RefreshConstants.ets | 12 +- .../main/ets/common/utils/DimensionUtil.ets | 4 +- .../src/main/ets/entryAbility/EntryAbility.ts | 2 +- .../src/main/ets/pages/FileManagerIndex.ets | 2 +- .../src/main/ets/view/RefreshAnimHeader.ets | 4 +- .../src/main/ets/view/RefreshComponent.ets | 2 +- .../main/ets/view/RefreshDefaultHeader.ets | 2 +- .../entry/src/main/module.json5 | 4 + ETSUI/AnimateRefresh/package.json | 32 +-- .../src/main/ets/common/bean/IconItem.ets | 7 +- .../src/main/ets/entryability/EntryAbility.ts | 6 +- .../entry/src/main/ets/pages/Index.ets | 9 +- .../src/main/ets/view/AnimationWidgets.ets | 10 +- .../src/main/ets/view/CountController.ets | 2 +- .../entry/src/main/ets/view/IconAnimation.ets | 8 +- .../src/main/ets/viewmodel/IconsModel.ets | 32 ++- ETSUI/Animation/entry/src/main/module.json5 | 4 + .../main/resources/base/element/color.json | 4 + ETSUI/Animation/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 2 +- .../entry/src/main/ets/pages/LoginPage.ets | 154 ++++++----- .../entry/src/main/ets/pages/MainPage.ets | 26 +- .../entry/src/main/ets/view/Home.ets | 6 +- .../entry/src/main/ets/view/Setting.ets | 6 +- .../entry/src/main/module.json5 | 4 + ETSUI/ArkTSComponents/package.json | 32 +-- .../ets/common/constants/CommonConstants.ets | 20 +- .../main/ets/entryability/EntryAbility.ets | 10 +- .../src/main/ets/pages/AdvertisingPage.ets | 25 +- .../entry/src/main/ets/pages/LauncherPage.ets | 30 +- .../entry/src/main/ets/pages/PrivacyPage.ets | 4 +- .../main/ets/view/CustomDialogComponent.ets | 11 +- .../entry/src/main/module.json5 | 4 + .../main/resources/base/element/float.json | 8 + ETSUI/FirstStartDemo/package.json | 4 +- ETSUI/Healthy_life/LICENSE | 78 ++++++ .../ets/common/constants/CommonConstants.ets | 1 + .../src/main/ets/common/database/Rdb.ets | 7 +- .../common/reminderagent/ReminderAgent.ets | 82 ------ .../src/main/ets/entryability/EntryAbility.ts | 59 ++-- .../entry/src/main/ets/model/TaskInitList.ets | 2 +- .../src/main/ets/pages/AdvertisingPage.ets | 4 +- .../entry/src/main/ets/pages/MainPage.ets | 2 +- .../entry/src/main/ets/pages/SplashPage.ets | 17 +- .../entry/src/main/ets/pages/TaskEditPage.ets | 1 + .../entry/src/main/ets/pages/TaskListPage.ets | 1 + .../entry/src/main/ets/view/HomeComponent.ets | 49 +++- .../main/ets/view/dialog/CustomDialogView.ets | 38 +-- .../main/ets/view/dialog/TaskDetailDialog.ets | 3 +- .../main/ets/view/dialog/TaskDialogView.ets | 76 ++++++ .../ets/view/dialog/TaskSettingDialog.ets | 2 +- .../main/ets/view/home/HomeTopComponent.ets | 2 +- .../ets/view/home/WeekCalendarComponent.ets | 8 +- .../ets/view/task/TaskDetailComponent.ets | 86 +++--- .../main/ets/view/task/TaskListComponent.ets | 2 +- .../src/main/ets/viewmodel/HomeViewModel.ets | 20 +- .../src/main/ets/viewmodel/TaskViewModel.ets | 65 +---- .../Healthy_life/entry/src/main/module.json5 | 11 +- .../main/resources/base/element/color.json | 4 - .../main/resources/base/element/string.json | 33 +-- .../resources/base/profile/form_config.json | 38 +++ .../main/resources/en_US/element/string.json | 184 ------------- .../main/resources/zh_CN/element/string.json | 180 ------------ ETSUI/Healthy_life/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../entry/src/main/ets/pages/ListIndex.ets | 1 + ETSUI/List/entry/src/main/module.json5 | 4 + .../main/resources/zh_CN/element/string.json | 4 + ETSUI/List/package.json | 32 +-- .../ets/common/constants/CommonConstant.ets | 5 +- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../entry/src/main/ets/model/TaskInitList.ets | 2 +- .../src/main/ets/pages/ListIndexPage.ets | 1 + .../entry/src/main/ets/pages/TaskEditPage.ets | 1 + .../entry/src/main/ets/view/TaskDetail.ets | 123 ++++----- .../entry/src/main/ets/view/TaskList.ets | 2 +- .../src/main/ets/view/TaskSettingDialog.ets | 2 +- ETSUI/List_HDC/entry/src/main/module.json5 | 4 + ETSUI/List_HDC/package.json | 32 +-- ETSUI/Multi_device/build-profile.json5 | 1 + .../ets/common/constants/CommonConstants.ets | 2 +- .../src/main/ets/entryability/EntryAbility.ts | 12 +- .../entry/src/main/ets/pages/Home.ets | 2 +- .../Multi_device/entry/src/main/module.json5 | 4 + ETSUI/Multi_device/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 2 +- .../src/main/ets/pages/LayoutAlignIndex.ets | 4 +- .../entry/src/main/ets/pages/Second.ets | 10 +- .../ets/view/ColumnAxisAlignRadioList.ets | 4 +- .../ets/view/ColumnMainAlignRadioList.ets | 20 +- .../src/main/ets/view/ColumnShowList.ets | 9 +- .../main/ets/view/FlexAxisAlignRadioList.ets | 4 +- .../main/ets/view/FlexMainAlignRadioList.ets | 4 +- .../ets/view/FlexMainDirectionRadioList.ets | 4 +- .../entry/src/main/ets/view/FlexShowList.ets | 2 +- .../main/ets/view/RowAxisAlignRadioList.ets | 4 +- .../main/ets/view/RowMainAlignRadioList.ets | 4 +- .../entry/src/main/ets/view/RowShowList.ets | 10 +- .../src/main/ets/view/StackAlignRadioList.ets | 14 +- .../src/main/ets/view/StackComponent.ets | 7 +- .../OHLayoutAlign/entry/src/main/module.json5 | 5 + ETSUI/OHLayoutAlign/package.json | 8 +- .../src/main/ets/entryability/EntryAbility.ts | 2 +- .../entry/src/main/ets/pages/RankPage.ets | 29 +- .../src/main/ets/view/TitleComponent.ets | 4 +- ETSUI/RankingDemo/entry/src/main/module.json5 | 4 + ETSUI/RankingDemo/package.json | 34 +-- ETSUI/SetAppFontSize/build-profile.json5 | 2 +- .../main/ets/entryability/EntryAbility.ets | 4 +- .../entry/src/main/ets/pages/HomePage.ets | 12 +- .../src/main/ets/view/TitleBarComponent.ets | 2 +- .../entry/src/main/module.json5 | 4 + .../main/resources/base/element/float.json | 6 +- ETSUI/SetAppFontSize/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 2 +- .../entry/src/main/ets/pages/SliderPage.ets | 7 +- .../SliderExample/entry/src/main/module.json5 | 4 + ETSUI/SliderExample/package.json | 6 +- .../ets/common/constants/CommonConstants.ets | 22 +- .../main/ets/common/utils/DimensionUtil.ets | 2 +- .../src/main/ets/entryAbility/EntryAbility.ts | 4 +- .../entry/src/main/ets/pages/Index.ets | 21 +- .../entry/src/main/ets/pages/ShareItem.ets | 11 +- .../entry/src/main/module.json5 | 4 + ETSUI/TransitionAnimation/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 6 +- .../entry/src/main/ets/pages/MainPage.ets | 1 + .../entry/src/main/ets/pages/WebPage.ets | 8 +- .../WebComponent/entry/src/main/module.json5 | 4 + .../src/main/resources/rawfile/js/index.js | 2 +- ETSUI/WebComponent/package.json | 32 +-- ETSUI/WebCookie/LICENSE | 257 +++++------------- .../ets/common/constants/CommonConstant.ets | 21 +- .../src/main/ets/entryability/EntryAbility.ts | 33 +-- .../entry/src/main/ets/pages/Verify.ets | 10 +- .../entry/src/main/ets/pages/WebIndex.ets | 7 +- .../entry/src/main/ets/view/LinkButton.ets | 11 +- ETSUI/WebCookie/entry/src/main/module.json5 | 4 + .../main/resources/base/element/float.json | 12 + ETSUI/WebCookie/package.json | 32 +-- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../entry/src/main/ets/pages/TaskPage.ets | 2 +- .../entry/src/main/module.json5 | 4 + .../main/resources/base/media/right_grey.png | Bin 0 -> 282 bytes .../SuperVisualSample/package.json | 32 +-- .../src/main/ets/common/utils/DataUtils.ets | 4 +- .../main/ets/common/utils/PullDownRefresh.ets | 4 +- .../main/ets/common/utils/PullUpLoadMore.ets | 4 +- .../src/main/ets/entryability/EntryAbility.ts | 4 +- .../entry/src/main/ets/view/NewsItem.ets | 2 +- .../entry/src/main/ets/view/NewsList.ets | 2 +- .../entry/src/main/ets/view/RefreshLayout.ets | 5 - .../NewsDataArkTS/entry/src/main/module.json5 | 4 + NetworkManagement/NewsDataArkTS/package.json | 6 +- .../src/main/ets/entryability/EntryAbility.ts | 14 +- .../entry/src/main/ets/pages/MainPage.ets | 1 + .../src/main/ets/view/InnerComponent.ets | 3 +- .../entry/src/main/module.json5 | 12 +- .../main/resources/base/element/color.json | 4 - .../main/resources/base/element/string.json | 10 +- .../ThirdPartyLibrary/library/package.json | 22 +- .../main/ets/components/mainpage/Buttons.ets | 4 - .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../ThirdPartyLibrary/package.json | 32 +-- 198 files changed, 1517 insertions(+), 1739 deletions(-) rename Ability/PagesRouter/entry/src/main/ets/{entryability/EntryAbility.ts => common/utils/Logger.ets} (33%) create mode 100644 Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ets create mode 100644 ETSUI/Healthy_life/LICENSE delete mode 100644 ETSUI/Healthy_life/entry/src/main/ets/common/reminderagent/ReminderAgent.ets create mode 100644 ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDialogView.ets create mode 100644 ETSUI/Healthy_life/entry/src/main/resources/base/profile/form_config.json create mode 100644 ETSUI/WebCookie/entry/src/main/resources/base/element/float.json create mode 100644 EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/resources/base/media/right_grey.png create mode 100644 ThirdPartyComponents/ThirdPartyLibrary/library/src/main/resources/base/media/icon.png diff --git a/Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ts b/Ability/PagesRouter/entry/src/main/ets/common/utils/Logger.ets similarity index 33% rename from Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ts rename to Ability/PagesRouter/entry/src/main/ets/common/utils/Logger.ets index 2d6ae568..e10590ed 100644 --- a/Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ts +++ b/Ability/PagesRouter/entry/src/main/ets/common/utils/Logger.ets @@ -13,43 +13,44 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' - -export default class EntryAbility extends Ability { - onCreate(want, launchParam) { - console.log('[Demo] MainAbility onCreate'); - globalThis.abilityWant = want; - } - - onDestroy() { - console.log('[Demo] MainAbility onDestroy'); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log('[Demo] MainAbility onWindowStageCreate'); - - windowStage.loadContent('pages/IndexPage', (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)); - }); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log('[Demo] MainAbility onWindowStageDestroy'); - } - - onForeground() { - // Ability has brought to foreground - console.log('[Demo] MainAbility onForeground'); - } - - onBackground() { - // Ability has back to background - console.log('[Demo] MainAbility onBackground'); - } -}; +import hilog from '@ohos.hilog'; + +/** + * Common log for all features. + */ +export class Logger { + private domain: number; + private prefix: string; + private format: string = `%{public}s, %{public}s`; + + constructor(prefix: string) { + this.prefix = prefix; + this.domain = 0xFF00; + } + + debug(...args: any[]) { + hilog.debug(this.domain, this.prefix, this.format, args); + } + + info(...args: any[]) { + hilog.info(this.domain, this.prefix, this.format, args); + } + + warn(...args: any[]) { + hilog.warn(this.domain, this.prefix, this.format, args); + } + + error(...args: any[]) { + hilog.error(this.domain, this.prefix, this.format, args); + } + + fatal(...args: any[]) { + hilog.fatal(this.domain, this.prefix, this.format, args); + } + + isLoggable(level: number) { + hilog.isLoggable(this.domain, this.prefix, level); + } +} + +export default new Logger('[PageRouter]'); \ No newline at end of file diff --git a/Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ets b/Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 00000000..9a0462cb --- /dev/null +++ b/Ability/PagesRouter/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022 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. + */ + +import UIAbility from '@ohos.app.ability.UIAbility' +import Logger from '../common/utils/Logger'; + +const TAG = '[EntryAbility]'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + Logger.info(TAG, 'onCreate'); + globalThis.abilityWant = want; + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + Logger.info(TAG, 'onWindowStageCreate'); + windowStage.loadContent('pages/IndexPage', (err, data) => { + if (err.code) { + Logger.info(TAG, 'Failed to load the content. Cause:' + JSON.stringify(err)); + return; + } + Logger.info(TAG, 'Succeeded in loading the content. Data: ' + JSON.stringify(data)); + }); + } +}; diff --git a/Ability/PagesRouter/entry/src/main/ets/pages/IndexPage.ets b/Ability/PagesRouter/entry/src/main/ets/pages/IndexPage.ets index 0ad7ba8f..b3594ed3 100644 --- a/Ability/PagesRouter/entry/src/main/ets/pages/IndexPage.ets +++ b/Ability/PagesRouter/entry/src/main/ets/pages/IndexPage.ets @@ -15,6 +15,9 @@ import router from '@ohos.router'; import CommonConstants from '../common/constants/CommonConstants'; +import Logger from '../common/utils/Logger'; + +const TAG = '[IndexPage]'; /** * The IndexPage is the entry point of the application. @@ -37,11 +40,13 @@ struct IndexPage { .height(CommonConstants.BUTTON_HEIGHT) .backgroundColor($r('app.color.button_bg')) .onClick(() => { - router.push({ + router.pushUrl({ url: CommonConstants.SECOND_URL, params: { src: CommonConstants.SECOND_SRC_MSG } + }).catch((error) => { + Logger.info(TAG, 'IndexPage push error' + JSON.stringify(error)); }); }) } diff --git a/Ability/PagesRouter/entry/src/main/module.json5 b/Ability/PagesRouter/entry/src/main/module.json5 index f750bc4b..3d51a6a4 100644 --- a/Ability/PagesRouter/entry/src/main/module.json5 +++ b/Ability/PagesRouter/entry/src/main/module.json5 @@ -11,10 +11,14 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", - "srcEntrance": "./ets/entryability/EntryAbility.ts", + "srcEntrance": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", diff --git a/Ability/PagesRouter/package.json b/Ability/PagesRouter/package.json index b41d1ab3..b634df4e 100644 --- a/Ability/PagesRouter/package.json +++ b/Ability/PagesRouter/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "pagesrouter", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1-rc27", - "@ohos/hvigor": "1.3.1-rc27" - } + "license": "ISC", + "devDependencies": {}, + "name": "pagesrouter", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/DetailsAbility/DetailsAbility.ts b/Ability/StageAbilityDemo/entry/src/main/ets/DetailsAbility/DetailsAbility.ts index 5e2886ea..9c95a4f2 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/DetailsAbility/DetailsAbility.ts +++ b/Ability/StageAbilityDemo/entry/src/main/ets/DetailsAbility/DetailsAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability'; +import Ability from '@ohos.app.ability.UIAbility'; const TAG: string = 'DetailsAbility'; const KEY: string = 'GoodsPosition'; @@ -37,10 +37,10 @@ export default class DetailsAbility extends Ability { windowStage.loadContent('pages/DetailsPage', (err, data) => { if (err.code) { - hilog.error(DETAIL_ABILITY_DOMAIN, TAG, 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + hilog.error(DETAIL_ABILITY_DOMAIN, TAG, 'Failed. Cause: %{public}s', JSON.stringify(err) ?? ''); return; } - hilog.info(DETAIL_ABILITY_DOMAIN, TAG, 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + hilog.info(DETAIL_ABILITY_DOMAIN, TAG, 'Succeeded. Data: %{public}s', JSON.stringify(data) ?? ''); }); } diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets b/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets index 72abc29d..615d403b 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/common/constants/Constants.ets @@ -40,15 +40,20 @@ export { AppFontSize, AppFontWeight }; export const PERCENTAGE_100 = '100%'; /** - * The percentage of 23. + * The percentage of 20. */ -export const PERCENTAGE_23 = '23%'; +export const PERCENTAGE_20 = '20%'; /** * The percentage of 50. */ export const PERCENTAGE_50 = '50%'; +/** + * The text margin of 18. + */ +export const Text_Margin = 18; + /** * The style of CardComponent. */ @@ -221,9 +226,13 @@ export const DetailsPageStyle = { /** * The image size for more action. */ - IMAGE_SIZE_MORE: 14, + IMAGE_SIZE_MORE: 14 }; +/** + * ability name. + */ +export const DETAILS_ABILITY_NAME = 'DetailsAbility' diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/entryability/EntryAbility.ts b/Ability/StageAbilityDemo/entry/src/main/ets/entryability/EntryAbility.ts index f4b294e4..301a3570 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/entryability/EntryAbility.ts +++ b/Ability/StageAbilityDemo/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' const TAG: string = 'EntryAbility'; diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/pages/DetailsPage.ets b/Ability/StageAbilityDemo/entry/src/main/ets/pages/DetailsPage.ets index 00e01ec3..5235520d 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/pages/DetailsPage.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/pages/DetailsPage.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import AppContext from '@ohos.application.context'; +import AppContext from '@ohos.app.ability.common'; import { DetailsPageStyle, PERCENTAGE_100 } from '../common/constants/Constants'; import AddressComponent from '../view/details/AddressComponent'; import PickerComponent from '../view/details/PickerComponent'; @@ -77,7 +77,7 @@ struct DetailsPage { Image($rawfile('detail/detail_back.png')) .setTopImageStyle() .onClick(() => { - let handler = getContext(this) as AppContext.AbilityContext; + let handler = getContext(this) as AppContext.UIAbilityContext; handler.terminateSelf(); }) } diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/pages/NavPage.ets b/Ability/StageAbilityDemo/entry/src/main/ets/pages/NavPage.ets index 60186a33..e04f9725 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/pages/NavPage.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/pages/NavPage.ets @@ -37,7 +37,7 @@ let viewModel: NavViewModel = new NavViewModel(); @Component struct NavPage { @State toolBarConfigs: ToolBarData[] = []; // bottom navigation data. - @State navCurrentPosition: number = NavPageStyle.POSITION_INITIAL; + navCurrentPosition: number = NavPageStyle.POSITION_INITIAL; private controller: TabsController = new TabsController(); aboutToAppear() { @@ -55,7 +55,7 @@ struct NavPage { this.HolderPage(item?.text) } } - }, item => item.toString()) + }, item => JSON.stringify(item)) }.setTabStyle() } .toolBar(this.ToolBarBuilder()) @@ -66,8 +66,10 @@ struct NavPage { ToolBarComponent({ controller: this.controller, toolBarConfigs: this.toolBarConfigs, - navCurrentPosition: $navCurrentPosition + navCurrentPosition: this.navCurrentPosition }) + .backgroundColor(Color.White) + .height(PERCENTAGE_100) } @Builder HolderPage(text: Resource) { diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/ToolBarComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/ToolBarComponent.ets index 1f504ffd..e18903f3 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/ToolBarComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/ToolBarComponent.ets @@ -15,10 +15,11 @@ import ToolBarData from '../common/bean/ToolBarData'; import { AppFontSize, AppFontWeight, PERCENTAGE_100, ToolBarStyle } from '../common/constants/Constants'; +import { NavPageStyle } from '../common/constants/Constants'; @Component export default struct ToolBarComponent { - @Link navCurrentPosition: number; + @State navCurrentPosition: number = NavPageStyle.POSITION_INITIAL;; toolBarConfigs: ToolBarData[]; controller: TabsController; @@ -46,11 +47,9 @@ export default struct ToolBarComponent { this.navCurrentPosition = item.num this.controller.changeIndex(this.navCurrentPosition) }) - }) + }, item => JSON.stringify(item)) } } - .backgroundColor(Color.White) - .height(PERCENTAGE_100) } } diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServiceItemComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServiceItemComponent.ets index fafc9db8..9700882b 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServiceItemComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServiceItemComponent.ets @@ -19,7 +19,7 @@ import { GoodsServiceItem } from '../../common/constants/DetailsConstants'; @Component export default struct ServiceItemComponent { serviceName: string; - @Prop description: string; + description: string; isShowActionMore: boolean; build() { diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServicesComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServicesComponent.ets index b2dfe7f0..fc038663 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServicesComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/details/ServicesComponent.ets @@ -38,7 +38,7 @@ export default struct ServicesComponent { isShowActionMore: item?.name != null }) } - }, (item) => (item?.id).toString()) + }, item => JSON.stringify(item)) } .width(PERCENTAGE_100) diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/BannerComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/BannerComponent.ets index 3d190231..b256aed9 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/BannerComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/BannerComponent.ets @@ -15,7 +15,7 @@ import BannerData from '../../common/bean/BannerData'; import { Banner } from '../../common/constants/HomeConstants'; -import { PERCENTAGE_100, PERCENTAGE_23 } from '../../common/constants/Constants'; +import { PERCENTAGE_100, PERCENTAGE_20 } from '../../common/constants/Constants'; @Component export default struct BannerComponent { @@ -28,7 +28,7 @@ export default struct BannerComponent { Image(item.imgSrc) .width(PERCENTAGE_100) .objectFit(ImageFit.Contain) - }) + }, item => JSON.stringify(item)) } .cachedCount(Banner.CACHE_COUNT) .index(Banner.POSITION) @@ -47,6 +47,6 @@ export default struct BannerComponent { .curve(Curve.Linear) } .width(Banner.WIDTH) - .height(PERCENTAGE_23) + .height(PERCENTAGE_20) } } \ No newline at end of file diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/GoodsComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/GoodsComponent.ets index 201e0f03..831e286b 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/GoodsComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/GoodsComponent.ets @@ -31,7 +31,7 @@ export default struct GoodsComponent { }.onClick(() => { this.startPage(index); }) - }) + }, item => JSON.stringify(item)) } .columnsTemplate(GoodsList.GRID_STYLE) .columnsGap(GoodsList.SPACE) diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/HomePage.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/HomePage.ets index 5d4a2a6a..a126cea8 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/HomePage.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/HomePage.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import AppContext from '@ohos.application.context'; +import AppContext from '@ohos.app.ability.common'; import HomeViewModel from '../../viewmodel/HomeViewModel'; import TopBarComponent from './TopBarComponent'; import TabsComponent from './TabsComponent'; @@ -63,7 +63,8 @@ export default struct HomePage { let handler = getContext(this) as AppContext.Context; viewModel.startDetailsAbility(handler, index); } }) - }.width(PERCENTAGE_100) + } + .width(PERCENTAGE_100) } .height(PERCENTAGE_100) .backgroundImage($rawfile('index/index_background.png'), ImageRepeat.NoRepeat) diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/MenusComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/MenusComponent.ets index 257c5510..0d2ff09b 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/MenusComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/MenusComponent.ets @@ -37,7 +37,7 @@ export default struct MenusComponent { .width(Menus.LAYOUT_WEIGHT) .padding({ top: Menus.ITEM_PADDING_VERTICAL, bottom: Menus.ITEM_PADDING_VERTICAL }) - }) + }, item => JSON.stringify(item)) } .justifyContent(FlexAlign.Center) .padding({ top: Menus.CONTAINER_PADDING_VERTICAL, diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/TabsComponent.ets b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/TabsComponent.ets index ad39b956..4162475e 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/view/home/TabsComponent.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/view/home/TabsComponent.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AppFontSize, AppFontWeight, PERCENTAGE_100 } from '../../common/constants/Constants'; +import { AppFontSize, AppFontWeight, PERCENTAGE_100, Text_Margin } from '../../common/constants/Constants'; import { GoodsTabs } from '../../common/constants/HomeConstants'; @Component @@ -27,7 +27,7 @@ export default struct TabsComponent { TabContent() { } .tabBar(this.TabBuilder(index)) - }) + }, item => JSON.stringify(item)) } .vertical(false) .scrollable(true) @@ -63,6 +63,7 @@ export default struct TabsComponent { .fontSize(AppFontSize.MIDDLE) } .height(PERCENTAGE_100) + .margin({left:Text_Margin}) .justifyContent(FlexAlign.Center) .align(Alignment.Start) } diff --git a/Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/HomeViewModel.ets b/Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/HomeViewModel.ets index 8965491e..be92c5da 100644 --- a/Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/HomeViewModel.ets +++ b/Ability/StageAbilityDemo/entry/src/main/ets/viewmodel/HomeViewModel.ets @@ -18,6 +18,7 @@ import DataModel from '../model/DataModel'; import GoodsData from '../common/bean/GoodsData'; import BannerData from '../common/bean/BannerData'; import MenuData from '../common/bean/MenuData'; +import { DETAILS_ABILITY_NAME } from '../common/constants/Constants'; const TAG = 'HomeViewModel'; const HOME_PAGE_DOMAIN = 0x00004; @@ -41,8 +42,8 @@ export default class HomeViewModel { public startDetailsAbility(context, index: number): void { const want = { - bundleName: 'com.example.StageAbilityDemo', - abilityName: 'DetailsAbility', + bundleName: getContext(context).applicationInfo.name, + abilityName: DETAILS_ABILITY_NAME, parameters: { position: index } diff --git a/Ability/StageAbilityDemo/entry/src/main/module.json5 b/Ability/StageAbilityDemo/entry/src/main/module.json5 index 6f7ca468..3a2d798c 100644 --- a/Ability/StageAbilityDemo/entry/src/main/module.json5 +++ b/Ability/StageAbilityDemo/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "entryAbility", diff --git a/Ability/StageAbilityDemo/package.json b/Ability/StageAbilityDemo/package.json index f986bae0..ce972d9a 100644 --- a/Ability/StageAbilityDemo/package.json +++ b/Ability/StageAbilityDemo/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"stage_ability_demo", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "stage_ability_demo", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } \ No newline at end of file diff --git a/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets b/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets index 5a6bac71..a27734a8 100644 --- a/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets +++ b/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets @@ -80,7 +80,7 @@ class StyleConstants { /** * Big margin bottom */ - MARGIN_BOTTOM_BIG = '35%'; + MARGIN_BOTTOM_BIG = '390vp'; /** * The height of button component. @@ -95,7 +95,7 @@ class StyleConstants { /** * The bottom margin of the button component. */ - BUTTON_MARGIN_BOTTOM = '3%'; + BUTTON_MARGIN_BOTTOM = '24vp'; } export default new StyleConstants(); \ No newline at end of file diff --git a/Data/Preferences/entry/src/main/ets/entryability/EntryAbility.ts b/Data/Preferences/entry/src/main/ets/entryability/EntryAbility.ts index a548a4a6..77a95488 100644 --- a/Data/Preferences/entry/src/main/ets/entryability/EntryAbility.ts +++ b/Data/Preferences/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,6 +1,6 @@ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' -import Window from '@ohos.window' +import Ability from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; export default class EntryAbility extends Ability { onCreate(want, launchParam) { diff --git a/Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets b/Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets index 70f65fb0..62a18f5f 100644 --- a/Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets +++ b/Data/Preferences/entry/src/main/ets/model/PreferenceModel.ets @@ -14,14 +14,12 @@ */ import dataPreferences from '@ohos.data.preferences'; -import prompt from '@ohos.prompt'; -import ctx from '@ohos.application.context'; +import promptAction from '@ohos.promptAction'; import Logger from '../common/utils/Logger'; import CommonConstants from '../common/constants/CommonConstants'; import Fruit from '../common/bean/Fruit'; -// Get AbilityContext. -let context = getContext(this) as ctx.AbilityContext; +let context = getContext(this); let preference: dataPreferences.Preferences = null; /** @@ -143,7 +141,7 @@ class PreferenceModel { * @param message Prompt message. */ showToastMessage(message: Resource) { - prompt.showToast({ + promptAction.showToast({ message: message, duration: CommonConstants.DURATION }); diff --git a/Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets b/Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets index 348b8cd3..4b56ff14 100644 --- a/Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets +++ b/Data/Preferences/entry/src/main/ets/view/ButtonComponent.ets @@ -39,7 +39,7 @@ export default struct ButtonComponent { .onClick(() => { item.clickMethod(); }) - }, item => item.toString()) + }, item => JSON.stringify(item)) } } diff --git a/Data/Preferences/entry/src/main/module.json5 b/Data/Preferences/entry/src/main/module.json5 index 0e288c05..a9d83991 100644 --- a/Data/Preferences/entry/src/main/module.json5 +++ b/Data/Preferences/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/Data/Preferences/package.json b/Data/Preferences/package.json index 6df81826..b1ecadd1 100644 --- a/Data/Preferences/package.json +++ b/Data/Preferences/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "preferences", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "preferences", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/Data/Rdb/build-profile.json5 b/Data/Rdb/build-profile.json5 index fc53829b..d7b1117c 100644 --- a/Data/Rdb/build-profile.json5 +++ b/Data/Rdb/build-profile.json5 @@ -1,5 +1,6 @@ { "app": { + "signingConfigs": [], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ diff --git a/Data/Rdb/entry/src/main/ets/common/constants/CommonConstants.ets b/Data/Rdb/entry/src/main/ets/common/constants/CommonConstants.ets index 841517a8..260f354a 100644 --- a/Data/Rdb/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/Data/Rdb/entry/src/main/ets/common/constants/CommonConstants.ets @@ -45,7 +45,7 @@ export default class CommonConstants { */ static readonly FULL_WIDTH = '100%'; static readonly FULL_HEIGHT = '100%'; - static readonly DIALOG_HEIGHT = '60%'; + static readonly DIALOG_HEIGHT = '55%'; static readonly TABS_HEIGHT = '45%'; static readonly MINIMUM_SIZE = 0; static readonly FULL_SIZE = 1; diff --git a/Data/Rdb/entry/src/main/ets/common/database/Rdb.ets b/Data/Rdb/entry/src/main/ets/common/database/Rdb.ets index dbb2ac7d..0bada312 100644 --- a/Data/Rdb/entry/src/main/ets/common/database/Rdb.ets +++ b/Data/Rdb/entry/src/main/ets/common/database/Rdb.ets @@ -14,12 +14,9 @@ */ import data_rdb from '@ohos.data.rdb'; -import context from '@ohos.application.context'; import CommonConstants from '../constants/CommonConstants'; import { Logger } from '../utils/Logger'; -type Context = context.Context; - export default class Rdb { private rdbStore: any = null; private tableName: string; @@ -42,7 +39,7 @@ export default class Rdb { callback(); return } - var context: Context = getContext(this) as Context; + let context = getContext(this); data_rdb.getRdbStore(context, CommonConstants.STORE_CONFIG, 1, (err, rdb) => { if (err) { Logger.error(`${CommonConstants.RDB_TAG}`, 'gerRdbStore() failed, err: ' + err); diff --git a/Data/Rdb/entry/src/main/ets/entryability/EntryAbility.ts b/Data/Rdb/entry/src/main/ets/entryability/EntryAbility.ts index aa93509b..3d3b0b35 100644 --- a/Data/Rdb/entry/src/main/ets/entryability/EntryAbility.ts +++ b/Data/Rdb/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,10 +14,10 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' -export default class entryAbility extends Ability { +export default class entryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/Data/Rdb/entry/src/main/ets/view/DialogComponent.ets b/Data/Rdb/entry/src/main/ets/view/DialogComponent.ets index 631d55d0..b4d35c54 100644 --- a/Data/Rdb/entry/src/main/ets/view/DialogComponent.ets +++ b/Data/Rdb/entry/src/main/ets/view/DialogComponent.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import prompt from '@ohos.promptAction'; import AccountData from '../common/bean/AccountData'; import AccountItem from '../common/bean/AccountItem'; import { PayList, EarnList } from '../viewmodel/AccountList'; @@ -42,7 +42,13 @@ export struct DialogComponent { .width($r('app.float.component_size_MP')) .padding({ top: $r('app.float.edge_size_LM'), bottom: $r('app.float.edge_size_S') }) .margin({ bottom: $r('app.float.edge_size_S') }) - .border(this.curIndex === index ? { width: { bottom: $r('app.float.border_size_M') }, color: $r('app.color.main_color') } : {}) + .border(this.curIndex === index ? { width: { bottom: $r('app.float.border_size_M') }, color: $r('app.color.main_color') } : { color: Color.White }) + } + + aboutToAppear() { + this.inputAmount = this.newAccount.amount.toString(); + this.curIndex = this.newAccount.accountType; + this.curType = this.newAccount.typeText; } selectAccount(item: AccountItem) { @@ -60,7 +66,7 @@ export struct DialogComponent { this.controller.close(); }) - Tabs({ barPosition: BarPosition.Start }) { + Tabs({ barPosition: BarPosition.Start, index: this.curIndex }) { TabContent() { Scroll(this.scroller) { Row() { @@ -130,7 +136,7 @@ export struct DialogComponent { .width(CommonConstants.FULL_WIDTH) .height(CommonConstants.TABS_HEIGHT) .vertical(false) - .barMode(BarMode.Scrollable) + .barMode(BarMode.Fixed) .onChange((index) => { this.curIndex = index; }) diff --git a/Data/Rdb/entry/src/main/module.json5 b/Data/Rdb/entry/src/main/module.json5 index a14a4b9f..98eff6f5 100644 --- a/Data/Rdb/entry/src/main/module.json5 +++ b/Data/Rdb/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/Data/Rdb/package.json b/Data/Rdb/package.json index 462a951e..989aafd0 100644 --- a/Data/Rdb/package.json +++ b/Data/Rdb/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"rdb", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "rdb", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/common/constants/RefreshConstants.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/common/constants/RefreshConstants.ets index c02673fc..2644a8e8 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/common/constants/RefreshConstants.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/common/constants/RefreshConstants.ets @@ -47,12 +47,12 @@ export class RefreshConstants { /** * refresh state enum */ -export enum RefreshState { - IDLE, - DRAGGING, - DRAGGING_REFRESHABLE, - REFRESHING, - COMPLETE +export const RefreshState = { + IDLE: 0, + DRAGGING: 1, + DRAGGING_REFRESHABLE: 2, + REFRESHING: 3, + COMPLETE: 4 } /** diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/common/utils/DimensionUtil.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/common/utils/DimensionUtil.ets index 764ba9a8..e5d9c5b0 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/common/utils/DimensionUtil.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/common/utils/DimensionUtil.ets @@ -13,9 +13,7 @@ * limitations under the License. */ -import ctx from '@ohos.application.context'; - -let context = getContext(this) as ctx.Context; +let context = getContext(this); const DESIGN_WIDTH = 360; const DESIGN_HEIGHT = 780; diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/entryAbility/EntryAbility.ts b/ETSUI/AnimateRefresh/entry/src/main/ets/entryAbility/EntryAbility.ts index 805bb537..74180ac9 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/entryAbility/EntryAbility.ts +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/entryAbility/EntryAbility.ts @@ -15,7 +15,7 @@ import window from '@ohos.window'; import display from '@ohos.display'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility'; export default class MainAbility extends Ability { onCreate(want) { diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/pages/FileManagerIndex.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/pages/FileManagerIndex.ets index 51aea737..21023645 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/pages/FileManagerIndex.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/pages/FileManagerIndex.ets @@ -23,7 +23,7 @@ import DimensionUtil from '../common/utils/DimensionUtil'; */ @Component export default struct FileManagerIndex { - @Provide(RefreshConstants.REFRESH_STATE_TAG) state: RefreshState = RefreshState.REFRESHING; + @Provide(RefreshConstants.REFRESH_STATE_TAG) state: number = RefreshState.REFRESHING; @Builder ContentBody() { Image($r('app.media.bg_content')) diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshAnimHeader.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshAnimHeader.ets index 12093682..a3a4bdee 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshAnimHeader.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshAnimHeader.ets @@ -19,7 +19,7 @@ import DimensionUtil from '../common/utils/DimensionUtil'; @Component export default struct RefreshAnimHeader { - @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateCheck') state: RefreshState; + @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateCheck') state: number; @State iconWidth: number = CommonConstants.REFRESH_HEADER_ITEM_DEFAULT_WIDTH; private onStateCheck() { @@ -50,7 +50,7 @@ export default struct RefreshAnimHeader { if (this.state !== RefreshState.IDLE) { // stop animation when idle state. ForEach(CommonConstants.REFRESH_HEADER_FEATURE, (iconItem) => { this.AttrAnimIcons(iconItem) - }, item => item.toString()) + }, item => JSON.stringify(item)) } } .width(CommonConstants.FULL_LENGTH) diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshComponent.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshComponent.ets index 2623eec6..093c00d3 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshComponent.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshComponent.ets @@ -25,7 +25,7 @@ export default struct RefreshComponent { private listController: Scroller = new Scroller(); private onRefresh: () => void; @State headerOffset: number = 0; - @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateChanged') state: RefreshState; + @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateChanged') state: number; @BuilderParam itemLayout: () => void; private onStateChanged() { diff --git a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshDefaultHeader.ets b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshDefaultHeader.ets index cce1e2a2..e832beb0 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshDefaultHeader.ets +++ b/ETSUI/AnimateRefresh/entry/src/main/ets/view/RefreshDefaultHeader.ets @@ -20,7 +20,7 @@ import DimensionUtil from '../common/utils/DimensionUtil'; @Component export default struct RefreshDefaultHeader { @State refreshTitle: Resource = $r('app.string.refresh_default_header_hint'); - @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateCheck') state: RefreshState; + @Consume(RefreshConstants.REFRESH_STATE_TAG) @Watch('onStateCheck') state: number; private onStateCheck() { switch (this.state) { diff --git a/ETSUI/AnimateRefresh/entry/src/main/module.json5 b/ETSUI/AnimateRefresh/entry/src/main/module.json5 index 92941b53..fae94ed2 100644 --- a/ETSUI/AnimateRefresh/entry/src/main/module.json5 +++ b/ETSUI/AnimateRefresh/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "MainAbility", diff --git a/ETSUI/AnimateRefresh/package.json b/ETSUI/AnimateRefresh/package.json index 1621b0bd..0e938ad3 100644 --- a/ETSUI/AnimateRefresh/package.json +++ b/ETSUI/AnimateRefresh/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"refreshlayoutdemo", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "refreshlayoutdemo", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/Animation/entry/src/main/ets/common/bean/IconItem.ets b/ETSUI/Animation/entry/src/main/ets/common/bean/IconItem.ets index 8598954f..832ef003 100644 --- a/ETSUI/Animation/entry/src/main/ets/common/bean/IconItem.ets +++ b/ETSUI/Animation/entry/src/main/ets/common/bean/IconItem.ets @@ -13,14 +13,19 @@ * limitations under the License. */ +import Point from './Point'; + +@Observed export default class IconItem { index: number = 0; clicked: boolean = false; image: Resource = $r('app.media.badge1'); + point: Point = new Point(0, 0); - constructor(index: number, image: Resource, clicked: boolean) { + constructor(index: number, image: Resource, clicked: boolean, point: Point) { this.index = index; this.image = image; this.clicked = clicked; + this.point = point; } } \ No newline at end of file diff --git a/ETSUI/Animation/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/Animation/entry/src/main/ets/entryability/EntryAbility.ts index a548a4a6..b6e2b38a 100644 --- a/ETSUI/Animation/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/Animation/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,8 +1,8 @@ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' -import Window from '@ohos.window' +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/ETSUI/Animation/entry/src/main/ets/pages/Index.ets b/ETSUI/Animation/entry/src/main/ets/pages/Index.ets index 7c624bd1..6edaaddb 100644 --- a/ETSUI/Animation/entry/src/main/ets/pages/Index.ets +++ b/ETSUI/Animation/entry/src/main/ets/pages/Index.ets @@ -16,22 +16,19 @@ import { AnimationWidgets } from '../view/AnimationWidgets'; import { CountController } from '../view/CountController'; import Common from '../common/constants/Const'; -import { AxisModel } from '../viewmodel/AxisModel'; import {IconsModel} from '../viewmodel/IconsModel'; @Entry @Component struct Index { @State quantity: number = Common.IMAGES_MIN; - @State axis: AxisModel = new AxisModel(Common.OFFSET_RADIUS, this.quantity); - @State iconModel: IconsModel = new IconsModel(this.quantity); + @Provide iconModel: IconsModel = new IconsModel(this.quantity, Common.OFFSET_RADIUS); + build() { Column() { AnimationWidgets({ - quantity: $quantity, - axis: this.axis, - iconModel: this.iconModel + quantity: $quantity }) CountController({ diff --git a/ETSUI/Animation/entry/src/main/ets/view/AnimationWidgets.ets b/ETSUI/Animation/entry/src/main/ets/view/AnimationWidgets.ets index add96b41..2da7fb36 100644 --- a/ETSUI/Animation/entry/src/main/ets/view/AnimationWidgets.ets +++ b/ETSUI/Animation/entry/src/main/ets/view/AnimationWidgets.ets @@ -13,7 +13,6 @@ * limitations under the License. */ -import { AxisModel } from '../viewmodel/AxisModel'; import { IconsModel } from '../viewmodel/IconsModel'; import { IconAnimation } from './IconAnimation'; import Common from '../common/constants/Const'; @@ -23,12 +22,10 @@ import IconItem from '../common/bean/IconItem'; export struct AnimationWidgets { @State mainFlag: boolean = false; @Link @Watch('onQuantityChange') quantity: number; - @ObjectLink axis: AxisModel; - @ObjectLink iconModel: IconsModel; + @Consume iconModel: IconsModel; onQuantityChange() { this.iconModel.addImage(this.quantity); - this.axis.addPoints(this.quantity); } aboutToAppear() { @@ -55,11 +52,12 @@ export struct AnimationWidgets { ForEach(this.iconModel.imagerArr, (item: IconItem) => { IconAnimation({ item: item, - point: this.axis.points[item.index], mainFlag: $mainFlag }) - }, item => JSON.stringify(item)) + }, item => JSON.stringify(item.index)) } + .width(Common.DEFAULT_FULL_WIDTH) + .height(Common.DEFAULT_FULL_HEIGHT) .rotate({ x: 0, y: 0, diff --git a/ETSUI/Animation/entry/src/main/ets/view/CountController.ets b/ETSUI/Animation/entry/src/main/ets/view/CountController.ets index 90e5e4cc..51eed5dc 100644 --- a/ETSUI/Animation/entry/src/main/ets/view/CountController.ets +++ b/ETSUI/Animation/entry/src/main/ets/view/CountController.ets @@ -33,7 +33,7 @@ export struct CountController { style: SliderStyle.InSet }) .blockColor(Color.White) - .selectedColor('#007DFF') + .selectedColor($r('app.color.SliderSelectColor')) .margin({ top: $r('app.float.size_5') }) diff --git a/ETSUI/Animation/entry/src/main/ets/view/IconAnimation.ets b/ETSUI/Animation/entry/src/main/ets/view/IconAnimation.ets index d73954a4..2f13356d 100644 --- a/ETSUI/Animation/entry/src/main/ets/view/IconAnimation.ets +++ b/ETSUI/Animation/entry/src/main/ets/view/IconAnimation.ets @@ -14,14 +14,12 @@ */ import IconItem from '../common/bean/IconItem'; -import Point from '../common/bean/Point'; import Common from '../common/constants/Const'; @Component export struct IconAnimation { @Link mainFlag: boolean; - @State point: Point = new Point(0, 0); - @State item: IconItem = new IconItem(0, $r('app.media.badge1'), false); + @ObjectLink item: IconItem; build() { Image(this.item.image) @@ -30,8 +28,8 @@ export struct IconAnimation { .objectFit(ImageFit.Contain) .translate( this.mainFlag - ? { x: this.point.x, y: this.point.y } - : { x: 0, y: 0 } + ? { x: this.item.point.x, y: this.item.point.y } + : { x: 0, y: 0 } ) .rotate({ x: 0, diff --git a/ETSUI/Animation/entry/src/main/ets/viewmodel/IconsModel.ets b/ETSUI/Animation/entry/src/main/ets/viewmodel/IconsModel.ets index 7eaab7b6..61f515ac 100644 --- a/ETSUI/Animation/entry/src/main/ets/viewmodel/IconsModel.ets +++ b/ETSUI/Animation/entry/src/main/ets/viewmodel/IconsModel.ets @@ -15,24 +15,50 @@ import Common from '../common/constants/Const'; import IconItem from '../common/bean/IconItem'; +import Point from '../common/bean/Point'; + +const TWO_PI: number = 2 * Math.PI; @Observed export class IconsModel { public imagerArr: Array = []; private num: number = Common.IMAGES_MIN; + private radius: number; - constructor(num: number) { + constructor(num: number, radius) { + this.radius = radius; this.addImage(num); } public addImage(num) { - this.imagerArr = []; this.num = num; + if (this.imagerArr.length == num) { + return; + } + if (this.imagerArr.length > num) { + this.imagerArr.splice(num, this.imagerArr.length - num); + } else { + for (let i = this.imagerArr.length; i < num; i++) { + const point = this.genPointByIndex(i); + this.imagerArr.push(new IconItem(i, Common.IMAGE_RESOURCE[i], false, point)); + } + } + + this.refreshPoint(num); + } + + public refreshPoint(num) { for (let i = 0; i < num; i++) { - this.imagerArr.push(new IconItem(i, Common.IMAGE_RESOURCE[i], false)); + this.imagerArr[i].point = this.genPointByIndex(i); } } + public genPointByIndex(index: number): Point { + const x = this.radius * Math.cos(TWO_PI * index / this.num); + const y = this.radius * Math.sin(TWO_PI * index / this.num); + return new Point(x, y); + } + public reset() { for (let i = 0; i < this.num; i++) { if (this.imagerArr[i].clicked) { diff --git a/ETSUI/Animation/entry/src/main/module.json5 b/ETSUI/Animation/entry/src/main/module.json5 index cce9dc1b..b1615d0b 100644 --- a/ETSUI/Animation/entry/src/main/module.json5 +++ b/ETSUI/Animation/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/Animation/entry/src/main/resources/base/element/color.json b/ETSUI/Animation/entry/src/main/resources/base/element/color.json index f3a30322..fc81610c 100644 --- a/ETSUI/Animation/entry/src/main/resources/base/element/color.json +++ b/ETSUI/Animation/entry/src/main/resources/base/element/color.json @@ -15,6 +15,10 @@ { "name": "fontGrayColor", "value": "#182431" + }, + { + "name": "SliderSelectColor", + "value": "#007DFF" } ] } \ No newline at end of file diff --git a/ETSUI/Animation/package.json b/ETSUI/Animation/package.json index 1b87fd4f..2fa70451 100644 --- a/ETSUI/Animation/package.json +++ b/ETSUI/Animation/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"animation", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "animation", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/ArkTSComponents/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/ArkTSComponents/entry/src/main/ets/entryability/EntryAbility.ts index 4005db22..ddd8c52a 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/ArkTSComponents/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability'; +import Ability from '@ohos.app.ability.UIAbility'; import Window from '@ohos.window'; /** diff --git a/ETSUI/ArkTSComponents/entry/src/main/ets/pages/LoginPage.ets b/ETSUI/ArkTSComponents/entry/src/main/ets/pages/LoginPage.ets index 3d0dca89..b1eca42b 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/ets/pages/LoginPage.ets +++ b/ETSUI/ArkTSComponents/entry/src/main/ets/pages/LoginPage.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import prompt from '@ohos.promptAction'; import router from '@ohos.router'; import CommonConstants from '../common/constants/CommonConstants'; @@ -70,7 +70,7 @@ struct LoginPage { this.timeOutId = setTimeout(() => { this.isShowProgress = false; this.timeOutId = null; - router.replace({ url: 'pages/MainPage' }); + router.replaceUrl({ url: 'pages/MainPage' }); }, CommonConstants.LOGIN_DELAY_TIME); } } @@ -82,90 +82,88 @@ struct LoginPage { } build() { - Scroll() { - Column() { - Image($r('app.media.logo')) - .width($r('app.float.logo_image_size')) - .height($r('app.float.logo_image_size')) - .margin({ top: $r('app.float.logo_margin_top'), bottom: $r('app.float.logo_margin_bottom') }) - Text($r('app.string.login_page')) - .fontSize($r('app.float.page_title_text_size')) - .fontWeight(FontWeight.Medium) - .fontColor($r('app.color.title_text_color')) - Text($r('app.string.login_more')) - .fontSize($r('app.float.normal_text_size')) - .fontColor($r('app.color.login_more_text_color')) - .margin({ bottom: $r('app.float.login_more_margin_bottom'), top: $r('app.float.login_more_margin_top') }) + Column() { + Image($r('app.media.logo')) + .width($r('app.float.logo_image_size')) + .height($r('app.float.logo_image_size')) + .margin({ top: $r('app.float.logo_margin_top'), bottom: $r('app.float.logo_margin_bottom') }) + Text($r('app.string.login_page')) + .fontSize($r('app.float.page_title_text_size')) + .fontWeight(FontWeight.Medium) + .fontColor($r('app.color.title_text_color')) + Text($r('app.string.login_more')) + .fontSize($r('app.float.normal_text_size')) + .fontColor($r('app.color.login_more_text_color')) + .margin({ bottom: $r('app.float.login_more_margin_bottom'), top: $r('app.float.login_more_margin_top') }) - TextInput({ placeholder: $r('app.string.account') }) - .maxLength(CommonConstants.INPUT_ACCOUNT_LENGTH) - .type(InputType.Number) - .inputStyle() - .onChange((value: string) => { - this.account = value; - }) - Line().lineStyle() + TextInput({ placeholder: $r('app.string.account') }) + .maxLength(CommonConstants.INPUT_ACCOUNT_LENGTH) + .type(InputType.Number) + .inputStyle() + .onChange((value: string) => { + this.account = value; + }) + Line().lineStyle() - TextInput({ placeholder: $r('app.string.password') }) - .maxLength(CommonConstants.INPUT_PASSWORD_LENGTH) - .type(InputType.Password) - .inputStyle() - .onChange((value: string) => { - this.password = value; - }) - Line().lineStyle() + TextInput({ placeholder: $r('app.string.password') }) + .maxLength(CommonConstants.INPUT_PASSWORD_LENGTH) + .type(InputType.Password) + .inputStyle() + .onChange((value: string) => { + this.password = value; + }) + Line().lineStyle() - Row() { - Text($r('app.string.message_login')).blueTextStyle() - Text($r('app.string.forgot_password')).blueTextStyle() - } - .justifyContent(FlexAlign.SpaceBetween) - .width(CommonConstants.FULL_PARENT) - .margin({ top: $r('app.float.forgot_margin_top') }) + Row() { + Text($r('app.string.message_login')).blueTextStyle() + Text($r('app.string.forgot_password')).blueTextStyle() + } + .justifyContent(FlexAlign.SpaceBetween) + .width(CommonConstants.FULL_PARENT) + .margin({ top: $r('app.float.forgot_margin_top') }) - Button($r('app.string.login'), { type: ButtonType.Capsule }) - .width(CommonConstants.BUTTON_WIDTH) - .height($r('app.float.login_button_height')) - .fontSize($r('app.float.normal_text_size')) - .fontWeight(FontWeight.Medium) - .backgroundColor($r('app.color.login_button_color')) - .margin({ top: $r('app.float.login_button_margin_top'), bottom: $r('app.float.login_button_margin_bottom') }) - .onClick(() => { - this.login(); - }) - Text($r('app.string.register_account')) - .fontColor($r('app.color.login_blue_text_color')) - .fontSize($r('app.float.normal_text_size')) - .fontWeight(FontWeight.Medium) + Button($r('app.string.login'), { type: ButtonType.Capsule }) + .width(CommonConstants.BUTTON_WIDTH) + .height($r('app.float.login_button_height')) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) + .backgroundColor($r('app.color.login_button_color')) + .margin({ top: $r('app.float.login_button_margin_top'), bottom: $r('app.float.login_button_margin_bottom') }) + .onClick(() => { + this.login(); + }) + Text($r('app.string.register_account')) + .fontColor($r('app.color.login_blue_text_color')) + .fontSize($r('app.float.normal_text_size')) + .fontWeight(FontWeight.Medium) - if (this.isShowProgress) { - LoadingProgress() - .color($r('app.color.loading_color')) - .width($r('app.float.login_progress_size')) - .height($r('app.float.login_progress_size')) - .margin({ top: $r('app.float.login_progress_margin_top') }) - } + if (this.isShowProgress) { + LoadingProgress() + .color($r('app.color.loading_color')) + .width($r('app.float.login_progress_size')) + .height($r('app.float.login_progress_size')) + .margin({ top: $r('app.float.login_progress_margin_top') }) + } - Blank() - Text($r('app.string.other_login_method')) - .fontColor($r('app.color.other_login_text_color')) - .fontSize($r('app.float.little_text_size')) - .fontWeight(FontWeight.Medium) - .margin({ top: $r('app.float.other_login_margin_top'), bottom: $r('app.float.other_login_margin_bottom') }) - Row({ space: CommonConstants.LOGIN_METHODS_SPACE }) { - this.imageButton($r('app.media.login_method1')) - this.imageButton($r('app.media.login_method2')) - this.imageButton($r('app.media.login_method3')) - } + Blank() + Text($r('app.string.other_login_method')) + .fontColor($r('app.color.other_login_text_color')) + .fontSize($r('app.float.little_text_size')) + .fontWeight(FontWeight.Medium) + .margin({ top: $r('app.float.other_login_margin_top'), bottom: $r('app.float.other_login_margin_bottom') }) + Row({ space: CommonConstants.LOGIN_METHODS_SPACE }) { + this.imageButton($r('app.media.login_method1')) + this.imageButton($r('app.media.login_method2')) + this.imageButton($r('app.media.login_method3')) } - .width(CommonConstants.FULL_PARENT) - .padding({ - left: $r('app.float.page_padding_hor'), - right: $r('app.float.page_padding_hor'), - bottom: $r('app.float.login_page_padding_bottom') - }) } - .height(CommonConstants.FULL_PARENT) .backgroundColor($r('app.color.background')) + .height(CommonConstants.FULL_PARENT) + .width(CommonConstants.FULL_PARENT) + .padding({ + left: $r('app.float.page_padding_hor'), + right: $r('app.float.page_padding_hor'), + bottom: $r('app.float.login_page_padding_bottom') + }) } } \ No newline at end of file diff --git a/ETSUI/ArkTSComponents/entry/src/main/ets/pages/MainPage.ets b/ETSUI/ArkTSComponents/entry/src/main/ets/pages/MainPage.ets index ca8fc609..1f462087 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/ets/pages/MainPage.ets +++ b/ETSUI/ArkTSComponents/entry/src/main/ets/pages/MainPage.ets @@ -23,29 +23,29 @@ import Setting from "../view/Setting" @Entry @Component struct MainPage { - @State index: number = CommonConstants.HOME_TAB_INDEX; + @State currentIndex: number = CommonConstants.HOME_TAB_INDEX; private tabsController: TabsController = new TabsController(); - @Builder baseTab(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) { + @Builder TabBuilder(title: string, index: number, selectedImg: Resource, normalImg: Resource) { Column() { - Image(this.index === targetIndex ? selectedImg : normalImg) + Image(this.currentIndex === index ? selectedImg : normalImg) .width($r('app.float.mainPage_baseTab_size')) .height($r('app.float.mainPage_baseTab_size')) Text(title) .margin({ top: $r('app.float.mainPage_baseTab_top') }) .fontSize($r('app.float.main_tab_fontSize')) - .fontColor(this.index === targetIndex ? $r('app.color.mainPage_selected') : $r('app.color.mainPage_normal')) + .fontColor(this.currentIndex === index ? $r('app.color.mainPage_selected') : $r('app.color.mainPage_normal')) } - .margin({ top: $r('app.float.mainPage_baseTab_margin') }) + .justifyContent(FlexAlign.Center) .height($r('app.float.mainPage_barHeight')) .width(CommonConstants.FULL_PARENT) .onClick(() => { - this.index = targetIndex; - this.tabsController.changeIndex(this.index); + this.currentIndex = index; + this.tabsController.changeIndex(this.currentIndex); }) } - @Builder tabTitles(title: Resource) { + @Builder TabTitles(title: Resource) { Text(title) .fontWeight(FontWeight.Medium) .fontSize($r('app.float.page_title_text_size')) @@ -59,21 +59,21 @@ struct MainPage { controller: this.tabsController }) { TabContent() { - this.tabTitles($r('app.string.mainPage_tabTitles_home')) + this.TabTitles($r('app.string.mainPage_tabTitles_home')) Home() } .padding({ left: $r('app.float.mainPage_padding'), right: $r('app.float.mainPage_padding') }) .backgroundColor($r('app.color.mainPage_backgroundColor')) - .tabBar(this.baseTab(CommonConstants.HOME_TITLE, CommonConstants.HOME_TAB_INDEX, + .tabBar(this.TabBuilder(CommonConstants.HOME_TITLE, CommonConstants.HOME_TAB_INDEX, $r('app.media.home_selected'), $r('app.media.home_normal'))) TabContent() { - this.tabTitles($r('app.string.mainPage_tabTitles_mine')) + this.TabTitles($r('app.string.mainPage_tabTitles_mine')) Setting() } .padding({ left: $r('app.float.mainPage_padding'), right: $r('app.float.mainPage_padding') }) .backgroundColor($r('app.color.mainPage_backgroundColor')) - .tabBar(this.baseTab(CommonConstants.MINE_TITLE, CommonConstants.MINE_TAB_INDEX, + .tabBar(this.TabBuilder(CommonConstants.MINE_TITLE, CommonConstants.MINE_TAB_INDEX, $r('app.media.mine_selected'), $r('app.media.mine_normal'))) } .width(CommonConstants.FULL_PARENT) @@ -81,7 +81,7 @@ struct MainPage { .barHeight($r('app.float.mainPage_barHeight')) .barMode(BarMode.Fixed) .onChange((index: number) => { - this.index = index; + this.currentIndex = index; }) } } \ No newline at end of file diff --git a/ETSUI/ArkTSComponents/entry/src/main/ets/view/Home.ets b/ETSUI/ArkTSComponents/entry/src/main/ets/view/Home.ets index dafdb609..04c04b26 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/ets/view/Home.ets +++ b/ETSUI/ArkTSComponents/entry/src/main/ets/view/Home.ets @@ -47,7 +47,7 @@ export default struct Home { .margin({ top: $r('app.float.home_homeCell_margin') }) } } - }, item => item.toString()) + }, item => JSON.stringify(item)) } .columnsTemplate('1fr 1fr 1fr 1fr') .rowsTemplate('1fr 1fr') @@ -85,7 +85,7 @@ export default struct Home { .backgroundImageSize(ImageSize.Cover) .width(CommonConstants.FULL_PARENT) .height(CommonConstants.FULL_PARENT) - }, secondItem => secondItem.toString()) + }, secondItem => JSON.stringify(secondItem)) } .width(CommonConstants.FULL_PARENT) .height($r('app.float.home_secondGrid_height')) @@ -96,6 +96,6 @@ export default struct Home { .margin({ bottom: $r('app.float.setting_button_bottom')}) } } - .scrollBar(BarState.Off) + .height(CommonConstants.FULL_PARENT) } } diff --git a/ETSUI/ArkTSComponents/entry/src/main/ets/view/Setting.ets b/ETSUI/ArkTSComponents/entry/src/main/ets/view/Setting.ets index 685bdabe..a73de50e 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/ets/view/Setting.ets +++ b/ETSUI/ArkTSComponents/entry/src/main/ets/view/Setting.ets @@ -79,7 +79,7 @@ export default struct Setting { this.settingCell(item) } .height($r('app.float.setting_list_height')) - }, item => item.toString()) + }, item => JSON.stringify(item)) } .backgroundColor(Color.White) .divider({ @@ -101,10 +101,8 @@ export default struct Setting { .fontWeight(FontWeight.Medium) .backgroundColor($r('app.color.setting_button_backgroundColor')) .margin({ bottom: $r('app.float.setting_button_bottom')}) - - } - .height('100%') + .height(CommonConstants.FULL_PARENT) } } } diff --git a/ETSUI/ArkTSComponents/entry/src/main/module.json5 b/ETSUI/ArkTSComponents/entry/src/main/module.json5 index f46661ad..19ebb5ff 100644 --- a/ETSUI/ArkTSComponents/entry/src/main/module.json5 +++ b/ETSUI/ArkTSComponents/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "entryAbility", diff --git a/ETSUI/ArkTSComponents/package.json b/ETSUI/ArkTSComponents/package.json index 296f5c28..ada40996 100644 --- a/ETSUI/ArkTSComponents/package.json +++ b/ETSUI/ArkTSComponents/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "arktscomponents", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "arktscomponents", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/common/constants/CommonConstants.ets index 0adb10e1..727c4652 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/common/constants/CommonConstants.ets @@ -27,6 +27,16 @@ export default class CommonConstants { */ static readonly LAUNCHER_PAGE_TAG: string = 'LauncherPage'; + /** + * The advertsing page tag. + */ + static readonly ADVERTISING_PAGE_TAG: string = 'AdvertisingPage'; + + /** + * The custom dialog component tag. + */ + static readonly CUSTOM_DIALOG_TAG: string = 'CustomDialogComponent'; + /** * Preference saved key. */ @@ -92,16 +102,6 @@ export default class CommonConstants { */ static readonly ADVERTISING_TITLE_TEXT_LETTER_SPACING: number = 0.05; - /** - * Count down text top margin. - */ - static readonly ADVERTISING_TITLE_TEXT_MARGIN_TOP: string = '3.2%'; - - /** - * Count down text left margin. - */ - static readonly ADVERTISING_TITLE_TEXT_MARGIN_LEFT: string = '72.2%'; - /** * Advertising page healthy text spacing. */ diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/entryability/EntryAbility.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/entryability/EntryAbility.ets index e6d24875..47249aa8 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,21 +13,19 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability'; -import Want from '@ohos.application.Want'; -import window from '@ohos.window'; +import UIAbility from '@ohos.app.ability.UIAbility'; import Logger from '../common/utils/Logger'; import CommonConstants from '../common/constants/CommonConstants'; /** * Lift cycle management of Ability. */ -export default class EntryAbility extends Ability { - onCreate(want: Want) { +export default class EntryAbility extends UIAbility { + onCreate(want) { globalThis.abilityWant = want; } - onWindowStageCreate(windowStage: window.WindowStage) { + onWindowStageCreate(windowStage) { Logger.info(CommonConstants.ENTRY_ABILITY_TAG, 'onWindowStageCreate'); windowStage.loadContent('pages/LauncherPage', (err, data) => { if (err.code) { diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/AdvertisingPage.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/AdvertisingPage.ets index 5d6d2df7..ecf0b6e6 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/AdvertisingPage.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/AdvertisingPage.ets @@ -13,7 +13,8 @@ * limitations under the License. */ -import Router from '@ohos.router'; +import router from '@ohos.router'; +import Logger from '../common/utils/Logger'; import CommonConstants from '../common/constants/CommonConstants'; /** @@ -36,7 +37,7 @@ struct AdvertisingPage { } onPageHide() { - Router.clear(); + router.clear(); clearInterval(this.timeId); } @@ -44,8 +45,10 @@ struct AdvertisingPage { * Jump to app home page. */ jumpToAppHomePage() { - Router.push({ + router.pushUrl({ url: CommonConstants.APP_HOME_PAGE_URL + }).catch((error) => { + Logger.error(CommonConstants.ADVERTISING_PAGE_TAG, 'AdvertisingPage pushUrl error ' + JSON.stringify(error)); }); } @@ -65,8 +68,8 @@ struct AdvertisingPage { color: Color.White }) .margin({ - top: CommonConstants.ADVERTISING_TITLE_TEXT_MARGIN_TOP, - left: CommonConstants.ADVERTISING_TITLE_TEXT_MARGIN_LEFT + top: $r('app.float.advertising_title_text_margin_top'), + left: $r('app.float.advertising_title_text_margin_left') }) .padding({ left: $r('app.float.advertising_text_padding_left'), @@ -85,14 +88,14 @@ struct AdvertisingPage { Column() { Text($r('app.string.healthy_life_text')) .bottomTextStyle(FontWeight.Bolder, - CommonConstants.ADVERTISING_HEALTHY_LIFE_TEXT_SPACING, - $r('app.float.advertising_text_title_size'), - $r('app.color.advertising_text_title_color')) + CommonConstants.ADVERTISING_HEALTHY_LIFE_TEXT_SPACING, + $r('app.float.advertising_text_title_size'), + $r('app.color.advertising_text_title_color')) Text($r('app.string.healthy_life_introduce')) .bottomTextStyle(FontWeight.Normal, - CommonConstants.ADVERTISING_TEXT_INTRODUCE_LETTER_SPACING, - $r('app.float.advertising_text_introduce_size'), - $r('app.color.launcher_text_introduce_color')) + CommonConstants.ADVERTISING_TEXT_INTRODUCE_LETTER_SPACING, + $r('app.float.advertising_text_introduce_size'), + $r('app.color.launcher_text_introduce_color')) .opacity($r('app.float.advertising_text_opacity')) .margin({ top: CommonConstants.ADVERTISING_TEXT_INTRODUCE_MARGIN_TOP }) } diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/LauncherPage.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/LauncherPage.ets index 8682ae84..13a1a05b 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/LauncherPage.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/LauncherPage.ets @@ -13,9 +13,9 @@ * limitations under the License. */ -import AppContext from '@ohos.application.context'; -import DataPreferences from '@ohos.data.preferences'; -import Router from '@ohos.router'; +import common from '@ohos.app.ability.common'; +import preferences from '@ohos.data.preferences'; +import router from '@ohos.router'; import Logger from '../common/utils/Logger'; import CommonConstants from '../common/constants/CommonConstants'; import CustomDialogComponent from '../view/CustomDialogComponent'; @@ -28,7 +28,7 @@ import CustomDialogComponent from '../view/CustomDialogComponent'; @Entry @Component struct LauncherPage { - private context: AppContext.AbilityContext; + private context: common.UIAbilityContext; private timerId: number = 0; private jumpToAdvertisingFlag: boolean = false; dialogController: CustomDialogController = new CustomDialogController({ @@ -56,7 +56,7 @@ struct LauncherPage { onPageHide() { if (this.jumpToAdvertisingFlag) { - Router.clear(); + router.clear(); } clearTimeout(this.timerId); } @@ -67,13 +67,17 @@ struct LauncherPage { jumpToAdvertisingPage() { this.timerId = setTimeout(() => { this.jumpToAdvertisingFlag = true; - Router.push({ url: CommonConstants.ADVERTISING_PAGE_URL }); + router.pushUrl({ + url: CommonConstants.ADVERTISING_PAGE_URL + }).catch((error) => { + Logger.error(CommonConstants.LAUNCHER_PAGE_TAG, 'LauncherPage pushUrl error ' + JSON.stringify(error)); + }); }, CommonConstants.LAUNCHER_DELAY_TIME); } saveIsPrivacy() { - let preferences: Promise = this.getDataPreferences(); - preferences.then((result: DataPreferences.Preferences) => { + let preferences: Promise = this.getDataPreferences(); + preferences.then((result: preferences.Preferences) => { let privacyPut = result.put(CommonConstants.PREFERENCES_KEY_PRIVACY, false); result.flush(); privacyPut.then(() => { @@ -86,11 +90,11 @@ struct LauncherPage { }); } - aboutToAppear() { - this.context = getContext(this) as AppContext.AbilityContext; + onPageShow() { + this.context = getContext(this) as common.UIAbilityContext; // Get the operation class for saving data. - this.getDataPreferences().then((preferences: DataPreferences.Preferences) => { - preferences.get(CommonConstants.PREFERENCES_KEY_PRIVACY, true).then((value: DataPreferences.ValueType) => { + this.getDataPreferences().then((preferences: preferences.Preferences) => { + preferences.get(CommonConstants.PREFERENCES_KEY_PRIVACY, true).then((value: preferences.ValueType) => { Logger.info(CommonConstants.LAUNCHER_PAGE_TAG, 'AboutToAppear value: ' + value); if (value) { this.dialogController.open(); @@ -105,7 +109,7 @@ struct LauncherPage { * Get data preferences action. */ getDataPreferences() { - return DataPreferences.getPreferences(this.context, CommonConstants.PREFERENCES_FILE_NAME); + return preferences.getPreferences(this.context, CommonConstants.PREFERENCES_FILE_NAME); } build() { diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/PrivacyPage.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/PrivacyPage.ets index 72746630..ec0af82c 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/pages/PrivacyPage.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/pages/PrivacyPage.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import Router from '@ohos.router'; +import router from '@ohos.router'; import CommonConstants from '../common/constants/CommonConstants'; /** @@ -43,7 +43,7 @@ struct PrivacyPage { .textAlign(TextAlign.Center) .fontWeight(FontWeight.Medium) .onClick(() => { - Router.back(); + router.back(); }) .margin({ top: $r('app.float.privacy_bottom_text_margin') }) } diff --git a/ETSUI/FirstStartDemo/entry/src/main/ets/view/CustomDialogComponent.ets b/ETSUI/FirstStartDemo/entry/src/main/ets/view/CustomDialogComponent.ets index aa59005c..6b1e98d9 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/ets/view/CustomDialogComponent.ets +++ b/ETSUI/FirstStartDemo/entry/src/main/ets/view/CustomDialogComponent.ets @@ -13,13 +13,13 @@ * limitations under the License. */ -import Router from '@ohos.router'; +import router from '@ohos.router'; +import Logger from '../common/utils/Logger'; import CommonConstants from '../common/constants/CommonConstants'; /** * Custom pop-up window. */ - @CustomDialog export default struct CustomDialogComponent { controller: CustomDialogController; @@ -46,7 +46,12 @@ export default struct CustomDialogComponent { .fontColor($r('app.color.dialog_text_statement_color')) .fontSize($r('app.float.dialog_common_text_size')) .onClick(() => { - Router.push({ url: CommonConstants.PRIVACY_PAGE_URL }); + this.controller.close(); + router.pushUrl({ + url: CommonConstants.PRIVACY_PAGE_URL + }).catch((error) => { + Logger.error(CommonConstants.CUSTOM_DIALOG_TAG, 'CustomDialog pushUrl error ' + JSON.stringify(error)); + }); }) Text($r('app.string.dialog_text_declaration_prompt')) .width(CommonConstants.DIALOG_COMPONENT_WIDTH_PERCENT) diff --git a/ETSUI/FirstStartDemo/entry/src/main/module.json5 b/ETSUI/FirstStartDemo/entry/src/main/module.json5 index 3c4977b4..83d91658 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/module.json5 +++ b/ETSUI/FirstStartDemo/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/FirstStartDemo/entry/src/main/resources/base/element/float.json b/ETSUI/FirstStartDemo/entry/src/main/resources/base/element/float.json index acd29cc1..7ffebdce 100644 --- a/ETSUI/FirstStartDemo/entry/src/main/resources/base/element/float.json +++ b/ETSUI/FirstStartDemo/entry/src/main/resources/base/element/float.json @@ -52,6 +52,14 @@ "name": "advertising_text_border_width", "value": "1" }, + { + "name": "advertising_title_text_margin_top", + "value": "30vp" + }, + { + "name": "advertising_title_text_margin_left", + "value": "260vp" + }, { "name": "advertising_text_padding_top", "value": "8vp" diff --git a/ETSUI/FirstStartDemo/package.json b/ETSUI/FirstStartDemo/package.json index 7969f502..f20e5671 100644 --- a/ETSUI/FirstStartDemo/package.json +++ b/ETSUI/FirstStartDemo/package.json @@ -12,7 +12,7 @@ "version": "1.0.0", "dependencies": { "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" } } diff --git a/ETSUI/Healthy_life/LICENSE b/ETSUI/Healthy_life/LICENSE new file mode 100644 index 00000000..381eb507 --- /dev/null +++ b/ETSUI/Healthy_life/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2022 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/ETSUI/Healthy_life/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/Healthy_life/entry/src/main/ets/common/constants/CommonConstants.ets index 786f2959..ba49ce6d 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/common/constants/CommonConstants.ets @@ -49,6 +49,7 @@ export const THOUSANDTH_33: string = '3.3%'; // ‘3.3%’ export const THOUSANDTH_50: string = '5%'; // ‘5%’ export const THOUSANDTH_66: string = '6.6%'; // ‘6.6%’ export const THOUSANDTH_80: string = '8%'; // ‘8%’ +export const THOUSANDTH_100: string = '10%'; // ‘10%’ export const THOUSANDTH_120: string = '12%'; // ‘12%’ export const THOUSANDTH_160: string = '16%'; // ‘16%’ export const THOUSANDTH_400: string = '40%'; // ‘40%’ diff --git a/ETSUI/Healthy_life/entry/src/main/ets/common/database/Rdb.ets b/ETSUI/Healthy_life/entry/src/main/ets/common/database/Rdb.ets index fb103b4d..7f15c457 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/common/database/Rdb.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/common/database/Rdb.ets @@ -17,10 +17,6 @@ import data_rdb from '@ohos.data.rdb'; import { STORE_CONFIG } from '../constants/CommonConstants'; import { Logger } from '../../common/utils/log/Logger'; -import context from '@ohos.application.context'; - -type Context = context.Context; - export default class Rdb { private rdbStore: any = null; private tableName: string; @@ -44,8 +40,7 @@ export default class Rdb { callback(); return; } - var context: Context = getContext(this) as Context; - // let context = globalThis.st-----ageContext; + let context = getContext(this); data_rdb.getRdbStore(context, STORE_CONFIG, 1, (err, rdb) => { if (err) { Logger.error('Rdb', 'gerRdbStore() failed, err: ' + err); diff --git a/ETSUI/Healthy_life/entry/src/main/ets/common/reminderagent/ReminderAgent.ets b/ETSUI/Healthy_life/entry/src/main/ets/common/reminderagent/ReminderAgent.ets deleted file mode 100644 index d5dfaa21..00000000 --- a/ETSUI/Healthy_life/entry/src/main/ets/common/reminderagent/ReminderAgent.ets +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -import reminderAgent from '@ohos.reminderAgent' -import notification from '@ohos.notification' -import { Logger } from '../utils/log/Logger' - -// publishReminder -function publishReminder(params) { - if(!params) return; - let timer = fetchData(params); - reminderAgent.publishReminder(timer).then((reminderId) => { - Logger.info("reminderAgent", `promise, reminderId: ${reminderId}`); - }).catch((err) => { - Logger.error("reminderAgent", `publishReminder err: ${err}`); - }) -} - -// cancelReminder -function cancelReminder(reminderId) { - if(!reminderId) return; - reminderAgent.cancelReminder(reminderId).then((data) => { - Logger.info("reminderAgent", `cancelReminder promise: ${data}`); - }).catch((err) => { - Logger.error("reminderAgent", `cancelReminder err: ${err}`); - }) -} - -// fetchData -function fetchData(params): reminderAgent.ReminderRequestAlarm { - return { - reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, - hour: params.hour || 0, - minute: params.minute || 0, - daysOfWeek: params.daysOfWeek || [], - wantAgent: { - pkgName: "com.example.exercisehealth", - abilityName: "MainAbility" - }, - title: params.title || '', - content: params.content || '', - notificationId: params.notificationId || -1, - slotType: notification.SlotType.SOCIAL_COMMUNICATION - } -} - -// hasNotificationId -async function hasNotificationId(params: number) { - if(!params) return; - await reminderAgent.getValidReminders().then((reminders) => { - if (!reminders.length) { - return false; - } - let notificationIdList = []; - for (let i = 0; i < reminders.length; i++) { - notificationIdList.push(reminders[i].notificationId) - } - const flag = notificationIdList.indexOf(params); - - return flag === -1 ? false : true; - }) -} - -const reminder = { - publishReminder, - cancelReminder, - hasNotificationId -} - -export default reminder \ No newline at end of file diff --git a/ETSUI/Healthy_life/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/Healthy_life/entry/src/main/ets/entryability/EntryAbility.ts index 0f1270a5..800c91f9 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/Healthy_life/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,59 +1,62 @@ -import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' -import Window from '@ohos.window' +/* + * Copyright (c) 2022 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. + */ + +import UIAbility from '@ohos.app.ability.UIAbility'; + +export default class MainAbility extends UIAbility { + private static TAG: string = 'MainAbility'; -export default class EntryAbility extends Ability { onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + console.debug(MainAbility.TAG, 'onCreate'); globalThis.abilityWant = want; - globalThis.abilityContext = this.context; } onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + console.debug(MainAbility.TAG, 'onDestroy'); } - onWindowStageCreate(windowStage: Window.WindowStage) { + onWindowStageCreate(windowStage) { // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - - windowStage.loadContent('pages/SplashPage', (err, data) => { + console.debug(MainAbility.TAG, 'onWindowStageCreate'); + windowStage.loadContent("pages/SplashPage", (err, data) => { if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); - hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + console.error('windowStage', 'Failed to load the content. Cause:' + JSON.stringify(err)); return; } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + console.info('windowStage', 'Succeeded in loading the content. Data: ' + JSON.stringify(data)); }); } onWindowStageDestroy() { // Main window is destroyed, release UI related resources - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + console.debug(MainAbility.TAG, 'onWindowStageDestroy'); } onForeground() { // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + console.debug(MainAbility.TAG, 'onForeground'); } onBackground() { // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); - hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + console.debug(MainAbility.TAG, 'onBackground'); } onNewWant(want, launchParam) { // Ability has new want - console.debug('testTag', `onNewWant ${JSON.stringify(want)}`); + console.debug(MainAbility.TAG, `onNewWant ${JSON.stringify(want)}`); globalThis.abilityWant = want; } -} +}; diff --git a/ETSUI/Healthy_life/entry/src/main/ets/model/TaskInitList.ets b/ETSUI/Healthy_life/entry/src/main/ets/model/TaskInitList.ets index c4d01f54..99e222ba 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/model/TaskInitList.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/model/TaskInitList.ets @@ -157,7 +157,7 @@ export const TaskMapById: TaskInitListType = { taskName: $r('app.string.task_water'), icon: $r('app.media.water'), dialogBg: $rawfile('dialog/drink.png'), - targetValue: '1', + targetValue: '0.25', isOpen: false, unit: 'L', step: 0, diff --git a/ETSUI/Healthy_life/entry/src/main/ets/pages/AdvertisingPage.ets b/ETSUI/Healthy_life/entry/src/main/ets/pages/AdvertisingPage.ets index 3f222982..3775ad80 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/pages/AdvertisingPage.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/pages/AdvertisingPage.ets @@ -33,7 +33,7 @@ struct AdvertisingPage { goToHomePage() { clearInterval(this.intervalId); - router.replace({ url: 'pages/MainPage' }); + router.replaceUrl({ url: 'pages/MainPage' }); } aboutToAppear() { @@ -57,7 +57,7 @@ struct AdvertisingPage { .height($r('app.float.default_36')) .backgroundColor('rgba(0,0,0,0.20)') .border({ color: $r('app.color.white'), width: $r('app.float.default_1') }) - .margin({ top: $r('app.float.default_56') }) + .margin({ top: $r('app.float.default_36') }) .padding($r('app.float.default_8')) .onClick(() => this.goToHomePage()) } diff --git a/ETSUI/Healthy_life/entry/src/main/ets/pages/MainPage.ets b/ETSUI/Healthy_life/entry/src/main/ets/pages/MainPage.ets index 624e0acb..5141b649 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/pages/MainPage.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/pages/MainPage.ets @@ -38,7 +38,7 @@ struct Index { onPageShow() { Logger.info('onPageShow', JSON.stringify(router.getParams())); this.editedTaskInfo = JSON.parse(router.getParams() ? router.getParams()['editTask'] : '{}'); - this.editedTaskID = `${this.editedTaskInfo.taskID}_${this.editedTaskInfo.isOpen}`; + this.editedTaskID = `${this.editedTaskInfo.taskID}_${this.editedTaskInfo.isOpen}` + new Date().getTime(); } @Builder TabBuilder(index: number) { diff --git a/ETSUI/Healthy_life/entry/src/main/ets/pages/SplashPage.ets b/ETSUI/Healthy_life/entry/src/main/ets/pages/SplashPage.ets index a4bba07e..194032ec 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/pages/SplashPage.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/pages/SplashPage.ets @@ -1,4 +1,4 @@ -import { Logger } from '../common/utils/log/Logger'; + /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); @@ -14,8 +14,10 @@ import { Logger } from '../common/utils/log/Logger'; * limitations under the License. */ +import common from '@ohos.app.ability.common'; import router from '@ohos.router'; import data_preferences from '@ohos.data.preferences'; +import { Logger } from '../common/utils/log/Logger'; import * as commonConst from '../common/constants/CommonConstants'; import UserPrivacyDialog from '../view/dialog/UserPrivacyDialog'; @@ -26,10 +28,11 @@ const IS_PRIVACY: string = 'isPrivacy'; @Entry @Component struct SplashIndex { + context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext; dialogController: CustomDialogController = new CustomDialogController({ builder: UserPrivacyDialog( { - cancel: this.exitApp, + cancel: this.exitApp.bind(this), confirm: this.onConfirm.bind(this) }), cancel: this.exitApp, @@ -39,7 +42,7 @@ struct SplashIndex { }); onConfirm() { - let preferences = data_preferences.getPreferences(globalThis.abilityContext, H_STORE); + let preferences = data_preferences.getPreferences(this.context, H_STORE); preferences.then((res) => { res.put(IS_PRIVACY, true).then(() => { res.flush(); @@ -52,17 +55,17 @@ struct SplashIndex { } exitApp() { - globalThis.abilityContext.terminateSelf(); + this.context.terminateSelf(); } jumpAdPage() { setTimeout(() => { - router.replace({ url: 'pages/AdvertisingPage' }); + router.replaceUrl({ url: 'pages/AdvertisingPage' }); }, commonConst.LAUNCHER_DELAY_TIME); } aboutToAppear() { - let preferences = data_preferences.getPreferences(globalThis.abilityContext, H_STORE); + let preferences = data_preferences.getPreferences(this.context, H_STORE); preferences.then((res) => { res.get(IS_PRIVACY, false).then((isPrivate) => { if (isPrivate === true) { @@ -83,7 +86,7 @@ struct SplashIndex { Image($r('app.media.logo')) .width($r('app.float.default_120')) .aspectRatio(1) - .margin({ top: commonConst.THOUSANDTH_160 }); + .margin({ top: $r('app.float.default_120') }); Text($r('app.string.MainAbility_label')) .fontFamily($r('app.string.HarmonyHeiTi_Bold')) .fontSize($r('app.float.default_24')) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskEditPage.ets b/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskEditPage.ets index 769897a4..4c6d3994 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskEditPage.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskEditPage.ets @@ -30,6 +30,7 @@ struct TaskEdit { } .size({ width: THOUSANDTH_1000, height: THOUSANDTH_1000 }) .title(EDIT_TASK_TITLE) + .titleMode(NavigationTitleMode.Mini) } .height(THOUSANDTH_1000) .backgroundColor($r('app.color.primaryBgColor')) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskListPage.ets b/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskListPage.ets index bb01f659..9606d7c2 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskListPage.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/pages/TaskListPage.ets @@ -43,6 +43,7 @@ struct TaskIndex { } .size({ width: THOUSANDTH_1000, height: THOUSANDTH_1000 }) .title(ADD_TASK_TITLE) + .titleMode(NavigationTitleMode.Mini) } .backgroundColor($r('app.color.primaryBgColor')) .height(THOUSANDTH_1000) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/HomeComponent.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/HomeComponent.ets index 6d43809a..e0a74f99 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/HomeComponent.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/HomeComponent.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +import common from '@ohos.app.ability.common'; import router from '@ohos.router'; import HealthText from './HealthTextComponent'; import AddBtn from '../view/home/AddBtnComponent'; @@ -20,6 +21,7 @@ import { TaskCard } from '../view/home//TaskCardComponent'; import HomeTopView from '../view/home/HomeTopComponent'; import { CustomDialogView, CustomDialogCallback } from '../view/dialog/CustomDialogView'; import TaskInfo from '../common/bean/TaskInfo'; +import { GlobalInfoTable } from '../common/database/tables/GlobalInfoTable'; import { HomeStore } from '../viewmodel/HomeViewModel'; import { ITaskItem, TaskMapById } from '../model/TaskInitList'; import { HealthDataSrcMgr } from '../common/utils/HealthDataSrcMgr'; @@ -54,20 +56,45 @@ export default struct HomeIndex { @Link editedTaskInfo: ITaskItem; @Link @Watch('taskChange') editedTaskID: string; private scroller: Scroller = new Scroller(); - - aboutToAppear() { - this.homeStore.initData(); + private globalTable = new GlobalInfoTable(); + + async aboutToAppear() { + this.globalTable.getRdbStore(() => { + this.globalTable.query((result) => { + let predate = new Date(result.lastDate); + let date = new Date(); + if (result.length !== 0 && date.getTime() < predate.getTime()) { + AlertDialog.show( + { + title: $r('app.string.alert'), + message: $r('app.string.alert_message'), + autoCancel: false, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: $r('app.string.alert_button'), + action: () => { + (getContext(this) as common.UIAbilityContext).terminateSelf() + console.info('Button-clicking callback') + } + }, + cancel: () => { + console.info('Closed callbacks') + } + }) + } else { + this.homeStore.initData(); + } + }); + }); + // this.homeStore.initData(); } taskChange() { this.homeStore.updateTaskInfoList(this.editedTaskInfo); } - aboutToDisappear() { - // cancel broadcast - this.broadCast.off(null, null); - } - taskItemAction(item: TaskInfo, isClick: boolean) { if (!this.homeStore.checkCurrentDay()) { return; @@ -86,7 +113,7 @@ export default struct HomeIndex { frequency: item.frequency, isOpen: item.isOpen, }; - router.push({ url: 'pages/TaskEditPage', params: { params: JSON.stringify(editTask) } }); + router.pushUrl({ url: 'pages/TaskEditPage', params: { params: JSON.stringify(editTask) } }); } } @@ -111,7 +138,7 @@ export default struct HomeIndex { editTaskAction() { if (this.homeStore.checkCurrentDay()) { - router.push({ url: 'pages/TaskListPage' }); + router.pushUrl({ url: 'pages/TaskListPage' }); } } @@ -130,7 +157,7 @@ export default struct HomeIndex { }) .margin({ bottom: commonConst.DEFAULT_12 }) .height($r('app.float.default_64')) - }, item => item.date + item.taskID) + }, item => JSON.stringify(item)) } .padding({ top: commonConst.THOUSANDTH_15, diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/CustomDialogView.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/CustomDialogView.ets index 8241c781..3d6ae020 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/CustomDialogView.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/CustomDialogView.ets @@ -15,12 +15,10 @@ import { AchievementDialog } from './AchievementDialog'; import { TaskDetailDialog } from './TaskDetailDialog'; -import { TargetSettingDialog, RemindTimeDialog, FrequencyDialog } from './TaskSettingDialog'; import { BroadCast, BroadCastType } from '../../common/utils/BroadCast'; import { TaskItem } from '../../model/TaskInitList'; import TaskInfo from '../../common/bean/TaskInfo'; import { Logger } from '../../common/utils/log/Logger'; -import { ZERO, MINUS_20 } from '../../common/constants/CommonConstants'; export interface CustomDialogCallback { confirmCallback: Function; @@ -41,27 +39,7 @@ export struct CustomDialogView { autoCancel: true, customStyle: true }); - // target setting dialog - targetSettingDialog = new CustomDialogController({ - builder: TargetSettingDialog(), - autoCancel: true, - alignment: DialogAlignment.Bottom, - offset: { dx: ZERO, dy: MINUS_20 } - }); - // remind time dialog - RemindTimeDialogController: CustomDialogController = new CustomDialogController({ - builder: RemindTimeDialog(), - autoCancel: true, - alignment: DialogAlignment.Bottom, - offset: { dx: ZERO, dy: MINUS_20 } - }); - // frequency dialog - FrequencyDialogController: CustomDialogController = new CustomDialogController({ - builder: FrequencyDialog(), - autoCancel: true, - alignment: DialogAlignment.Bottom, - offset: { dx: ZERO, dy: MINUS_20 } - }); + // task clock dialog taskDialog = new CustomDialogController({ builder: TaskDetailDialog(), @@ -78,23 +56,11 @@ export struct CustomDialogView { this.achievementDialog.open(); }) - // target setting dialog - this.broadCast.on(BroadCastType.SHOW_TARGET_SETTING_DIALOG, () => { - this.targetSettingDialog.open(); - }) - // remind time dialog - this.broadCast.on(BroadCastType.SHOW_REMIND_TIME_DIALOG, () => { - this.RemindTimeDialogController.open(); - }) - // frequency dialog - this.broadCast.on(BroadCastType.SHOW_FREQUENCY_DIALOG, () => { - this.FrequencyDialogController.open(); - }) // task clock dialog this.broadCast.on(BroadCastType.SHOW_TASK_DETAIL_DIALOG, (currentTask: TaskInfo, dialogCallBack: CustomDialogCallback) => { Logger.debug('CustomDialogView', 'SHOW_TASK_DETAIL_DIALOG'); - this.currentTask = currentTask; + this.currentTask = currentTask || TaskItem; this.dialogCallBack = dialogCallBack; this.taskDialog.open(); }) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDetailDialog.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDetailDialog.ets index 1ee10dda..36c80b61 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDetailDialog.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDetailDialog.ets @@ -54,7 +54,7 @@ export struct TaskDetailDialog { } .height($r('app.float.default_451')) .width($r('app.float.default_316')) - .backgroundImage(TaskMapById[this.currentTask.taskID].dialogBg, ImageRepeat.NoRepeat) + .backgroundImage(TaskMapById[this.currentTask?.taskID].dialogBg, ImageRepeat.NoRepeat) .backgroundImageSize({ width: '100%', height: '100%' @@ -78,6 +78,7 @@ struct TaskBaseInfo { .fontWeight(FontWeight.Bold) .fontFamily($r('app.string.HarmonyHeiTi_Bold')) .taskTextStyle() + .margin({left: $r('app.float.default_12')}) } .position({ y: $r('app.float.default_267') }) } diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDialogView.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDialogView.ets new file mode 100644 index 00000000..6bebd01e --- /dev/null +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskDialogView.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022 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. + */ + +import { TargetSettingDialog, RemindTimeDialog, FrequencyDialog } from './TaskSettingDialog'; +import { BroadCast, BroadCastType } from '../../common/utils/BroadCast'; +import { Logger } from '../../common/utils/log/Logger'; +import { ZERO, MINUS_20 } from '../../common/constants/CommonConstants'; + +export interface CustomDialogCallback { + confirmCallback: Function; + cancelCallback: Function; +} + +@Component +export struct TaskDialogView { + @State isShow: boolean = false; + @Consume broadCast: BroadCast; + + // target setting dialog + targetSettingDialog = new CustomDialogController({ + builder: TargetSettingDialog(), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: ZERO, dy: MINUS_20 } + }); + // remind time dialog + RemindTimeDialogController: CustomDialogController = new CustomDialogController({ + builder: RemindTimeDialog(), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: ZERO, dy: MINUS_20 } + }); + // frequency dialog + FrequencyDialogController: CustomDialogController = new CustomDialogController({ + builder: FrequencyDialog(), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: ZERO, dy: MINUS_20 } + }); + + aboutToAppear() { + Logger.debug('CustomDialogView', 'aboutToAppear'); + + // target setting dialog + this.broadCast.on(BroadCastType.SHOW_TARGET_SETTING_DIALOG, () => { + this.targetSettingDialog.open(); + }) + // remind time dialog + this.broadCast.on(BroadCastType.SHOW_REMIND_TIME_DIALOG, () => { + this.RemindTimeDialogController.open(); + }) + // frequency dialog + this.broadCast.on(BroadCastType.SHOW_FREQUENCY_DIALOG, () => { + this.FrequencyDialogController.open(); + }) + } + + aboutToDisappear() { + Logger.debug('CustomDialogView', 'aboutToDisappear'); + } + + build() { + } +} \ No newline at end of file diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskSettingDialog.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskSettingDialog.ets index f35425b0..6ba3d6ae 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskSettingDialog.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/dialog/TaskSettingDialog.ets @@ -27,7 +27,7 @@ export struct TargetSettingDialog { controller: CustomDialogController; drinkRange: string[] = createDrinkRange(); appleRange: string[] = createAppleRange(); - currentValue: string = '1'; + currentValue: string = this.settingParams.targetValue; currentTime: string = commonConst.DEFAULT_TIME; private tip: string = ''; diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/home/HomeTopComponent.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/home/HomeTopComponent.ets index e3cb826f..3ce80e1f 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/home/HomeTopComponent.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/home/HomeTopComponent.ets @@ -51,7 +51,7 @@ export default struct HomeTopView { .width(commonConst.THOUSANDTH_1000) .padding({ left: $r('app.float.default_24') }) - WeekCalendar({ homeStore: this.homeStore }) + WeekCalendar({ homeStore: $homeStore }) } .height(commonConst.THOUSANDTH_500) .backgroundImagePosition({x: 0, y: 0}) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/home/WeekCalendarComponent.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/home/WeekCalendarComponent.ets index 7232bf2f..d42cb6b4 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/home/WeekCalendarComponent.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/home/WeekCalendarComponent.ets @@ -24,7 +24,7 @@ export const WEEK_DAY_WIDTH: number = 100 / commonConst.WEEK_DAY_NUM; @Component export struct WeekCalendar { - @ObjectLink homeStore: HomeStore; + @Link homeStore: HomeStore; currentPage: number = 1; private scroller: Scroller = new Scroller(); private isLoadMore: boolean = false; @@ -64,6 +64,7 @@ export struct WeekCalendar { Row() { this.ArrowIcon(false) HealthText({ title: this.homeStore.dateTitle as string, fontSize: $r('app.float.default_14') }) + .margin($r('app.float.default_12')) this.ArrowIcon(true) } .justifyContent(FlexAlign.Center) @@ -79,6 +80,7 @@ export struct WeekCalendar { .fontFamily($r('app.string.HarmonyHeiTi_Medium')) .opacity(commonConst.OPACITY_6) Divider() + .margin({top: commonConst.DEFAULT_2, bottom: $r('app.float.default_4')}) .width($r('app.float.default_12')) .color(sameDate(item.date, this.homeStore.showDate) ? $r('app.color.blueColor') : $r('app.color.white')) Image(this.getProgressImg(item)) @@ -87,6 +89,7 @@ export struct WeekCalendar { .margin({ top: commonConst.THOUSANDTH_80 }) } .width(`${WEEK_DAY_WIDTH}%`) + .justifyContent(FlexAlign.SpaceBetween) .onClick(() => WeekCalendarMethods.calenderItemClickAction.call(this, item, index)) }) } @@ -99,10 +102,9 @@ export struct WeekCalendar { } .borderRadius($r('app.float.default_24')) .backgroundColor($r('app.color.white')) - .justifyContent(FlexAlign.SpaceAround) .width(commonConst.THOUSANDTH_1000) .height(commonConst.THOUSANDTH_1000) - .padding({ top: commonConst.THOUSANDTH_80, bottom: commonConst.THOUSANDTH_120 }) + .padding({ top: commonConst.THOUSANDTH_50, bottom: commonConst.THOUSANDTH_120 }) } .width(commonConst.THOUSANDTH_1000) diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskDetailComponent.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskDetailComponent.ets index e5f16f20..17dee713 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskDetailComponent.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskDetailComponent.ets @@ -29,12 +29,12 @@ import { } from './TaskEditListItem'; import { BroadCast, BroadCastType } from '../../common/utils/BroadCast'; import { HealthDataSrcMgr } from '../../common/utils/HealthDataSrcMgr'; -import { initFrequencyString, addTask , formatParams} from '../../viewmodel/TaskViewModel'; -import { CustomDialogView } from '../dialog/CustomDialogView'; +import { initFrequencyString, addTask, formatParams } from '../../viewmodel/TaskViewModel'; +import { TaskDialogView } from '../dialog/TaskDialogView'; -@Styles function listItemStyle () { +@Styles function listItemStyle() { .backgroundColor($r('app.color.white')) - .height(commonConst.THOUSANDTH_80) + .height(commonConst.DEFAULT_56) .borderRadius(commonConst.DEFAULT_10) .padding({ left: commonConst.DEFAULT_12, right: commonConst.DEFAULT_12 }) } @@ -42,19 +42,20 @@ import { CustomDialogView } from '../dialog/CustomDialogView'; @Component export default struct TaskDetail { @Provide broadCast: BroadCast = HealthDataSrcMgr.getInstance().getBroadCast(); - @Provide settingParams: ITaskItem = this.parseRouterParams(); + @Provide @Watch('onParamsChanged') settingParams: ITaskItem = this.parseRouterParams(); @Provide frequency: string = initFrequencyString(this.settingParams?.frequency); - private isOpen: boolean = this.parseRouterParams()['isOpen']; + private isChanged: boolean = false; parseRouterParams() { const routerParams: ITaskItem = JSON.parse(router.getParams()['params']); return routerParams; } + onParamsChanged() { + this.isChanged = true; + } + backIndexParams() { - if (this.isOpen === this.settingParams.isOpen) { - return {}; - } return formatParams({ ...this.settingParams, isDone: true, @@ -63,32 +64,40 @@ export default struct TaskDetail { } finishTaskEdit() { - addTask({ - id: commonConst.ZERO, - date: commonConst.GLOBAL_KEY, - ...this.settingParams, - isDone: false, - finValue: '', - }) - .then(res => { - router.back({ - url: 'pages/MainPage', - params: { - editTask: this.backIndexParams(), - } - }) - Logger.info('addTaskFinished', res as string); + if (this.isChanged) { + addTask({ + id: commonConst.ZERO, + date: commonConst.GLOBAL_KEY, + ...this.settingParams, + isDone: false, + finValue: '', }) - .catch(res => { - prompt.showToast({ - message: commonConst.SETTING_FINISH_FAILED_MESSAGE + .then(res => { + router.back({ + url: 'pages/MainPage', + params: { + editTask: this.backIndexParams(), + } + }) + Logger.info('addTaskFinished', res as string); }) - Logger.error('addTaskFailed', res as string); - }) + .catch(res => { + prompt.showToast({ + message: commonConst.SETTING_FINISH_FAILED_MESSAGE + }) + Logger.error('addTaskFailed', res as string); + }) + return; + } + router.back({ + url: 'pages/MainPage', + }) } aboutToAppear() { - this.broadCast.off(null, null); + this.broadCast.off(BroadCastType.SHOW_TARGET_SETTING_DIALOG, null); + this.broadCast.off(BroadCastType.SHOW_REMIND_TIME_DIALOG, null); + this.broadCast.off(BroadCastType.SHOW_FREQUENCY_DIALOG, null); } build() { @@ -111,7 +120,7 @@ export default struct TaskDetail { ) .onClick(() => { this.broadCast.emit( - BroadCastType.SHOW_TARGET_SETTING_DIALOG); + BroadCastType.SHOW_TARGET_SETTING_DIALOG); }) ListItem() { @@ -126,9 +135,7 @@ export default struct TaskDetail { .listItemStyle() .enabled(this.settingParams?.isOpen && this.settingParams?.isAlarm) .onClick(() => { - this.broadCast.emit( - BroadCastType.SHOW_REMIND_TIME_DIALOG - ); + this.broadCast.emit(BroadCastType.SHOW_REMIND_TIME_DIALOG); }) ListItem() { @@ -137,14 +144,11 @@ export default struct TaskDetail { .listItemStyle() .enabled(this.settingParams?.isOpen) .onClick(() => { - this.broadCast.emit( - BroadCastType.SHOW_FREQUENCY_DIALOG, - ); + this.broadCast.emit(BroadCastType.SHOW_FREQUENCY_DIALOG); }) } .width(commonConst.THOUSANDTH_940) - .margin({ bottom: commonConst.THOUSANDTH_400 }) Button() { Text($r('app.string.complete')).fontSize($r('app.float.default_20')).fontColor($r('app.color.blueColor')) @@ -155,8 +159,12 @@ export default struct TaskDetail { .onClick(() => { this.finishTaskEdit(); }) + .position({ + x: commonConst.THOUSANDTH_100, + y: commonConst.THOUSANDTH_800 + }) - CustomDialogView() + TaskDialogView() } .width(commonConst.THOUSANDTH_1000) } diff --git a/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskListComponent.ets b/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskListComponent.ets index 413efb85..3234f78e 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskListComponent.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/view/task/TaskListComponent.ets @@ -52,7 +52,7 @@ export default struct TaskList { .height(commonConst.THOUSANDTH_80) .borderRadius(commonConst.DEFAULT_12) .onClick(() => { - router.push({ + router.pushUrl({ url: 'pages/TaskEditPage', params: { params: formatParams(item), diff --git a/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/HomeViewModel.ets b/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/HomeViewModel.ets index 97a9fc06..48fb0d67 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/HomeViewModel.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/HomeViewModel.ets @@ -1,4 +1,3 @@ -import { DEFAULT_100 } from '../common/constants/CommonConstants'; /* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License,Version 2.0 (the "License"); @@ -14,6 +13,7 @@ import { DEFAULT_100 } from '../common/constants/CommonConstants'; * limitations under the License. */ +import { DEFAULT_100 } from '../common/constants/CommonConstants'; import { isReachNewAchievement, ACHIEVEMENT_LEVEL_KEY } from '../model/AchieveModel'; import DatabaseApi from '../model/DatabaseModel'; import { TaskMapById, ITaskItem, ACHIEVEMENT_LEVEL_LIST } from '../model/TaskInitList'; @@ -50,16 +50,15 @@ export class HomeStore { let [initArr, dateArr] = initializeOnStartUp(this.currentDate); this.dateArr = initArr; Logger.info('this.currentDate', this.currentDate.toDateString()); - this.selectedDayInfo = initArr[this.selectedDay]; Logger.info('initWeekData dateArr', JSON.stringify(dateArr)) // get data form db try { this.dayInfoApi.getRdbStore(() => { this.databaseApi.query(dateToStr(new Date()), (taskList, dayInfo) => { Logger.info('Current Day Task Info: ', JSON.stringify(taskList)); - this.selectedDayInfo = { ...this.selectedDayInfo, taskList, dayInfo }; this.dayInfoApi.queryList(dateArr, (res: DayInfo[]) => { let tempList = res.concat(dayInfo); + let currentIndex = 0; Logger.info('initDayInfoList: ', JSON.stringify(res)); for (let i = 0; i < this.dateArr.length; i++) { let tempDayInfo = tempList.find((item) => item.date == this.dateArr[i].dateStr) || { @@ -68,13 +67,16 @@ export class HomeStore { targetTaskNum: 0 }; initArr[i].dayInfo = tempDayInfo; + initArr[i].taskList = taskList; if (this.dateArr[i].dateStr == dateToStr(new Date(this.showDate))) { // get tasks of showDate - initArr[i].taskList = taskList; - this.updateSelectedDayInfo(initArr[i]); + currentIndex = i; } } this.dateArr = initArr; + setTimeout(() => { + this.setSelectedShowDate(this.showDate); + }, 0) }) }) }) @@ -107,15 +109,15 @@ export class HomeStore { Logger.debug('updateSelectedDayInfo', JSON.stringify(selectedDayInfo)); if (selectedDayInfo.taskList?.length === 0) { // get data form db - this.taskInfoTableApi.getRdbStore(() => { + TaskInfoTableApi.getRdbStore(() => { TaskInfoTableApi.query(selectedDayInfo.dateStr, true, (res) => { Logger.info('Selected TaskInfoList: ', JSON.stringify(res)); selectedDayInfo.taskList = res; - this.selectedDayInfo = { ...selectedDayInfo }; this.dateArr = this.dateArr.map((item: WeekDateModel) => item.dateStr == selectedDayInfo.dateStr ? { ...item, taskList: res } : item); + this.selectedDayInfo = { ...selectedDayInfo }; }); - }); + }) } else { this.selectedDayInfo = { ...selectedDayInfo }; } @@ -154,7 +156,7 @@ export class HomeStore { // delete task let taskIndex = taskList.findIndex((item) => item.taskID == taskID); Logger.info('taskList[taskIndex]', JSON.stringify(taskList[taskIndex])); - if (taskList[taskIndex].isDone) { + if (taskList[taskIndex]?.isDone) { dayInfo.finTaskNum -= 1; } taskList = taskList.filter((item) => item.taskID != taskID); diff --git a/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/TaskViewModel.ets b/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/TaskViewModel.ets index 0adfd30f..5dd53c55 100644 --- a/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/TaskViewModel.ets +++ b/ETSUI/Healthy_life/entry/src/main/ets/viewmodel/TaskViewModel.ets @@ -16,7 +16,6 @@ import { TaskInfoTable } from '../common/database/tables/TaskInfoTable'; import { Logger } from '../common/utils/log/Logger'; import TaskInfo, { oneWeek } from '../common/bean/TaskInfo'; -import reminder from '../common/reminderagent/ReminderAgent'; import { EVERYDAY, GLOBAL_KEY, @@ -26,65 +25,14 @@ import { EAT_APPLE_RANGE, TIMES_100 } from '../common/constants/CommonConstants'; -import { TaskMapById, RemindContentMap, ITaskItem } from '../model/TaskInitList'; +import { TaskMapById, ITaskItem } from '../model/TaskInitList'; import { padTo2Digits } from '../common/utils/Utils'; -const { publishReminder, cancelReminder, hasNotificationId } = reminder; const taskInfoTable = new TaskInfoTable(); export const taskOriginData: ITaskItem[] = Object.keys(TaskMapById).map(item => { return TaskMapById[item]; }) -/** - * @description Call notification capability - * @param params { - * hour: Hour - * minute: Minute - * daysOfWeek: Frequency of a week - * title: Notice Title - * content: Contents of notice - * notificationId: Notification ID - * } - * - */ -const useReminder = (params) => { - try { - publishReminder({ - hour: Number(params?.startTime.split(':')[0]), - minute: Number(params?.startTime.split(':')[1]), - daysOfWeek: params?.frequency.split(',').map(item => Number(item)), - title: RemindContentMap[params?.taskID].title, - content: RemindContentMap[params?.taskID].content, - notificationId: params?.taskID - }); - } catch (error) { - Logger.error('publishReminder', JSON.stringify(error)); - } -} - -/** - * @description Call cancel notification capability - * @param reminderId Notification ID - */ -const useCancelReminder = (reminderId) => { - try { - cancelReminder(reminderId); - } catch (error) { - Logger.error('cancelReminder', JSON.stringify(error)); - } -} - -/** - * @description Determine whether there is a notification - * @param notificationId Notification ID - */ -const isHasNotificationId = (notificationId: number) => { - return new Promise((resolve) => { - resolve(hasNotificationId(notificationId)); - }); -} - - /** * @description Get all task status * @return object[] Database query results @@ -110,17 +58,6 @@ export const addTask = (params: TaskInfo) => { return; } return new Promise((resolve, reject) => { - // 调用通知 - if (params?.isAlarm) { - useReminder(params); - } - if (!params?.isAlarm) { - isHasNotificationId(params?.taskID).then(flag => { - if (flag) { - useCancelReminder(params.taskID); - } - }) - } taskInfoTable.updateDataByDate(params, (flag) => { if (!flag) { Logger.error('insertTaskSetting', 'updateTaskSetting Error!'); diff --git a/ETSUI/Healthy_life/entry/src/main/module.json5 b/ETSUI/Healthy_life/entry/src/main/module.json5 index ca6b45c4..044a0982 100644 --- a/ETSUI/Healthy_life/entry/src/main/module.json5 +++ b/ETSUI/Healthy_life/entry/src/main/module.json5 @@ -2,7 +2,7 @@ "module": { "name": "entry", "type": "entry", - "description": "$string:module_desc", + "description": "$string:entry_desc", "mainElement": "EntryAbility", "deviceTypes": [ "default", @@ -11,15 +11,20 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", + "orientation": "portrait", "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", + "description": "$string:MainAbility_desc", "icon": "$media:logo", "label": "$string:MainAbility_label", "startWindowIcon": "$media:logo", - "startWindowBackground": "$color:start_window_background", + "startWindowBackground": "$color:white", "visible": true, "skills": [ { diff --git a/ETSUI/Healthy_life/entry/src/main/resources/base/element/color.json b/ETSUI/Healthy_life/entry/src/main/resources/base/element/color.json index e65645fc..d0ddb219 100644 --- a/ETSUI/Healthy_life/entry/src/main/resources/base/element/color.json +++ b/ETSUI/Healthy_life/entry/src/main/resources/base/element/color.json @@ -1,9 +1,5 @@ { "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, { "name": "white", "value": "#FFFFFF" diff --git a/ETSUI/Healthy_life/entry/src/main/resources/base/element/string.json b/ETSUI/Healthy_life/entry/src/main/resources/base/element/string.json index 5f3b8614..634ef130 100644 --- a/ETSUI/Healthy_life/entry/src/main/resources/base/element/string.json +++ b/ETSUI/Healthy_life/entry/src/main/resources/base/element/string.json @@ -1,25 +1,5 @@ { "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - }, - { - "name": "EntryFormAbility_desc", - "value": "form_description" - }, - { - "name": "EntryFormAbility_label", - "value": "form_label" - }, { "name": "entry_desc", "value": "description" @@ -96,6 +76,7 @@ "name": "task_water", "value": "喝水" }, + { "name": "task_smile", "value": "每日微笑" @@ -191,6 +172,18 @@ { "name": "jump_ad", "value": " 跳过广告 %ds" + }, + { + "name": "alert", + "value": "警告" + }, + { + "name": "alert_message", + "value": "您的系统日期早于最新的打卡时间!" + }, + { + "name": "alert_button", + "value": "退出" } ] } \ No newline at end of file diff --git a/ETSUI/Healthy_life/entry/src/main/resources/base/profile/form_config.json b/ETSUI/Healthy_life/entry/src/main/resources/base/profile/form_config.json new file mode 100644 index 00000000..04f3ea9d --- /dev/null +++ b/ETSUI/Healthy_life/entry/src/main/resources/base/profile/form_config.json @@ -0,0 +1,38 @@ +{ + "forms": [ + { + "name": "agency", + "description": "This is a service widget.", + "src": "./js/agency/pages/index/index", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": true, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "defaultDimension": "2*4", + "supportDimensions": [ + "2*4" + ] + }, + { + "name": "progress", + "description": "This is a service widget.", + "src": "./js/progress/pages/index/index", + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "colorMode": "auto", + "isDefault": false, + "updateEnabled": true, + "scheduledUpdateTime": "00:00", + "defaultDimension": "2*2", + "supportDimensions": [ + "2*2" + ] + } + ] +} \ No newline at end of file diff --git a/ETSUI/Healthy_life/entry/src/main/resources/en_US/element/string.json b/ETSUI/Healthy_life/entry/src/main/resources/en_US/element/string.json index 5f3b8614..24cab575 100644 --- a/ETSUI/Healthy_life/entry/src/main/resources/en_US/element/string.json +++ b/ETSUI/Healthy_life/entry/src/main/resources/en_US/element/string.json @@ -1,9 +1,5 @@ { "string": [ - { - "name": "module_desc", - "value": "module description" - }, { "name": "EntryAbility_desc", "value": "description" @@ -11,186 +7,6 @@ { "name": "EntryAbility_label", "value": "label" - }, - { - "name": "EntryFormAbility_desc", - "value": "form_description" - }, - { - "name": "EntryFormAbility_label", - "value": "form_label" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "运动总有新玩法" - }, - { - "name": "MainAbility_label", - "value": "健康生活" - }, - { - "name": "form_FormAbility_desc", - "value": "form_description" - }, - { - "name": "form_FormAbility_label", - "value": "form_label" - }, - { - "name": "tab_home", - "value": "首页" - }, - { - "name": "mine_personal_data", - "value": "个人资料" - }, - { - "name": "mine_check_updates", - "value": "检查更新" - }, - { - "name": "mine_about", - "value": "关于" - }, - { - "name": "clock_in", - "value": "打卡" - }, - { - "name": "got_it", - "value": "知道了" - }, - { - "name": "tab_achievement", - "value": "成就" - }, - { - "name": "achievement", - "value": "我的成就" - }, - { - "name": "tab_mine", - "value": "我的" - }, - { - "name": "task_list", - "value": "任务列表" - }, - { - "name": "no_task", - "value": "暂无任务,请添加任务" - }, - { - "name": "task_morning", - "value": "早起" - }, - { - "name": "task_apple", - "value": "吃苹果" - }, - { - "name": "task_water", - "value": "喝水" - }, - { - "name": "task_smile", - "value": "每日微笑" - }, - { - "name": "task_brush", - "value": "每日刷牙" - }, - { - "name": "task_night", - "value": "早睡" - }, - { - "name": "task_done", - "value": "已完成" - }, - { - "name": "task_achievement_level", - "value": "连续%d天达成" - }, - { - "name": "already_open", - "value": "已开启" - }, - { - "name": "target_setting", - "value": "目标设置" - }, - { - "name": "open_reminder", - "value": "开启提醒" - }, - { - "name": "remind_time", - "value": "提醒时间" - }, - { - "name": "frequency", - "value": "频率" - }, - { - "name": "complete", - "value": "完成" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "confirm", - "value": "确认" - }, - { - "name": "set_your_frequency", - "value": "请设置您的频率" - }, - { - "name": "target_progress", - "value": "目标进度" - }, - { - "name": "Helvetica", - "value": "Helvetica" - }, - { - "name": "PingFangSC_Regular", - "value": "PingFangSC-Regular" - }, - { - "name": "HarmonyHeiTi", - "value": "HarmonyHeiTi" - }, - { - "name": "HarmonyHeiTi_Bold", - "value": "HarmonyHeiTi-Bold" - }, - { - "name": "HarmonyHeiTi_Medium", - "value": "HarmonyHeiTi-Medium" - }, - { - "name": "sure", - "value": "确定" - }, - { - "name": "privacy_title", - "value": "请在“健康生活”权限管理中开启“XX”权限" - }, - { - "name": "privacy_desc", - "value": "该功能支持XX…(功能介绍)" - }, - { - "name": "jump_ad", - "value": " 跳过广告 %ds" } ] } \ No newline at end of file diff --git a/ETSUI/Healthy_life/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/Healthy_life/entry/src/main/resources/zh_CN/element/string.json index c12e251a..597ecf95 100644 --- a/ETSUI/Healthy_life/entry/src/main/resources/zh_CN/element/string.json +++ b/ETSUI/Healthy_life/entry/src/main/resources/zh_CN/element/string.json @@ -11,186 +11,6 @@ { "name": "EntryAbility_label", "value": "label" - }, - { - "name": "EntryFormAbility_desc", - "value": "form_description" - }, - { - "name": "EntryFormAbility_label", - "value": "form_label" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "运动总有新玩法" - }, - { - "name": "MainAbility_label", - "value": "健康生活" - }, - { - "name": "form_FormAbility_desc", - "value": "form_description" - }, - { - "name": "form_FormAbility_label", - "value": "form_label" - }, - { - "name": "tab_home", - "value": "首页" - }, - { - "name": "mine_personal_data", - "value": "个人资料" - }, - { - "name": "mine_check_updates", - "value": "检查更新" - }, - { - "name": "mine_about", - "value": "关于" - }, - { - "name": "clock_in", - "value": "打卡" - }, - { - "name": "got_it", - "value": "知道了" - }, - { - "name": "tab_achievement", - "value": "成就" - }, - { - "name": "achievement", - "value": "我的成就" - }, - { - "name": "tab_mine", - "value": "我的" - }, - { - "name": "task_list", - "value": "任务列表" - }, - { - "name": "no_task", - "value": "暂无任务,请添加任务" - }, - { - "name": "task_morning", - "value": "早起" - }, - { - "name": "task_apple", - "value": "吃苹果" - }, - { - "name": "task_water", - "value": "喝水" - }, - { - "name": "task_smile", - "value": "每日微笑" - }, - { - "name": "task_brush", - "value": "每日刷牙" - }, - { - "name": "task_night", - "value": "早睡" - }, - { - "name": "task_done", - "value": "已完成" - }, - { - "name": "task_achievement_level", - "value": "连续%d天达成" - }, - { - "name": "already_open", - "value": "已开启" - }, - { - "name": "target_setting", - "value": "目标设置" - }, - { - "name": "open_reminder", - "value": "开启提醒" - }, - { - "name": "remind_time", - "value": "提醒时间" - }, - { - "name": "frequency", - "value": "频率" - }, - { - "name": "complete", - "value": "完成" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "confirm", - "value": "确认" - }, - { - "name": "set_your_frequency", - "value": "请设置您的频率" - }, - { - "name": "target_progress", - "value": "目标进度" - }, - { - "name": "Helvetica", - "value": "Helvetica" - }, - { - "name": "PingFangSC_Regular", - "value": "PingFangSC-Regular" - }, - { - "name": "HarmonyHeiTi", - "value": "HarmonyHeiTi" - }, - { - "name": "HarmonyHeiTi_Bold", - "value": "HarmonyHeiTi-Bold" - }, - { - "name": "HarmonyHeiTi_Medium", - "value": "HarmonyHeiTi-Medium" - }, - { - "name": "sure", - "value": "确定" - }, - { - "name": "privacy_title", - "value": "请在“健康生活”权限管理中开启“XX”权限" - }, - { - "name": "privacy_desc", - "value": "该功能支持XX…(功能介绍)" - }, - { - "name": "jump_ad", - "value": " 跳过广告 %ds" } ] } \ No newline at end of file diff --git a/ETSUI/Healthy_life/package.json b/ETSUI/Healthy_life/package.json index 8fdfb621..470839b9 100644 --- a/ETSUI/Healthy_life/package.json +++ b/ETSUI/Healthy_life/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"healthy_life", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "healthy_life", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/List/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/List/entry/src/main/ets/entryability/EntryAbility.ts index 1719588a..388509e2 100644 --- a/ETSUI/List/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/List/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,10 +14,10 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/ETSUI/List/entry/src/main/ets/pages/ListIndex.ets b/ETSUI/List/entry/src/main/ets/pages/ListIndex.ets index e84d3102..dbbe8a99 100644 --- a/ETSUI/List/entry/src/main/ets/pages/ListIndex.ets +++ b/ETSUI/List/entry/src/main/ets/pages/ListIndex.ets @@ -30,6 +30,7 @@ struct ListIndex { } .size({ width: LAYOUT_WIDTH_OR_HEIGHT, height: LAYOUT_WIDTH_OR_HEIGHT }) .title(STORE) + .titleMode(NavigationTitleMode.Mini) } .height(LAYOUT_WIDTH_OR_HEIGHT) .backgroundColor($r('app.color.primaryBgColor')) diff --git a/ETSUI/List/entry/src/main/module.json5 b/ETSUI/List/entry/src/main/module.json5 index 1e82b178..87bd4701 100644 --- a/ETSUI/List/entry/src/main/module.json5 +++ b/ETSUI/List/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/List/entry/src/main/resources/zh_CN/element/string.json b/ETSUI/List/entry/src/main/resources/zh_CN/element/string.json index cd9d08f9..f77f211d 100644 --- a/ETSUI/List/entry/src/main/resources/zh_CN/element/string.json +++ b/ETSUI/List/entry/src/main/resources/zh_CN/element/string.json @@ -1,5 +1,9 @@ { "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, { "name": "EntryAbility_desc", "value": "description" diff --git a/ETSUI/List/package.json b/ETSUI/List/package.json index 60ddfc51..1b61c0c2 100644 --- a/ETSUI/List/package.json +++ b/ETSUI/List/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"list", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "list", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets b/ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets index 63e2eccc..d5ad9aab 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/common/constants/CommonConstant.ets @@ -14,7 +14,8 @@ */ // Thousandth -export const THOUSANDTH_80: string = '8%'; +export const THOUSANDTH_80: string = '8%'; +export const THOUSANDTH_100: string = '10%'; export const THOUSANDTH_400: string = '40%'; export const THOUSANDTH_500: string = '50%'; export const THOUSANDTH_560: string = '56%'; @@ -45,7 +46,7 @@ export const ADD_TASK_TITLE: string = '添加任务'; export const EDIT_TASK_TITLE: string = '编辑任务'; // prompt message -export const SETTING_FINISHED_MESSAGE = '设置完成!!!'; +export const SETTING_FINISHED_MESSAGE = '设置完成'; export const CHOOSE_TIME_OUT_RANGE: string = '选择时间超出范围'; // date format diff --git a/ETSUI/List_HDC/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/List_HDC/entry/src/main/ets/entryability/EntryAbility.ts index 18e82460..a98af6ed 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/List_HDC/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,10 +14,10 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/ETSUI/List_HDC/entry/src/main/ets/model/TaskInitList.ets b/ETSUI/List_HDC/entry/src/main/ets/model/TaskInitList.ets index 53a54364..9c384aba 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/model/TaskInitList.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/model/TaskInitList.ets @@ -47,7 +47,7 @@ export const TaskInitList: TaskListItem[] = [ taskID: 2, taskName: $r('app.string.task_water'), icon: $r('app.media.water'), - targetValue: '1', + targetValue: '0.25', isOpen: true, unit: 'L', isAlarm: false, diff --git a/ETSUI/List_HDC/entry/src/main/ets/pages/ListIndexPage.ets b/ETSUI/List_HDC/entry/src/main/ets/pages/ListIndexPage.ets index cfa8d005..b3bc22de 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/pages/ListIndexPage.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/pages/ListIndexPage.ets @@ -33,6 +33,7 @@ struct Index { } .size({ width: THOUSANDTH_1000, height: THOUSANDTH_1000 }) .title(ADD_TASK_TITLE) + .titleMode(NavigationTitleMode.Mini) } .backgroundColor($r('app.color.primaryBgColor')) .height(THOUSANDTH_1000) diff --git a/ETSUI/List_HDC/entry/src/main/ets/pages/TaskEditPage.ets b/ETSUI/List_HDC/entry/src/main/ets/pages/TaskEditPage.ets index 7935b9eb..6e66a9b4 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/pages/TaskEditPage.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/pages/TaskEditPage.ets @@ -30,6 +30,7 @@ struct TaskEdit { } .size({ width: THOUSANDTH_1000, height: THOUSANDTH_1000 }) .title(EDIT_TASK_TITLE) + .titleMode(NavigationTitleMode.Mini) } .height(THOUSANDTH_1000) .backgroundColor($r('app.color.primaryBgColor')) diff --git a/ETSUI/List_HDC/entry/src/main/ets/view/TaskDetail.ets b/ETSUI/List_HDC/entry/src/main/ets/view/TaskDetail.ets index 00850987..504fc3cc 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/view/TaskDetail.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/view/TaskDetail.ets @@ -29,9 +29,9 @@ import { BroadCast, BroadCastType } from '../common/utils/BroadCast'; import { EventSourceManager } from '../model/EventSourceManager'; import { CustomDialogView } from './CustomDialogView'; -@Styles function listItemStyle () { +@Styles function listItemStyle() { .backgroundColor($r('app.color.white')) - .height(commonConst.THOUSANDTH_80) + .height(commonConst.DEFAULT_56) .borderRadius(commonConst.DEFAULT_10) .padding({ left: commonConst.DEFAULT_12, right: commonConst.DEFAULT_12 }) } @@ -58,74 +58,75 @@ export default struct TaskDetail { } build() { - Row() { - Column() { - List({ space: commonConst.LIST_ITEM_SPACE }) { - ListItem() { - TaskChooseItem() - } - .listItemStyle() - - ListItem() { - TargetSetItem() - } - .listItemStyle() - .enabled( - this.settingParams?.isOpen - && (this.settingParams?.taskID !== taskType.smile) - && (this.settingParams?.taskID !== taskType.brushTeeth) - ) - .onClick(() => { - this.broadCast.emit( - BroadCastType.SHOW_TARGET_SETTING_DIALOG); - }) - - ListItem() { - OpenRemindItem() - } - .listItemStyle() - .enabled(this.settingParams?.isOpen) - - ListItem() { - RemindTimeItem() - } - .listItemStyle() - .enabled(this.settingParams?.isOpen && this.settingParams?.isAlarm) - .onClick(() => { - this.broadCast.emit( - BroadCastType.SHOW_REMIND_TIME_DIALOG - ); - }) - - ListItem() { - FrequencyItem() - } - .listItemStyle() - .enabled(this.settingParams?.isOpen) - .onClick(() => { - this.broadCast.emit( - BroadCastType.SHOW_FREQUENCY_DIALOG, - ); - }) + Column() { + List({ space: commonConst.LIST_ITEM_SPACE }) { + ListItem() { + TaskChooseItem() + } + .listItemStyle() + + ListItem() { + TargetSetItem() + } + .listItemStyle() + .enabled( + this.settingParams?.isOpen + && (this.settingParams?.taskID !== taskType.smile) + && (this.settingParams?.taskID !== taskType.brushTeeth) + ) + .onClick(() => { + this.broadCast.emit( + BroadCastType.SHOW_TARGET_SETTING_DIALOG); + }) + ListItem() { + OpenRemindItem() } - .width(commonConst.THOUSANDTH_940) - .margin({ bottom: commonConst.THOUSANDTH_400 }) + .listItemStyle() + .enabled(this.settingParams?.isOpen) - Button() { - Text($r('app.string.complete')).fontSize(commonConst.DEFAULT_20).fontColor($r('app.color.blueColor')) + ListItem() { + RemindTimeItem() } - .width(commonConst.THOUSANDTH_800) - .height(commonConst.DEFAULT_48) - .backgroundColor($r('app.color.borderColor')) + .listItemStyle() + .enabled(this.settingParams?.isOpen && this.settingParams?.isAlarm) .onClick(() => { - this.finishTaskEdit(); + this.broadCast.emit( + BroadCastType.SHOW_REMIND_TIME_DIALOG + ); }) - CustomDialogView() + ListItem() { + FrequencyItem() + } + .listItemStyle() + .enabled(this.settingParams?.isOpen) + .onClick(() => { + this.broadCast.emit( + BroadCastType.SHOW_FREQUENCY_DIALOG, + ); + }) + + } + .width(commonConst.THOUSANDTH_940) + + Button() { + Text($r('app.string.complete')).fontSize(commonConst.DEFAULT_20).fontColor($r('app.color.blueColor')) } - .width(commonConst.THOUSANDTH_1000) + .width(commonConst.THOUSANDTH_800) + .height(commonConst.DEFAULT_48) + .backgroundColor($r('app.color.borderColor')) + .onClick(() => { + this.finishTaskEdit(); + }) + .position({ + x: commonConst.THOUSANDTH_100, + y: commonConst.THOUSANDTH_800 + }) + + CustomDialogView() } + .width(commonConst.THOUSANDTH_1000) } } diff --git a/ETSUI/List_HDC/entry/src/main/ets/view/TaskList.ets b/ETSUI/List_HDC/entry/src/main/ets/view/TaskList.ets index f414145c..da6d9a1d 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/view/TaskList.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/view/TaskList.ets @@ -53,7 +53,7 @@ export default struct TaskList { .height(commonConst.THOUSANDTH_80) .borderRadius(commonConst.DEFAULT_12) .onClick(() => { - router.push({ + router.pushUrl({ url: 'pages/TaskEditPage', params: { params: formatParams(item), diff --git a/ETSUI/List_HDC/entry/src/main/ets/view/TaskSettingDialog.ets b/ETSUI/List_HDC/entry/src/main/ets/view/TaskSettingDialog.ets index e06ebd25..0485459a 100644 --- a/ETSUI/List_HDC/entry/src/main/ets/view/TaskSettingDialog.ets +++ b/ETSUI/List_HDC/entry/src/main/ets/view/TaskSettingDialog.ets @@ -27,7 +27,7 @@ export struct TargetSettingDialog { controller: CustomDialogController; drinkRange: string[] = createDrinkRange(); appleRange: string[] = createAppleRange(); - currentValue: string = '1'; + currentValue: string = this.settingParams.targetValue; currentTime: string = commonConst.DEFAULT_TIME; private tip: string = ''; diff --git a/ETSUI/List_HDC/entry/src/main/module.json5 b/ETSUI/List_HDC/entry/src/main/module.json5 index 1e82b178..87bd4701 100644 --- a/ETSUI/List_HDC/entry/src/main/module.json5 +++ b/ETSUI/List_HDC/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/List_HDC/package.json b/ETSUI/List_HDC/package.json index 75fb28f1..7d56e1c9 100644 --- a/ETSUI/List_HDC/package.json +++ b/ETSUI/List_HDC/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "list_hdc", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "list_hdc", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/ETSUI/Multi_device/build-profile.json5 b/ETSUI/Multi_device/build-profile.json5 index fc53829b..d7b1117c 100644 --- a/ETSUI/Multi_device/build-profile.json5 +++ b/ETSUI/Multi_device/build-profile.json5 @@ -1,5 +1,6 @@ { "app": { + "signingConfigs": [], "compileSdkVersion": 9, "compatibleSdkVersion": 9, "products": [ diff --git a/ETSUI/Multi_device/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/Multi_device/entry/src/main/ets/common/constants/CommonConstants.ets index d69eb196..48a6aff8 100644 --- a/ETSUI/Multi_device/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/ETSUI/Multi_device/entry/src/main/ets/common/constants/CommonConstants.ets @@ -32,7 +32,7 @@ export default class CommonConstants { static readonly BORDER_RADIUS = 10; static readonly SWIPER_WIDTH = 330; static readonly SWIPER_SCALE = 0.9; - static readonly ITEM_SPACE = 15; + static readonly ITEM_SPACE = 12; static readonly PADDING = 15; static readonly PADDING_SCALE = 0.05; } \ No newline at end of file diff --git a/ETSUI/Multi_device/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/Multi_device/entry/src/main/ets/entryability/EntryAbility.ts index af4d05f5..80bf23d9 100644 --- a/ETSUI/Multi_device/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/Multi_device/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,10 +14,10 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' -export default class entryAbility extends Ability { +export default class entryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); @@ -35,6 +35,14 @@ export default class entryAbility extends Ability { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + windowStage.getMainWindow((err, data) => { + if (err && err.code) { + console.error('getMainWindow error'); + return; + } + data.setSystemBarEnable([]); + }) + windowStage.loadContent('pages/Home', (err, data) => { if (err.code) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); diff --git a/ETSUI/Multi_device/entry/src/main/ets/pages/Home.ets b/ETSUI/Multi_device/entry/src/main/ets/pages/Home.ets index e392d957..aee1e532 100644 --- a/ETSUI/Multi_device/entry/src/main/ets/pages/Home.ets +++ b/ETSUI/Multi_device/entry/src/main/ets/pages/Home.ets @@ -41,7 +41,7 @@ struct HomeComponent { TabContent() { HomeTabComponent() } - .padding({ left: $r('app.float.home_padding'), right: $r('app.float.home_padding')}) + .padding({ left: $r('app.float.home_padding') }) TabContent() { } diff --git a/ETSUI/Multi_device/entry/src/main/module.json5 b/ETSUI/Multi_device/entry/src/main/module.json5 index a14a4b9f..98eff6f5 100644 --- a/ETSUI/Multi_device/entry/src/main/module.json5 +++ b/ETSUI/Multi_device/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/Multi_device/package.json b/ETSUI/Multi_device/package.json index 0f648d11..317da94b 100644 --- a/ETSUI/Multi_device/package.json +++ b/ETSUI/Multi_device/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"multi_device", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "multi_device", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/OHLayoutAlign/entry/src/main/ets/entryability/EntryAbility.ts index 05a7e683..7cfa648a 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,5 +1,5 @@ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility'; import Window from '@ohos.window' export default class EntryAbility extends Ability { diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/LayoutAlignIndex.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/LayoutAlignIndex.ets index 4106d4b5..e8c0a428 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/LayoutAlignIndex.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/LayoutAlignIndex.ets @@ -48,7 +48,7 @@ struct LayoutAlignIndex { ListItem() { ListItemComp({ item: item }).margin({ top: MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN }) } - }, item => item.name) + }, item => JSON.stringify(item)) } .listDirection(Axis.Vertical) .margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) @@ -88,7 +88,7 @@ struct ListItemComp { .margin({ left: MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN, right: MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN }) .backgroundColor($r("app.color.white")) .onClick(() => { - router.push({ + router.pushUrl({ url: SECOND_PAGE, params: { containerType: this.item['containerType'], diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/Second.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/Second.ets index b039c1fb..ff7831c2 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/Second.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/pages/Second.ets @@ -57,16 +57,18 @@ struct Second { Column({ space: MARGIN_FONT_SIZE_SPACE.SIXTH_MARGIN }) { Column() { BackComp({ componentName: this.componentName }) - if (this.containerType == CONTAINER_TYPE.FLEX) { + if (this.containerType === CONTAINER_TYPE.FLEX) { FlexShowList() - } else if (this.containerType == CONTAINER_TYPE.COLUMN) { + } else if (this.containerType === CONTAINER_TYPE.COLUMN) { ColumnShowList() - } else if (this.containerType == CONTAINER_TYPE.ROW) { + } else if (this.containerType === CONTAINER_TYPE.ROW) { RowShowList() } else { StackComponent() } - }.width(ALL_PERCENT).height(ALL_PERCENT) + } + .width(ALL_PERCENT) + .height(ALL_PERCENT) } .width(ALL_PERCENT) } diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnAxisAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnAxisAlignRadioList.ets index 3a63f294..885a0694 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnAxisAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnAxisAlignRadioList.ets @@ -43,7 +43,7 @@ export struct ColumnAxisAlignRadioList { ForEach(this.radioList, (item, index) => { AxisAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -67,7 +67,7 @@ struct AxisAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.START: this.currentColumnAlignItems = HorizontalAlign.Start; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnMainAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnMainAlignRadioList.ets index fb8703b0..441be60a 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnMainAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnMainAlignRadioList.ets @@ -13,19 +13,19 @@ * limitations under the License. */ -import { MARGIN_FONT_SIZE_SPACE, ATTRIBUTE_OPACITY, ATTRIBUTE,ALL_PERCENT } from '../common/Constants/CommonConstants'; -import {getColumnModuleList} from '../viewmodel/AttributeModuleData'; -import {ContainerModuleItem} from '../common/bean/ContainerModuleItem'; +import { MARGIN_FONT_SIZE_SPACE, ATTRIBUTE_OPACITY, ATTRIBUTE, ALL_PERCENT } from '../common/Constants/CommonConstants'; +import { getColumnModuleList } from '../viewmodel/AttributeModuleData'; +import { ContainerModuleItem } from '../common/bean/ContainerModuleItem'; /** *Set Main Alignment in Column */ @Component export struct ColumnMainAlignRadioList { - private columnModuleList :ContainerModuleItem[] = getColumnModuleList(); + private columnModuleList: ContainerModuleItem[] = getColumnModuleList(); private groupName: string = this.columnModuleList[0]['groupName']; - private moduleName: Resource = this.columnModuleList[0]['moduleName']; - private radioList: Array =this.columnModuleList[0]['attributeList']; + private moduleName: Resource = this.columnModuleList[0]['moduleName']; + private radioList: Array = this.columnModuleList[0]['attributeList']; build() { Column({ space: MARGIN_FONT_SIZE_SPACE.FIRST_MARGIN }) { @@ -44,7 +44,7 @@ export struct ColumnMainAlignRadioList { ForEach(this.radioList, (item, index) => { MainAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -68,7 +68,7 @@ struct MainAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.START: this.currentColumnJustifyContent = FlexAlign.Start; @@ -81,7 +81,9 @@ struct MainAlignRadioItem { break; } }) - Text(this.textName).fontSize(MARGIN_FONT_SIZE_SPACE.THIRD_MARGIN).opacity(ATTRIBUTE_OPACITY) + Text(this.textName) + .fontSize(MARGIN_FONT_SIZE_SPACE.THIRD_MARGIN) + .opacity(ATTRIBUTE_OPACITY) } } } diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnShowList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnShowList.ets index f5378311..09f6fdbd 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnShowList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/ColumnShowList.ets @@ -33,7 +33,7 @@ export struct ColumnShowList { Column() { ForEach(LIST, (item) => { CommonItem({ item: item }) - }, item => item) + }, item => JSON.stringify(item)) } .alignItems(this.currentColumnAlignItems) .justifyContent(this.currentColumnJustifyContent) @@ -43,14 +43,15 @@ export struct ColumnShowList { .backgroundColor($r("app.color.show_list_backgroundColor")) .margin({ top: MARGIN_FONT_SIZE_SPACE.FIRST_MARGIN }) // set main align - ColumnMainAlignRadioList().margin({top:MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN}) + ColumnMainAlignRadioList() + .margin({top:MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN}) // set axis align - ColumnAxisAlignRadioList().margin({top:MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN}) + ColumnAxisAlignRadioList() + .margin({top:MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN}) } .layoutWeight(1) .height(ALL_PERCENT) .width(ALL_PERCENT) - } } diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexAxisAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexAxisAlignRadioList.ets index a279d046..ddea8532 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexAxisAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexAxisAlignRadioList.ets @@ -44,7 +44,7 @@ export struct FlexAxisAlignRadioList { ForEach(this.radioList, (item, index) => { AxisAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -68,7 +68,7 @@ struct AxisAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.START: this.currentFlexAlignItems = ItemAlign.Start; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainAlignRadioList.ets index aa11ada8..010440bd 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainAlignRadioList.ets @@ -45,7 +45,7 @@ export struct FlexMainAlignRadioList { ForEach(this.radioList, (item, index) => { MainAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN}) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -70,7 +70,7 @@ struct MainAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.START: this.currentFlexJustifyContent = FlexAlign.Start; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainDirectionRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainDirectionRadioList.ets index e0c08f0f..ec0e8d6a 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainDirectionRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexMainDirectionRadioList.ets @@ -44,7 +44,7 @@ export struct FlexMainDirectionRadioList { ForEach(this.radioList, (item, index) => { MainDirectionRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -68,7 +68,7 @@ struct MainDirectionRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.COLUMN: this.currentFlexDirection = FlexDirection.Column; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexShowList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexShowList.ets index 2ae4d638..aa59acc6 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexShowList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/FlexShowList.ets @@ -43,7 +43,7 @@ export struct FlexShowList { }) { ForEach(this.list, (item) => { CommonItem({ item: item }) - }, item => item.toString()) + }, item => JSON.stringify(item)) } .padding(MARGIN_FONT_SIZE_SPACE.COMMON_PADDING) .width(ALL_PERCENT) diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowAxisAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowAxisAlignRadioList.ets index 72edd564..87e052fc 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowAxisAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowAxisAlignRadioList.ets @@ -44,7 +44,7 @@ export struct RowAxisAlignRadioList { ForEach(this.radioList, (item, index) => { AxisAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -68,7 +68,7 @@ struct AxisAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.TOP: this.currentRowAlignItems = VerticalAlign.Top; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets index af8739bc..eedfdfed 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowMainAlignRadioList.ets @@ -44,7 +44,7 @@ export struct RowMainAlignRadioList { ForEach(this.radioList, (item, index) => { MainAlignRadioItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) @@ -68,7 +68,7 @@ struct MainAlignRadioItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { + .onClick(() => { switch (this.textName) { case ATTRIBUTE.START: this.currentRowJustifyContent = FlexAlign.Start; diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowShowList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowShowList.ets index 3f22f1fd..2293d398 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowShowList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/RowShowList.ets @@ -28,13 +28,11 @@ export struct RowShowList { build() { Column() { - - // Row中元素对齐方式布局 Row() { ForEach(LIST, (item) => { CommonItem({ item: item }) - }, item => item) + }, item => JSON.stringify(item)) } .alignItems(this.currentRowAlignItems) .justifyContent(this.currentRowJustifyContent) @@ -45,9 +43,11 @@ export struct RowShowList { .margin({ top: MARGIN_FONT_SIZE_SPACE.FIRST_MARGIN }) // set main align - RowMainAlignRadioList().margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) + RowMainAlignRadioList() + .margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) // set axis align - RowAxisAlignRadioList().margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) + RowAxisAlignRadioList() + .margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) } .layoutWeight(1) .height(ALL_PERCENT) diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackAlignRadioList.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackAlignRadioList.ets index 814b9a61..119d3e9f 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackAlignRadioList.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackAlignRadioList.ets @@ -43,10 +43,10 @@ export struct StackAlignRadioList { ForEach(this.radioList, (item, index) => { StackAlignRadioListItem({ textName: item, groupName: this.groupName, isChecked: index === 0 ? true : false }) .margin({ right: MARGIN_FONT_SIZE_SPACE.COMMON_MARGIN }) - }) + }, item => JSON.stringify(item)) } .width(ALL_PERCENT) - .height(MARGIN_FONT_SIZE_SPACE.SEVENTH_MARGIN) + .height(ALL_PERCENT) } .width(ALL_PERCENT) .justifyContent(FlexAlign.Start) @@ -56,11 +56,11 @@ export struct StackAlignRadioList { @Component export struct StackAlignRadioListItem { - @Consume message: string; private textName: string; private groupName: string; private isChecked: boolean; @Consume currentStackAlignContent: Alignment; + @Consume message: string; build() { Row() { @@ -68,23 +68,27 @@ export struct StackAlignRadioListItem { .checked(this.isChecked) .height((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) .width((MARGIN_FONT_SIZE_SPACE.SECOND_MARGIN)) - .onChange(() => { - this.message = this.textName; + .onClick(() => { switch (this.textName) { case ATTRIBUTE.TOP_START: this.currentStackAlignContent = Alignment.TopStart; + this.message = ATTRIBUTE.TOP_START; break; case ATTRIBUTE.TOP_END: this.currentStackAlignContent = Alignment.TopEnd; + this.message = ATTRIBUTE.TOP_END; break; case ATTRIBUTE.CENTER: this.currentStackAlignContent = Alignment.Center; + this.message = ATTRIBUTE.CENTER; break; case ATTRIBUTE.BOTTOM_START: this.currentStackAlignContent = Alignment.BottomStart; + this.message = ATTRIBUTE.BOTTOM_START; break; default: this.currentStackAlignContent = Alignment.BottomEnd; + this.message = ATTRIBUTE.BOTTOM_END; break; } }) diff --git a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackComponent.ets b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackComponent.ets index 4ce6f12b..c10b5478 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackComponent.ets +++ b/ETSUI/OHLayoutAlign/entry/src/main/ets/view/StackComponent.ets @@ -27,9 +27,8 @@ export struct StackComponent { build() { Column() { - Stack({ alignContent: this.currentStackAlignContent }) { - Text("") + Text('') .width(ALL_PERCENT) .height(ALL_PERCENT) .fontSize(MARGIN_FONT_SIZE_SPACE.FOURTH_MARGIN) @@ -46,11 +45,11 @@ export struct StackComponent { .width(ALL_PERCENT) .height(SHOW_LIST_HEIGHT_PERCENT.STACK_SHOW_LIST_HEIGHT) // set align in stack - StackAlignRadioList().margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) + StackAlignRadioList() + .margin({ top: MARGIN_FONT_SIZE_SPACE.EIGHTH_MARGIN }) } .layoutWeight(1) .height(ALL_PERCENT) .width(ALL_PERCENT) - } } diff --git a/ETSUI/OHLayoutAlign/entry/src/main/module.json5 b/ETSUI/OHLayoutAlign/entry/src/main/module.json5 index 0e288c05..82ec5968 100644 --- a/ETSUI/OHLayoutAlign/entry/src/main/module.json5 +++ b/ETSUI/OHLayoutAlign/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", @@ -20,6 +24,7 @@ "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", + "orientation": "portrait", "visible": true, "skills": [ { diff --git a/ETSUI/OHLayoutAlign/package.json b/ETSUI/OHLayoutAlign/package.json index 5fd132ed..72ae3b8e 100644 --- a/ETSUI/OHLayoutAlign/package.json +++ b/ETSUI/OHLayoutAlign/package.json @@ -11,8 +11,8 @@ "repository":{}, "version":"1.0.0", "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "@ohos/hypium":"1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } \ No newline at end of file diff --git a/ETSUI/RankingDemo/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/RankingDemo/entry/src/main/ets/entryability/EntryAbility.ts index 050f8778..74885804 100644 --- a/ETSUI/RankingDemo/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/RankingDemo/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' export default class EntryAbility extends Ability { diff --git a/ETSUI/RankingDemo/entry/src/main/ets/pages/RankPage.ets b/ETSUI/RankingDemo/entry/src/main/ets/pages/RankPage.ets index a6e46676..33e0d62b 100644 --- a/ETSUI/RankingDemo/entry/src/main/ets/pages/RankPage.ets +++ b/ETSUI/RankingDemo/entry/src/main/ets/pages/RankPage.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import prompt from '@ohos.promptAction'; import { RankViewModel } from '../viewmodel/RankViewModel'; import { RankData } from '../common/bean/RankData'; import { ListHeaderComponent } from '../view/ListHeaderComponent'; @@ -52,8 +52,12 @@ struct RankPage { } onBackPress() { + let options = { + message: $r('app.string.prompt_text'), + duration: TIME + } if (this.isShowToast()) { - prompt.showToast({ message: $r('app.string.prompt_text'), duration: TIME }); + prompt.showToast(options); this.clickBackTimeRecord = new Date().getTime(); return true; } @@ -70,11 +74,16 @@ struct RankPage { TitleComponent({ isRefreshData: $isSwitchDataSource, title: TITLE }) // The head style of List component. ListHeaderComponent({ - paddingValue: { left: Style.RANK_PADDING, - right: Style.RANK_PADDING }, + paddingValue: { + left: Style.RANK_PADDING, + right: Style.RANK_PADDING + }, widthValue: Style.CONTENT_WIDTH - }).margin({ top: Style.HEADER_MARGIN_TOP, - bottom: Style.HEADER_MARGIN_BOTTOM }) + }) + .margin({ + top: Style.HEADER_MARGIN_TOP, + bottom: Style.HEADER_MARGIN_BOTTOM + }) // The style of List component. this.RankList(Style.CONTENT_WIDTH) } @@ -93,14 +102,16 @@ struct RankPage { isSwitchDataSource: this.isSwitchDataSource }) } - }, (item, index) => item.id) + }, item => JSON.stringify(item)) } .width(WEIGHT) .height(Style.LIST_HEIGHT) .divider({ strokeWidth: Style.STROKE_WIDTH }) } - .padding({ left: Style.RANK_PADDING, - right: Style.RANK_PADDING }) + .padding({ + left: Style.RANK_PADDING, + right: Style.RANK_PADDING + }) .borderRadius(Style.BORDER_RADIUS) .width(widthValue) .alignItems(HorizontalAlign.Center) diff --git a/ETSUI/RankingDemo/entry/src/main/ets/view/TitleComponent.ets b/ETSUI/RankingDemo/entry/src/main/ets/view/TitleComponent.ets index 3a6ecb8b..3d15432e 100644 --- a/ETSUI/RankingDemo/entry/src/main/ets/view/TitleComponent.ets +++ b/ETSUI/RankingDemo/entry/src/main/ets/view/TitleComponent.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import AppContext from '@ohos.application.context'; +import AppContext from '@ohos.app.ability.common'; import { FontSize, TitleBarStyle, WEIGHT } from '../common/constants/Constants'; @Component @@ -29,7 +29,7 @@ export struct TitleComponent { .width(TitleBarStyle.IMAGE_BACK_SIZE) .margin({ right: TitleBarStyle.IMAGE_BACK_MARGIN_RIGHT }) .onClick(() => { - let handler = getContext(this) as AppContext.AbilityContext; + let handler = getContext(this) as AppContext.UIAbilityContext; handler.terminateSelf(); }) Text(this.title) diff --git a/ETSUI/RankingDemo/entry/src/main/module.json5 b/ETSUI/RankingDemo/entry/src/main/module.json5 index 4277a836..609cd388 100644 --- a/ETSUI/RankingDemo/entry/src/main/module.json5 +++ b/ETSUI/RankingDemo/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "entryAbility", diff --git a/ETSUI/RankingDemo/package.json b/ETSUI/RankingDemo/package.json index bf26b8ad..c799079b 100644 --- a/ETSUI/RankingDemo/package.json +++ b/ETSUI/RankingDemo/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"ranking_demo", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } -} \ No newline at end of file + "license": "ISC", + "devDependencies": {}, + "name": "ranking_demo", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } +} diff --git a/ETSUI/SetAppFontSize/build-profile.json5 b/ETSUI/SetAppFontSize/build-profile.json5 index fc53829b..7d184418 100644 --- a/ETSUI/SetAppFontSize/build-profile.json5 +++ b/ETSUI/SetAppFontSize/build-profile.json5 @@ -5,7 +5,7 @@ "products": [ { "name": "default", - "signingConfig": "default", + "signingConfig": "default" } ] }, diff --git a/ETSUI/SetAppFontSize/entry/src/main/ets/entryability/EntryAbility.ets b/ETSUI/SetAppFontSize/entry/src/main/ets/entryability/EntryAbility.ets index 73b7d273..096993b2 100644 --- a/ETSUI/SetAppFontSize/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ETSUI/SetAppFontSize/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import CommonConstants from '../common/constants/CommonConstants'; import Logger from '../common/utils/Logger'; import PreferencesUtil from '../common/database/Preferencesutil'; @@ -23,7 +23,7 @@ const TAG = '[entryAbility]'; /** * Lift cycle management of Ability. */ -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { Logger.info(TAG, 'onCreate'); globalThis.abilityWant = want; diff --git a/ETSUI/SetAppFontSize/entry/src/main/ets/pages/HomePage.ets b/ETSUI/SetAppFontSize/entry/src/main/ets/pages/HomePage.ets index 94f04fd3..6a13d399 100644 --- a/ETSUI/SetAppFontSize/entry/src/main/ets/pages/HomePage.ets +++ b/ETSUI/SetAppFontSize/entry/src/main/ets/pages/HomePage.ets @@ -47,7 +47,8 @@ struct HomePage { Row() { SettingItemComponent({ setting: this.settingArr[CommonConstants.DISPLAY_INDEX], - changeFontSize: this.changeFontSize + changeFontSize: this.changeFontSize, + itemClick: () => {} }) } .blockBackground(StyleConstants.BLOCK_TOP_MARGIN_FIRST_PERCENT) @@ -55,7 +56,8 @@ struct HomePage { Row() { SettingItemComponent({ setting: this.settingArr[CommonConstants.VOICE_INDEX], - changeFontSize: this.changeFontSize + changeFontSize: this.changeFontSize, + itemClick: () => {} }) } .blockBackground(StyleConstants.BLOCK_TOP_MARGIN_SECOND_PERCENT) @@ -76,7 +78,11 @@ struct HomePage { ListItem() { SettingItemComponent({ setting: item, changeFontSize: this.changeFontSize, itemClick: () => { if (index === CommonConstants.SET_FONT_INDEX) { - router.push({ url: CommonConstants.SET_URL }); + router.pushUrl({ + url: CommonConstants.SET_URL + }).catch((error) => { + Logger.info(TAG, 'HomePage push error' + JSON.stringify(error)); + }); } } }) } diff --git a/ETSUI/SetAppFontSize/entry/src/main/ets/view/TitleBarComponent.ets b/ETSUI/SetAppFontSize/entry/src/main/ets/view/TitleBarComponent.ets index 06a84494..026ca961 100644 --- a/ETSUI/SetAppFontSize/entry/src/main/ets/view/TitleBarComponent.ets +++ b/ETSUI/SetAppFontSize/entry/src/main/ets/view/TitleBarComponent.ets @@ -30,7 +30,7 @@ export default struct TitleBarComponent { Image($r('app.media.ic_public_back')) .height($r('app.float.title_ic_size')) .width($r('app.float.title_ic_size')) - .padding($r('app.float.title_ic_padding')) + .margin({ right: $r('app.float.title_ic_margin') }) .onClick(() => { router.back(); }) diff --git a/ETSUI/SetAppFontSize/entry/src/main/module.json5 b/ETSUI/SetAppFontSize/entry/src/main/module.json5 index 8d7910c5..6c23de3e 100644 --- a/ETSUI/SetAppFontSize/entry/src/main/module.json5 +++ b/ETSUI/SetAppFontSize/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/SetAppFontSize/entry/src/main/resources/base/element/float.json b/ETSUI/SetAppFontSize/entry/src/main/resources/base/element/float.json index e4bae108..a6f431d2 100644 --- a/ETSUI/SetAppFontSize/entry/src/main/resources/base/element/float.json +++ b/ETSUI/SetAppFontSize/entry/src/main/resources/base/element/float.json @@ -2,11 +2,11 @@ "float": [ { "name": "title_ic_size", - "value": "40vp" + "value": "24vp" }, { - "name": "title_ic_padding", - "value": "8vp" + "name": "title_ic_margin", + "value": "4vp" }, { "name": "title_padding_left", diff --git a/ETSUI/SetAppFontSize/package.json b/ETSUI/SetAppFontSize/package.json index c52c8b47..7f524722 100644 --- a/ETSUI/SetAppFontSize/package.json +++ b/ETSUI/SetAppFontSize/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "setappfontsize", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1-rc27", - "@ohos/hvigor": "1.3.1-rc27" - } + "license": "ISC", + "devDependencies": {}, + "name": "setappfontsize", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/ETSUI/SliderExample/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/SliderExample/entry/src/main/ets/entryability/EntryAbility.ts index 5b82fe1d..9b7c6988 100644 --- a/ETSUI/SliderExample/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/SliderExample/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,7 +14,7 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' export default class EntryAbility extends Ability { diff --git a/ETSUI/SliderExample/entry/src/main/ets/pages/SliderPage.ets b/ETSUI/SliderExample/entry/src/main/ets/pages/SliderPage.ets index ba29e0a5..7c03890f 100644 --- a/ETSUI/SliderExample/entry/src/main/ets/pages/SliderPage.ets +++ b/ETSUI/SliderExample/entry/src/main/ets/pages/SliderPage.ets @@ -69,8 +69,11 @@ struct SliderPage { step: SliderScale.STEP, style: SliderStyle.InSet } - }).margin({ bottom: Constants.PANEL_MARGIN_BOTTOM, - top: Constants.PANEL_MARGIN_TOP }); + }) + .margin({ + bottom: Constants.PANEL_MARGIN_BOTTOM, + top: Constants.PANEL_MARGIN_TOP + }); } .justifyContent(FlexAlign.End) .height(Constants.PERCENTAGE_100) diff --git a/ETSUI/SliderExample/entry/src/main/module.json5 b/ETSUI/SliderExample/entry/src/main/module.json5 index de5498e3..1d686a50 100644 --- a/ETSUI/SliderExample/entry/src/main/module.json5 +++ b/ETSUI/SliderExample/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "entryAbility", diff --git a/ETSUI/SliderExample/package.json b/ETSUI/SliderExample/package.json index 77ff1fa3..d55606fb 100644 --- a/ETSUI/SliderExample/package.json +++ b/ETSUI/SliderExample/package.json @@ -12,7 +12,7 @@ "version": "1.0.0", "dependencies": { "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } diff --git a/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets b/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets index 8f40b830..e09d2e16 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/ETSUI/TransitionAnimation/entry/src/main/ets/common/constants/CommonConstants.ets @@ -102,4 +102,24 @@ export const SHARE_ITEM_DURATION = 1000; /** * Share page url. */ -export const SHARE_PAGE_URL = 'pages/SharePage'; \ No newline at end of file +export const SHARE_PAGE_URL = 'pages/SharePage'; + +/** + * Border radius of row. + */ +export const BORDER_RADIUS = 32; + +/** + * Domain of log. + */ +export const DOMAIN = 0xFF00; + +/** + * Prefix of log. + */ +export const PREFIX = '[ReadingRecorder]'; + +/** + * Format of log. + */ +export const FORMAT = `%{public}s, %{public}s`; \ No newline at end of file diff --git a/ETSUI/TransitionAnimation/entry/src/main/ets/common/utils/DimensionUtil.ets b/ETSUI/TransitionAnimation/entry/src/main/ets/common/utils/DimensionUtil.ets index d4475d59..a9ac6b91 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/ets/common/utils/DimensionUtil.ets +++ b/ETSUI/TransitionAnimation/entry/src/main/ets/common/utils/DimensionUtil.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import ctx from '@ohos.application.context'; +import ctx from '@ohos.app.ability.common'; var context = getContext(this) as ctx.Context; diff --git a/ETSUI/TransitionAnimation/entry/src/main/ets/entryAbility/EntryAbility.ts b/ETSUI/TransitionAnimation/entry/src/main/ets/entryAbility/EntryAbility.ts index 23a7d273..71b596f9 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/ets/entryAbility/EntryAbility.ts +++ b/ETSUI/TransitionAnimation/entry/src/main/ets/entryAbility/EntryAbility.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; import display from '@ohos.display'; -export default class MainAbility extends Ability { +export default class MainAbility extends UIAbility { onCreate(want) { globalThis.abilityWant = want; } diff --git a/ETSUI/TransitionAnimation/entry/src/main/ets/pages/Index.ets b/ETSUI/TransitionAnimation/entry/src/main/ets/pages/Index.ets index 5ca0836b..0d7b2d33 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/ets/pages/Index.ets +++ b/ETSUI/TransitionAnimation/entry/src/main/ets/pages/Index.ets @@ -14,8 +14,17 @@ */ import router from '@ohos.router'; -import { INDEX_ANIMATION_MODE, FULL_LENGTH, DEFAULT_LAYOUT_WEIGHT } from '../common/constants/CommonConstants'; +import { + INDEX_ANIMATION_MODE, + FULL_LENGTH, + DEFAULT_LAYOUT_WEIGHT, + BORDER_RADIUS, + DOMAIN, + PREFIX, + FORMAT +} from '../common/constants/CommonConstants'; import DimensionUtil from '../common/utils/DimensionUtil'; +import hilog from '@ohos.hilog'; @Entry @Component @@ -35,17 +44,21 @@ struct Index { Scroll() { Column() { ForEach(INDEX_ANIMATION_MODE, ({ imgRes , url }) => { - Button() + Row() .backgroundImage(imgRes) .backgroundImageSize(ImageSize.Cover) .backgroundColor($r('app.color.trans_parent')) .height(DimensionUtil.getVp($r('app.float.main_page_body_height'))) .margin({ bottom: DimensionUtil.getVp($r('app.float.main_page_body_margin')) }) .width(FULL_LENGTH) + .borderRadius(BORDER_RADIUS) .onClick(() => { - router.push({ url: url }); + router.pushUrl({ url: url }) + .catch(err => { + hilog.error(DOMAIN, PREFIX, FORMAT, err); + }); }) - }, item => item.toString()) + }, item => JSON.stringify(item)) } } .layoutWeight(DEFAULT_LAYOUT_WEIGHT) diff --git a/ETSUI/TransitionAnimation/entry/src/main/ets/pages/ShareItem.ets b/ETSUI/TransitionAnimation/entry/src/main/ets/pages/ShareItem.ets index aea05d8e..949a8ade 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/ets/pages/ShareItem.ets +++ b/ETSUI/TransitionAnimation/entry/src/main/ets/pages/ShareItem.ets @@ -20,9 +20,13 @@ import { SHARE_TRANSITION_ID, SHARE_ITEM_ANIMATION_DELAY, SHARE_PAGE_URL, - FULL_LENGTH + FULL_LENGTH, + DOMAIN, + PREFIX, + FORMAT } from '../common/constants/CommonConstants'; import DimensionUtil from '../common/utils/DimensionUtil'; +import hilog from '@ohos.hilog'; @Entry @Component @@ -40,7 +44,10 @@ struct ShareItem { delay: SHARE_ITEM_ANIMATION_DELAY }) .onClick(() => { - router.push({ url: SHARE_PAGE_URL }); + router.pushUrl({ url: SHARE_PAGE_URL }) + .catch(err => { + hilog.error(DOMAIN, PREFIX, FORMAT, err); + }); }) Text($r('app.string.Share_Item_hint')) .width(FULL_LENGTH) diff --git a/ETSUI/TransitionAnimation/entry/src/main/module.json5 b/ETSUI/TransitionAnimation/entry/src/main/module.json5 index 92941b53..4754e525 100644 --- a/ETSUI/TransitionAnimation/entry/src/main/module.json5 +++ b/ETSUI/TransitionAnimation/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "MainAbility", diff --git a/ETSUI/TransitionAnimation/package.json b/ETSUI/TransitionAnimation/package.json index 107b91c6..5072f4dc 100644 --- a/ETSUI/TransitionAnimation/package.json +++ b/ETSUI/TransitionAnimation/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "transitionanimationets", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "transitionanimationets", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/ETSUI/WebComponent/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/WebComponent/entry/src/main/ets/entryability/EntryAbility.ts index 258fd996..7b0dd849 100644 --- a/ETSUI/WebComponent/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/WebComponent/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,8 +1,8 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' -import Window from '@ohos.window' +import Window from '@ohos.window'; -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/ETSUI/WebComponent/entry/src/main/ets/pages/MainPage.ets b/ETSUI/WebComponent/entry/src/main/ets/pages/MainPage.ets index d3f038cb..ba272fd9 100644 --- a/ETSUI/WebComponent/entry/src/main/ets/pages/MainPage.ets +++ b/ETSUI/WebComponent/entry/src/main/ets/pages/MainPage.ets @@ -31,6 +31,7 @@ struct MainPage { build() { Column() { Image($r('app.media.background')) + .width(MainConstant.FULL_HEIGHT) .height(MainConstant.IMAGE_HEIGHT) Navigator({ target: WEB_PAGE_URI, type: NavigationType.Push }) { Button($r('app.string.loadLocalH5')) diff --git a/ETSUI/WebComponent/entry/src/main/ets/pages/WebPage.ets b/ETSUI/WebComponent/entry/src/main/ets/pages/WebPage.ets index 68d635fb..c8703235 100644 --- a/ETSUI/WebComponent/entry/src/main/ets/pages/WebPage.ets +++ b/ETSUI/WebComponent/entry/src/main/ets/pages/WebPage.ets @@ -14,17 +14,19 @@ */ import router from '@ohos.router'; +import web_webview from '@ohos.web.webview'; import { WebConstant, MainConstant, WEB_ALERT_DIALOG_TEXT_VALUE } from '../common/Constant'; @Entry @Component struct WebPage { - webViewController: WebController = new WebController(); + webController: web_webview.WebviewController = new web_webview.WebviewController(); @State params: object = router.getParams(); build() { Stack({ alignContent: Alignment.TopStart }) { Image($r('app.media.background')) + .width(MainConstant.FULL_HEIGHT) .height(MainConstant.IMAGE_HEIGHT) Row() { Column() { @@ -46,7 +48,7 @@ struct WebPage { }.height(WebConstant.TOP_ROW_HEIGHT) // web组件加载本地H5 - Web({ src: this.params['path'], controller: this.webViewController }) + Web({ src: this.params['path'], controller: this.webController }) .zoomAccess(false) .width(WebConstant.WIDTH) .aspectRatio(1) @@ -95,7 +97,7 @@ struct WebPage { .backgroundColor($r('app.color.blue')) .borderRadius(WebConstant.BUTTON_BORDER_RADIUS) .onClick(() => { - this.webViewController.runJavaScript({ script: 'startDraw()'}); + this.webController.runJavaScript('startDraw()'); }) } .width(WebConstant.FULL_WIDTH) diff --git a/ETSUI/WebComponent/entry/src/main/module.json5 b/ETSUI/WebComponent/entry/src/main/module.json5 index dcad1254..06fa6f5b 100644 --- a/ETSUI/WebComponent/entry/src/main/module.json5 +++ b/ETSUI/WebComponent/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "requestPermissions": [ { "name": "ohos.permission.INTERNET" diff --git a/ETSUI/WebComponent/entry/src/main/resources/rawfile/js/index.js b/ETSUI/WebComponent/entry/src/main/resources/rawfile/js/index.js index 8682e4b6..3ac79cbb 100644 --- a/ETSUI/WebComponent/entry/src/main/resources/rawfile/js/index.js +++ b/ETSUI/WebComponent/entry/src/main/resources/rawfile/js/index.js @@ -34,7 +34,7 @@ let prizesPosition = 0; // 转到哪个位置 for (let j = 0;j < prizesImg.length; j++) { prizesImg[j].src = arrBigImg[j]; } -let speed = 500; // 转圈速度,值越大越慢 +let speed = 500; //转圈速度,值越大越慢 // 旋转函数 function roll() { diff --git a/ETSUI/WebComponent/package.json b/ETSUI/WebComponent/package.json index c6852abb..be4fac46 100644 --- a/ETSUI/WebComponent/package.json +++ b/ETSUI/WebComponent/package.json @@ -1,18 +1,18 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "webcomponent", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.3", - "@ohos/hvigor-ohos-plugin": "1.3.1", - "@ohos/hvigor": "1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "webcomponent", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0", + } } diff --git a/ETSUI/WebCookie/LICENSE b/ETSUI/WebCookie/LICENSE index 261eeb9e..0210352a 100644 --- a/ETSUI/WebCookie/LICENSE +++ b/ETSUI/WebCookie/LICENSE @@ -1,201 +1,78 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - 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: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) 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 - - (d) 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 - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright (c) 2023 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 + 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/ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets b/ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets index 2d7483a7..4f50c2c7 100644 --- a/ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets +++ b/ETSUI/WebCookie/entry/src/main/ets/common/constants/CommonConstant.ets @@ -110,16 +110,6 @@ export const NAVIGATOR_MARGIN_TOP = '1.7%'; */ export const NAVIGATOR_MARGIN_LEFT = '10%'; -/** - * top margin of page title - */ -export const PAGE_TITLE_MARGIN_TOP = '4.2%'; - -/** - * bottom margin of page title - */ -export const PAGE_TITLE_MARGIN_BOTTOM = '3.7%'; - /** * deeper font weight than normal font */ @@ -128,22 +118,17 @@ export const FONT_WEIGHT_DEEPER = 500; /** * top margin of app title */ -export const APP_TITLE_MARGIN_TOP = '1.7%'; +export const APP_TITLE_MARGIN_TOP = '15vp'; /** * left margin of app title */ -export const APP_TITLE_MARGIN_LEFT = '15%'; - -/** - * bottom margin of row - */ -export const ROW_MARGIN_BOTTOM = '12%'; +export const APP_TITLE_MARGIN_LEFT = '26vp'; /** * bottom margin of web */ -export const WEB_MARGIN_BOTTOM = '12%'; +export const WEB_MARGIN_BOTTOM = '90vp'; /** * type of cookie Operation diff --git a/ETSUI/WebCookie/entry/src/main/ets/entryability/EntryAbility.ts b/ETSUI/WebCookie/entry/src/main/ets/entryability/EntryAbility.ts index 1c121b26..5401503a 100644 --- a/ETSUI/WebCookie/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ETSUI/WebCookie/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,66 +1,41 @@ -/* - * Copyright (c) 2022 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. - */ - +import UIAbility from '@ohos.app.ability.UIAbility'; import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability'; -import Window from '@ohos.window'; +import window from '@ohos.window'; -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); } onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } - onWindowStageCreate(windowStage: Window.WindowStage) { + onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/WebIndex', (err, data) => { if (err.code) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; } - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } onWindowStageDestroy() { // Main window is destroyed, release UI related resources - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); } onForeground() { // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); } onBackground() { // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } } \ No newline at end of file diff --git a/ETSUI/WebCookie/entry/src/main/ets/pages/Verify.ets b/ETSUI/WebCookie/entry/src/main/ets/pages/Verify.ets index 8c653e68..ef61aafa 100644 --- a/ETSUI/WebCookie/entry/src/main/ets/pages/Verify.ets +++ b/ETSUI/WebCookie/entry/src/main/ets/pages/Verify.ets @@ -30,8 +30,6 @@ import { PAGE_TITLE_WIDTH, NAVIGATOR_MARGIN_TOP, NAVIGATOR_MARGIN_LEFT, - PAGE_TITLE_MARGIN_TOP, - PAGE_TITLE_MARGIN_BOTTOM, FONT_WEIGHT_DEEPER } from '../common/constants/CommonConstant'; @@ -74,7 +72,7 @@ struct Verify { .fontColor($r('app.color.title_black')) .width(PAGE_TITLE_WIDTH) .height(PAGE_TITLE_HEIGHT) - .margin({ top: PAGE_TITLE_MARGIN_TOP, bottom: PAGE_TITLE_MARGIN_BOTTOM }) + .margin({ top: $r('app.float.page_title_margin_top'), bottom: $r('app.float.page_title_margin_bottom') }) Web({ src: USER_ABOUT_URL, @@ -86,14 +84,14 @@ struct Verify { .javaScriptAccess(true) .onPageEnd(() => { try { - if (this.isRedirect) { + let originCookie = web_webview.WebCookieManager.getCookie(USER_ABOUT_URL); + if (originCookie === '' || this.isRedirect) { return; } this.isRedirect = true; - let originCookie = web_webview.WebCookieManager.getCookie(USER_ABOUT_URL); showDialog(originCookie); } catch (error) { - showDialog(`EorrorCode:${error.code},Message:${error.message}`); + showDialog(`ErrorCode: ${error.code}, Message: ${error.message}`); } }) } diff --git a/ETSUI/WebCookie/entry/src/main/ets/pages/WebIndex.ets b/ETSUI/WebCookie/entry/src/main/ets/pages/WebIndex.ets index eb690968..9302c45a 100644 --- a/ETSUI/WebCookie/entry/src/main/ets/pages/WebIndex.ets +++ b/ETSUI/WebCookie/entry/src/main/ets/pages/WebIndex.ets @@ -24,13 +24,10 @@ import { WEB_WIDTH, PAGE_TITLE_HEIGHT, PAGE_TITLE_WIDTH, - PAGE_TITLE_MARGIN_TOP, - PAGE_TITLE_MARGIN_BOTTOM, FONT_WEIGHT_DEEPER, APP_TITLE_MARGIN_TOP, APP_TITLE_MARGIN_LEFT, WEB_MARGIN_BOTTOM, - ROW_MARGIN_BOTTOM, CookieOperation } from '../common/constants/CommonConstant'; import { LinkButton } from '../view/LinkButton' @@ -59,7 +56,7 @@ struct WebIndex { .fontColor($r('app.color.title_black')) .width(PAGE_TITLE_WIDTH) .height(PAGE_TITLE_HEIGHT) - .margin({ top: PAGE_TITLE_MARGIN_TOP, bottom: PAGE_TITLE_MARGIN_BOTTOM }) + .margin({ top: $r('app.float.page_title_margin_top'), bottom: $r('app.float.page_title_margin_bottom') }) Web({ src: USER_CENTER_URL, @@ -79,9 +76,7 @@ struct WebIndex { LinkButton({ buttonType: CookieOperation.DELETE_COOKIE, isNeedDivider: true }) LinkButton({ buttonType: CookieOperation.VERIFY_COOKIE, isNeedDivider: false }) } - .align(Alignment.End) .width(WEB_WIDTH) - .margin({ bottom: ROW_MARGIN_BOTTOM }) } .backgroundColor($r('app.color.page_background_grey')) .width(FULL_WIDTH) diff --git a/ETSUI/WebCookie/entry/src/main/ets/view/LinkButton.ets b/ETSUI/WebCookie/entry/src/main/ets/view/LinkButton.ets index a34727c4..e9253eba 100644 --- a/ETSUI/WebCookie/entry/src/main/ets/view/LinkButton.ets +++ b/ETSUI/WebCookie/entry/src/main/ets/view/LinkButton.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - import web_webview from '@ohos.web.webview'; import router from '@ohos.router'; import { showDialog } from '../common/utils/DialogUtil'; @@ -61,15 +60,15 @@ export struct LinkButton { let originCookie = web_webview.WebCookieManager.getCookie(USER_CENTER_URL); showDialog(originCookie); } catch (error) { - showDialog(`EorrorCode:${error.code},Message:${error.message}`); + showDialog(`ErrorCode: ${error.code}, Message: ${error.message}`); } break; case CookieOperation.SET_COOKIE: try { - web_webview.WebCookieManager.setCookie(USER_ABOUT_URL, 'info=测试cookie写入') + web_webview.WebCookieManager.setCookie(USER_ABOUT_URL, 'info=测试cookie写入'); showDialog($r('app.string.write_success')); } catch (error) { - showDialog($r('app.string.write_fail')); + showDialog(`ErrorCode: ${error.code}, Message: ${error.message}`); } break; case CookieOperation.DELETE_COOKIE: @@ -78,8 +77,10 @@ export struct LinkButton { showDialog(deleteMessage); break; case CookieOperation.VERIFY_COOKIE: - router.push({ + router.pushUrl({ url: PAGE_VERIFY + }).catch(err => { + console.error('[LinkButton] push url fail: ' + err); }); break; default: diff --git a/ETSUI/WebCookie/entry/src/main/module.json5 b/ETSUI/WebCookie/entry/src/main/module.json5 index 0c611438..9c47b9c0 100644 --- a/ETSUI/WebCookie/entry/src/main/module.json5 +++ b/ETSUI/WebCookie/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/ETSUI/WebCookie/entry/src/main/resources/base/element/float.json b/ETSUI/WebCookie/entry/src/main/resources/base/element/float.json new file mode 100644 index 00000000..c6be08bb --- /dev/null +++ b/ETSUI/WebCookie/entry/src/main/resources/base/element/float.json @@ -0,0 +1,12 @@ +{ + "float": [ + { + "name": "page_title_margin_top", + "value": "48vp" + }, + { + "name": "page_title_margin_bottom", + "value": "28vp" + } + ] +} \ No newline at end of file diff --git a/ETSUI/WebCookie/package.json b/ETSUI/WebCookie/package.json index e07870ba..fb8d5563 100644 --- a/ETSUI/WebCookie/package.json +++ b/ETSUI/WebCookie/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"webcookie", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "webcookie", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } \ No newline at end of file diff --git a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/entryability/EntryAbility.ts b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/entryability/EntryAbility.ts index f6b8bc17..6bb8555f 100644 --- a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/entryability/EntryAbility.ts +++ b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,8 +1,8 @@ +import UIAbility from '@ohos.app.ability.UIAbility'; import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' import Window from '@ohos.window' -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/pages/TaskPage.ets b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/pages/TaskPage.ets index 0e1b70ad..877a3cd2 100644 --- a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/pages/TaskPage.ets +++ b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/ets/pages/TaskPage.ets @@ -68,7 +68,7 @@ struct TaskPage { @State taskList: Array = TASK_LIST; taskClickAction() { - router.push({ + router.pushUrl({ url: 'pages/TaskDetailPage' }); } diff --git a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/module.json5 b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/module.json5 index c70b7cf2..8e4a7cd2 100644 --- a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/module.json5 +++ b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/module.json5 @@ -10,6 +10,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/resources/base/media/right_grey.png b/EfficiencyEnhancementKit/SuperVisualSample/entry/src/main/resources/base/media/right_grey.png new file mode 100644 index 0000000000000000000000000000000000000000..bebf1f6df388728a4f1c251490db661e52386811 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)N!3HEB$FfNSDaPU;cPEB*=VV?2IWDOYo@u_m z3|c@o2Loe!CIbsd2@p#GF#`kh0!9XAAk7F8TfhXDWnaJyXY+v+-f`Qj4y0Num-QqV>#$rsM+!8@A}7#ceW+O-pG2n=UT>v9|(S+wI-w*ThooM*Y*Ug(`O z?UYi>c$oUsQK5H9xW}uxs%!c$UFxl?d7}5`4{PFWg?Xi0_;!KZ<>~6@vd$@?2>`~C BS4#i@ literal 0 HcmV?d00001 diff --git a/EfficiencyEnhancementKit/SuperVisualSample/package.json b/EfficiencyEnhancementKit/SuperVisualSample/package.json index db2fe96a..ac50b1b8 100644 --- a/EfficiencyEnhancementKit/SuperVisualSample/package.json +++ b/EfficiencyEnhancementKit/SuperVisualSample/package.json @@ -1,18 +1,18 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"supervisualsample", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"example description", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1", - "@ohos/hvigor":"1.3.1" - } + "license": "ISC", + "devDependencies": {}, + "name": "supervisualsample", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } \ No newline at end of file diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/DataUtils.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/DataUtils.ets index de43b148..2f2c49e2 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/DataUtils.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/DataUtils.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import promptAction from '@ohos.promptAction'; import { SERVER, GET_NEWS_TYPE, @@ -34,7 +34,7 @@ import { httpRequestGet } from '../utils/HttpUtil'; export async function getTabData(currentPage: number, pageSize: number, currentIndex: number, callback) { currentPage = currentPage + GET_TAB_DATA_CURRENT_PAGE; if (currentPage > pageSize) { - prompt.showToast({ message: $r('app.string.prompt_message') }); + promptAction.showToast({ message: $r('app.string.prompt_message') }); currentPage = currentPage - GET_TAB_DATA_CURRENT_PAGE; } let newsPageData = []; diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullDownRefresh.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullDownRefresh.ets index ac37d291..5ff405eb 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullDownRefresh.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullDownRefresh.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import promptAction from '@ohos.promptAction'; import { getTabData } from './DataUtils'; import { touchMoveLoadMore, touchUpLoadMore } from './PullUpLoadMore'; import { @@ -95,7 +95,7 @@ export function touchUpPullRefresh() { closeRefresh.call(self, true); }, onFail: (msg) => { - prompt.showToast({ message: msg }); + promptAction.showToast({ message: msg }); closeRefresh.call(self, false); } }); diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullUpLoadMore.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullUpLoadMore.ets index 562b19cd..1b1326a4 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullUpLoadMore.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/common/utils/PullUpLoadMore.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import prompt from '@ohos.prompt'; +import promptAction from '@ohos.promptAction'; import { getTabData } from '../utils/DataUtils'; import { DELAY_TIME, ANIMATION_DURATION, Y_OFF_SET_COEFFICIENT } from '../constant/CommonConstant'; @@ -44,7 +44,7 @@ export function touchUpLoadMore() { self.currentPage = parseInt(value.currentPage.toString()); self.newsData = self.newsData.concat(value.newsPageData); }, - onFail: (msg) => prompt.showToast({ message: msg }) + onFail: (msg) => promptAction.showToast({ message: msg }) }); }, DELAY_TIME); } else { diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/entryability/EntryAbility.ts b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/entryability/EntryAbility.ts index f8ccb412..1a5f42fe 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/entryability/EntryAbility.ts +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/entryability/EntryAbility.ts @@ -14,10 +14,10 @@ */ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' +import UIAbility from '@ohos.app.ability.UIAbility' import Window from '@ohos.window' -export default class EntryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsItem.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsItem.ets index 8987e488..bdf6db79 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsItem.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsItem.ets @@ -62,7 +62,7 @@ export default struct NewsItem { .objectFit(ImageFit.Cover) .borderRadius(NewsGrid.IMAGE_BORDER_RADIUS) } - }, itemImg => this.newsData.imagesUrl.indexOf(itemImg.id).toString()) + }, (itemImg, index) => JSON.stringify(itemImg) + index.toString()) } .aspectRatio(NewsGrid.ASPECT_RATIO) .columnsTemplate('1fr '.repeat(this.newsData.imagesUrl.length)) diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsList.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsList.ets index 46dc8b3d..8332eaaf 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsList.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/NewsList.ets @@ -114,7 +114,7 @@ export default struct NewsList { .backgroundColor($r('app.color.white')) .margin({ top: NewsListConstant.ITEM_MARGIN_TOP, right: NewsListConstant.LIST_MARGIN_RIGHT }) .borderRadius(NewsListConstant.ITEM_BORDER_RADIUS) - }, item => item.id) + }, (item, index) => JSON.stringify(item) + index.toString()) ListItem() { LoadMoreLayout({ loadMoreLayoutClass: new CustomRefreshLoadLayoutClass(this.isVisiblePullUpLoad, this.pullUpLoadImage, diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/RefreshLayout.ets b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/RefreshLayout.ets index 755efedc..105a3b86 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/RefreshLayout.ets +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/ets/view/RefreshLayout.ets @@ -29,11 +29,6 @@ export default struct RefreshLayout { CustomRefreshLoadLayout({ customRefreshLoadClass: new CustomRefreshLoadLayoutClass (this.refreshLayoutClass.isVisible, this.refreshLayoutClass.imageSrc, this.refreshLayoutClass.textValue, this.refreshLayoutClass.heightValue) }) - } else { - CustomRefreshLoadLayout({ - customRefreshLoadClass: new CustomRefreshLoadLayoutClass(this.refreshLayoutClass.isVisible, - this.refreshLayoutClass.imageSrc, this.refreshLayoutClass.textValue, 0) - }) } } } diff --git a/NetworkManagement/NewsDataArkTS/entry/src/main/module.json5 b/NetworkManagement/NewsDataArkTS/entry/src/main/module.json5 index 2fae781d..20b75335 100644 --- a/NetworkManagement/NewsDataArkTS/entry/src/main/module.json5 +++ b/NetworkManagement/NewsDataArkTS/entry/src/main/module.json5 @@ -11,6 +11,10 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", diff --git a/NetworkManagement/NewsDataArkTS/package.json b/NetworkManagement/NewsDataArkTS/package.json index 1ee06bae..f3f95ab8 100644 --- a/NetworkManagement/NewsDataArkTS/package.json +++ b/NetworkManagement/NewsDataArkTS/package.json @@ -12,7 +12,7 @@ "version":"1.0.0", "dependencies":{ "@ohos/hypium":"1.0.3", - "@ohos/hvigor-ohos-plugin":"1.3.1-rc27", - "@ohos/hvigor":"1.3.1-rc27" - } + "@ohos/hvigor": "1.4.0", + "@ohos/hvigor-ohos-plugin": "1.4.0" + } } \ No newline at end of file diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/entryability/EntryAbility.ts b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/entryability/EntryAbility.ts index d2222589..e3ffc4d6 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/entryability/EntryAbility.ts @@ -1,23 +1,18 @@ import hilog from '@ohos.hilog'; -import Ability from '@ohos.application.Ability' -import Window from '@ohos.window' +import UIAbility from '@ohos.app.ability.UIAbility'; +import Window from '@ohos.window'; -export default class entryAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); - hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); } onDestroy() { - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } onWindowStageCreate(windowStage: Window.WindowStage) { // Main window is created, set main page for this ability - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); windowStage.loadContent('pages/MainPage', (err, data) => { @@ -33,19 +28,16 @@ export default class entryAbility extends Ability { onWindowStageDestroy() { // Main window is destroyed, release UI related resources - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); } onForeground() { // Ability has brought to foreground - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); } onBackground() { // Ability has back to background - hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } } diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/pages/MainPage.ets b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/pages/MainPage.ets index fd9a1fdb..80d75f45 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/pages/MainPage.ets +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/pages/MainPage.ets @@ -74,6 +74,7 @@ struct Index { } .title(this.NavigationTitle) .hideBackButton(true) + .titleMode(NavigationTitleMode.Mini) } .backgroundColor($r('app.color.app_bg')) } diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/view/InnerComponent.ets b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/view/InnerComponent.ets index 0694a82f..c59df50c 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/view/InnerComponent.ets +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/ets/view/InnerComponent.ets @@ -55,8 +55,7 @@ export struct Inner { buttonShape: item.buttonShape, buttonType: item.buttonType, stateEffect: item.stateEffect, - fontColor: item.fontColor, - click: ()=> {} + fontColor: item.fontColor }) .alignSelf(ItemAlign.Center) .margin({ bottom: $r('app.float.default_21') }) diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/module.json5 b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/module.json5 index 0e288c05..ac212376 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/module.json5 +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/module.json5 @@ -2,7 +2,7 @@ "module": { "name": "entry", "type": "entry", - "description": "$string:module_desc", + "description": "$string:entry_desc", "mainElement": "EntryAbility", "deviceTypes": [ "default", @@ -11,15 +11,19 @@ "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", + "metadata": [{ + "name": "ArkTSPartialUpdate", + "value": "true" + }], "abilities": [ { "name": "EntryAbility", "srcEntrance": "./ets/entryability/EntryAbility.ts", - "description": "$string:EntryAbility_desc", + "description": "$string:MainAbility_desc", "icon": "$media:icon", - "label": "$string:EntryAbility_label", + "label": "$string:MainAbility_label", "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:start_window_background", + "startWindowBackground": "$color:white", "visible": true, "skills": [ { diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/color.json b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/color.json index 6c2d3ffb..cf1f2852 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/color.json +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/color.json @@ -1,9 +1,5 @@ { "color": [ - { - "name": "start_window_background", - "value": "#FFFFFF" - }, { "name": "white", "value": "#FFFFFF" diff --git a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/string.json b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/string.json index 0a05d18b..a5b6c849 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/string.json +++ b/ThirdPartyComponents/ThirdPartyLibrary/entry/src/main/resources/base/element/string.json @@ -1,16 +1,12 @@ { "string": [ { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", + "name": "entry_desc", "value": "description" }, { - "name": "EntryAbility_label", - "value": "label" + "name": "MainAbility_desc", + "value": "description" }, { "name": "MainAbility_label", diff --git a/ThirdPartyComponents/ThirdPartyLibrary/library/package.json b/ThirdPartyComponents/ThirdPartyLibrary/library/package.json index a4710dd7..37320f6b 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/library/package.json +++ b/ThirdPartyComponents/ThirdPartyLibrary/library/package.json @@ -1,14 +1,14 @@ { - "license":"ISC", - "types":"", - "devDependencies":{}, - "name":"@ohos/library", - "description":"a npm package which contains arkUI2.0 page", - "ohos":{ - "org":"" + "license": "ISC", + "types": "", + "devDependencies": {}, + "name": "@ohos/library", + "description": "a npm package which contains arkUI2.0 page", + "ohos": { + "org": "" }, - "main":"MainPage.ets", - "type":"module", - "version":"1.0.0", - "dependencies":{} + "main": "src/main/ets/components/MainPage/MainPage.ets", + "type": "module", + "version": "1.0.0", + "dependencies": {} } \ No newline at end of file diff --git a/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/ets/components/mainpage/Buttons.ets b/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/ets/components/mainpage/Buttons.ets index 5241c70b..f04abd39 100644 --- a/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/ets/components/mainpage/Buttons.ets +++ b/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/ets/components/mainpage/Buttons.ets @@ -22,7 +22,6 @@ export struct Buttons { @Prop buttonShape: string; @Prop buttonType: string; @Prop fontColor: string; - click: () => void; build() { Row() { @@ -35,9 +34,6 @@ export struct Buttons { .width($r('app.float.default_90')) .height($r('app.float.default_35')) .backgroundColor(ButtonViewModel.fetchBackgroundColor(this.buttonType)) - .onClick(() => { - this.click(); - }) } } } diff --git a/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/resources/base/media/icon.png b/ThirdPartyComponents/ThirdPartyLibrary/library/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y Date: Tue, 14 Mar 2023 11:39:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ETSUI/WebComponent/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ETSUI/WebComponent/package.json b/ETSUI/WebComponent/package.json index be4fac46..ae4638a3 100644 --- a/ETSUI/WebComponent/package.json +++ b/ETSUI/WebComponent/package.json @@ -13,6 +13,6 @@ "dependencies": { "@ohos/hypium": "1.0.3", "@ohos/hvigor-ohos-plugin": "1.4.0", - "@ohos/hvigor": "1.4.0", + "@ohos/hvigor": "1.4.0" } } -- Gitee From 7ebf24cf3d76543e992cebf5f1a8a887665921ce Mon Sep 17 00:00:00 2001 From: wf0304-gme <452399386@qq.com> Date: Tue, 14 Mar 2023 09:37:19 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=8F=AA=E6=98=BE=E7=A4=BA2=E4=B8=AA=E6=8C=89?= =?UTF-8?q?=E9=92=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wf0304-gme <452399386@qq.com> --- .../entry/src/main/ets/common/constants/StyleConstants.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets b/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets index a27734a8..3825bba5 100644 --- a/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets +++ b/Data/Preferences/entry/src/main/ets/common/constants/StyleConstants.ets @@ -80,7 +80,7 @@ class StyleConstants { /** * Big margin bottom */ - MARGIN_BOTTOM_BIG = '390vp'; + MARGIN_BOTTOM_BIG = '321vp'; /** * The height of button component. -- Gitee