From ed9a9b6a288c3d461459a6f5692fa081ccfcae37 Mon Sep 17 00:00:00 2001 From: liugang9704 <2745340733@qq.com> Date: Tue, 9 Sep 2025 15:22:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update:=20=E4=BF=AE=E6=94=B9=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/pages/SetNetSpecifier.ets | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/NetworkKit/entry/src/main/ets/pages/SetNetSpecifier.ets b/NetworkKit/entry/src/main/ets/pages/SetNetSpecifier.ets index de066b1..29e6019 100644 --- a/NetworkKit/entry/src/main/ets/pages/SetNetSpecifier.ets +++ b/NetworkKit/entry/src/main/ets/pages/SetNetSpecifier.ets @@ -31,28 +31,28 @@ function listen_network() { let conn = connection.createNetConnection(netSpecifier); conn.register((err: BusinessError, data: void) => { - console.warn('register 网络 ' + JSON.stringify(err)) + console.warn('register Network ' + JSON.stringify(err)) }); // Subscription event, network available conn.on('netAvailable', ((data: connection.NetHandle) => { - console.warn('网络可用, netId is ' + data.netId); + console.warn('Network available, netId is ' + data.netId); })); // Subscription event, network available conn.on('netCapabilitiesChange', ((data: connection.NetCapabilityInfo) => { - console.warn('网络 netCapabilitiesChange bearerTypes ' + data.netCap.bearerTypes); - console.warn('网络 netCapabilitiesChange networkCap ' + data.netCap.networkCap); + console.warn('Network netCapabilitiesChange bearerTypes ' + data.netCap.bearerTypes); + console.warn('Network netCapabilitiesChange networkCap ' + data.netCap.networkCap); })); // Subscription event, network unavailable conn.on('netUnavailable', ((data: void) => { - console.warn('网络不可用, data is ' + JSON.stringify(data)); + console.warn('The network is unavailable, data is ' + JSON.stringify(data)); })); // Subscription event, network disconnection conn.on('netLost', ((data: connection.NetHandle) => { - console.warn('网络lost, netId is ' + data.netId); + console.warn('Network lost, netId is ' + data.netId); })); } @@ -97,10 +97,10 @@ struct NetWork { build() { Row() { Column() { - Button('监听网络').onClick(() => { + Button('Monitor the network').onClick(() => { listen_network() }) - Button('获取网络状态').onClick(() => { + Button('Obtain the network status').onClick(() => { sub_network() }) } -- Gitee From ab62e59050ada0d93736f4c67826c0faa927b0be Mon Sep 17 00:00:00 2001 From: liugang9704 <2745340733@qq.com> Date: Tue, 9 Sep 2025 16:00:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update:=20=E4=BF=AE=E6=94=B9=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArkUI/entry/src/main/ets/pages/MosaicEffect.ets | 8 ++++---- ArkUI/entry/src/main/ets/viewmodel/DrawViewModel.ets | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ArkUI/entry/src/main/ets/pages/MosaicEffect.ets b/ArkUI/entry/src/main/ets/pages/MosaicEffect.ets index a49b81b..8cdac5a 100644 --- a/ArkUI/entry/src/main/ets/pages/MosaicEffect.ets +++ b/ArkUI/entry/src/main/ets/pages/MosaicEffect.ets @@ -26,7 +26,7 @@ export struct DrawView { build() { Column({ space: 8 }) { - Text('请选择画笔类型') + Text('Please select the brush type') .fontColor(Color.Red) .textAlign(TextAlign.Center) .fontSize(30) @@ -71,15 +71,15 @@ export struct DrawView { ) Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceAround }) { - Button('普通画笔') + Button('Ordinary paintbrush') .onClick(() => { this.viewModel.drawModel.pathType = DrawPathType.pen; }) - Button('马赛克画笔') + Button('Mosaic brush') .onClick(() => { this.viewModel.drawModel.pathType = DrawPathType.pattern; }) - Button('清除内容') + Button('Clear the content') .onClick(() => { this.viewModel.clearPath(); }) diff --git a/ArkUI/entry/src/main/ets/viewmodel/DrawViewModel.ets b/ArkUI/entry/src/main/ets/viewmodel/DrawViewModel.ets index 9c993e6..efa53e5 100644 --- a/ArkUI/entry/src/main/ets/viewmodel/DrawViewModel.ets +++ b/ArkUI/entry/src/main/ets/viewmodel/DrawViewModel.ets @@ -24,11 +24,11 @@ export class DrawPathPointModel { } export enum DrawPathType { - pen = 0, // 画笔 - pattern // 马赛克 + pen = 0, // Brush + pattern // Mosaic } -// 配置画笔 +// Configure the brush export class DrawPathModel { public pathType: DrawPathType = DrawPathType.pen; public color: string = '#ED1B1B'; @@ -45,7 +45,7 @@ export class DrawViewModel { public canvasWidth: number = 0; private pattern: CanvasPattern | null = null; private points: DrawPathPointModel[] = []; - // 绘制路径 + // Draw a path private drawPath = new Path2D(); constructor() { -- Gitee From b2faf49ab8c60ec4b1e79bbcc16d4ab43ecba24b Mon Sep 17 00:00:00 2001 From: liugang9704 <2745340733@qq.com> Date: Tue, 9 Sep 2025 16:37:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=90=8C?= =?UTF-8?q?=E6=BA=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArkUI/entry/src/main/ets/pages/Index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ArkUI/entry/src/main/ets/pages/Index.d.ts diff --git a/ArkUI/entry/src/main/ets/pages/Index.d.ts b/ArkUI/entry/src/main/ets/pages/Index.d.ts new file mode 100644 index 0000000..1a59673 --- /dev/null +++ b/ArkUI/entry/src/main/ets/pages/Index.d.ts @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2024 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* +* FAQ:如何在C++调用ArkTS传递过来的function +*/ + +// [Start native_call_arkTs] +export const nativeCallArkTS: (a: object) => number; +// [End native_call_arkTs] \ No newline at end of file -- Gitee