From ad6632e4931f5924060adc6a20743202f5b5c96c Mon Sep 17 00:00:00 2001 From: sfchu Date: Mon, 31 Mar 2025 17:23:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E5=BE=85=E5=8A=9E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=91=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/common/constant/CommonConstant.ets | 18 +++++++++--------- .../src/main/ets/entryability/EntryAbility.ets | 6 +++--- entry/src/main/ets/view/ToDoItem.ets | 2 +- entry/src/main/ets/viewmodel/DataModel.ets | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/entry/src/main/ets/common/constant/CommonConstant.ets b/entry/src/main/ets/common/constant/CommonConstant.ets index 881a81b..f1aca49 100644 --- a/entry/src/main/ets/common/constant/CommonConstant.ets +++ b/entry/src/main/ets/common/constant/CommonConstant.ets @@ -20,47 +20,47 @@ export default class CommonConstants { /** * Full width or height. */ - static readonly FULL_LENGTH: string = '100%'; + public static readonly FULL_LENGTH: string = '100%'; /** * Title height. */ - static readonly TITLE_WIDTH: string = '80%'; + public static readonly TITLE_WIDTH: string = '80%'; /** * List default width. */ - static readonly LIST_DEFAULT_WIDTH: string = '93.3%'; + public static readonly LIST_DEFAULT_WIDTH: string = '93.3%'; /** * Opacity of default. */ - static readonly OPACITY_DEFAULT: number = 1; + public static readonly OPACITY_DEFAULT: number = 1; /** * Opacity of default. */ - static readonly OPACITY_COMPLETED: number = 0.4; + public static readonly OPACITY_COMPLETED: number = 0.4; /** * BorderRadius of list item. */ - static readonly BORDER_RADIUS: number = 24; + public static readonly BORDER_RADIUS: number = 24; /** * BorderRadius of list item. */ - static readonly FONT_WEIGHT: number = 500; + public static readonly FONT_WEIGHT: number = 500; /** * Space of column. */ - static readonly COLUMN_SPACE: number = 16; + public static readonly COLUMN_SPACE: number = 16; /** * agents data. */ - static readonly TODO_DATA: Array = [ + public static readonly TODO_DATA: Array = [ $r('app.string.todo_list_one'), $r('app.string.todo_list_two'), $r('app.string.todo_list_three'), diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 335d74d..7c23c4a 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,10 +13,10 @@ * limitations under the License. */ -import { UIAbility } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; +import { UIAbility } from '@kit.AbilityKit'; import { window } from '@kit.ArkUI'; -import { BusinessError } from '@kit.BasicServicesKit'; export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage): void { @@ -31,4 +31,4 @@ export default class EntryAbility extends UIAbility { hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } -} +} \ No newline at end of file diff --git a/entry/src/main/ets/view/ToDoItem.ets b/entry/src/main/ets/view/ToDoItem.ets index e0f36c1..48578ec 100644 --- a/entry/src/main/ets/view/ToDoItem.ets +++ b/entry/src/main/ets/view/ToDoItem.ets @@ -17,7 +17,7 @@ import CommonConstants from '../common/constant/CommonConstant'; @Component export default struct ToDoItem { - private content?: string; + public content?: string; @State isComplete: boolean = false; @Builder labelIcon(icon: Resource) { diff --git a/entry/src/main/ets/viewmodel/DataModel.ets b/entry/src/main/ets/viewmodel/DataModel.ets index 6d205dc..147fae6 100644 --- a/entry/src/main/ets/viewmodel/DataModel.ets +++ b/entry/src/main/ets/viewmodel/DataModel.ets @@ -22,7 +22,7 @@ export class DataModel { /** * Saved Data. */ - private tasks: Array = CommonConstants.TODO_DATA; + public tasks: Array = CommonConstants.TODO_DATA; /** * Get the data. -- Gitee From ce08ff8f475b7d018fbbb6924bf9eaa23e645db3 Mon Sep 17 00:00:00 2001 From: sfchu Date: Mon, 31 Mar 2025 17:51:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E5=BE=85=E5=8A=9E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E3=80=91=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 8 ++++---- README.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.en.md b/README.en.md index e39ffaa..3e9dc09 100644 --- a/README.en.md +++ b/README.en.md @@ -26,7 +26,7 @@ N/A ## Constraints -1. The sample is only supported on Huawei phones with standard systems. -2. HarmonyOS: HarmonyOS NEXT Developer Beta1 or later. -3. DevEco Studio: DevEco Studio NEXT Developer Beta1 or later. -4. HarmonyOS SDK: HarmonyOS NEXT Developer Beta1 SDK or later. +1. The sample app is supported only on Huawei phones running the standard system. +2. HarmonyOS: HarmonyOS 5.0.0 Release or later +3. DevEco Studio: DevEco Studio 5.0.0 Release or later +4. HarmonyOS SDK: HarmonyOS 5.0.0 Release SDK or later diff --git a/README.md b/README.md index 3c6b842..fa51059 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# 待办列表 +# 实现待办事项列表 ## 简介 -本篇Codelab基于ArkTS声明式语法和ArkTS基础组件,实现简易待办事项的案例。效果如图所示: +本篇Codelab将介绍如何使用ArkTS声明式语法和基础组件,实现简易待办列表。效果为点击某一事项,替换标签图片、虚化文字。 ![](screenshots/device/ToDoList.gif) @@ -27,6 +27,6 @@ ## 约束与限制 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 -2. HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 -3. DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 -4. HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 +2. HarmonyOS系统:HarmonyOS 5.0.0 Release及以上。 +3. DevEco Studio版本:DevEco Studio 5.0.0 Release及以上。 +4. HarmonyOS SDK版本:HarmonyOS 5.0.0 Release SDK及以上。 -- Gitee