已合并
常识/一致性问题修复 #10212
chen-junlong创建于 6月29日
常识/一致性问题修复 #10212
已合并
共 11 个文件变更+16-16
| @@ -180,7 +180,7 @@ export struct DefaultDrag { | |||
| 180 | .height(this.imageHeight) | 180 | .height(this.imageHeight) |
| 181 | .draggable(true) | 181 | .draggable(true) |
| 182 | .margin({ left: 15 }) | 182 | .margin({ left: 15 }) |
| 183 | - .border({ color: Color.Black, width: 1 })// 控制角标显示类型为MOVE,即不显示角标 | 183 | + .border({ color: Color.Black, width: 1 })// 控制角标显示类型为COPY,即显示加号角标 |
| 184 | // [Start set_drag_behavior_move] | 184 | // [Start set_drag_behavior_move] |
| 185 | .onDragMove((event) => { | 185 | .onDragMove((event) => { |
| 186 | event.setResult(DragResult.DROP_ENABLED); | 186 | event.setResult(DragResult.DROP_ENABLED); |
| @@ -55,7 +55,7 @@ export struct FocusTransferExample { | |||
| 55 | console.error('Get string failed!'); | 55 | console.error('Get string failed!'); |
| 56 | } | 56 | } |
| 57 | }) | 57 | }) |
| 58 | - Button('button 3') | 58 | + Button('Button 3') |
| 59 | .margin(20) | 59 | .margin(20) |
| 60 | .onFocus(() => { | 60 | .onFocus(() => { |
| 61 | // 请将$r('app.string.Get_Focus')替换为实际资源文件,在本示例中该资源文件的value值为"获得焦点" | 61 | // 请将$r('app.string.Get_Focus')替换为实际资源文件,在本示例中该资源文件的value值为"获得焦点" |
| @@ -46,7 +46,7 @@ export struct FocusableExample { | |||
| 46 | }) | 46 | }) |
| 47 | Divider() | 47 | Divider() |
| 48 | 48 | ||
| 49 | - Text('focusable: ' + this.textFocusable) // 第二个Text设置了focusable初始为true,focusableOnTouch为true | 49 | + Text('focusable: ' + this.textFocusable) // 第二个Text设置了focusable初始为true,focusOnTouch为true |
| 50 | .borderColor(this.color2) | 50 | .borderColor(this.color2) |
| 51 | .borderWidth(2) | 51 | .borderWidth(2) |
| 52 | .width(300) | 52 | .width(300) |
Mcode/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/focus/OnFocusOnBlurEvents.ets+2-2
| @@ -40,7 +40,7 @@ export struct FocusAndBlurExample { | |||
| 40 | }) | 40 | }) |
| 41 | } | 41 | } |
| 42 | .onFocus(() => { | 42 | .onFocus(() => { |
| 43 | - hilog.info(DOMAIN, TAG, BUNDLE + 'Row1 onFocus'); | 43 | + hilog.info(DOMAIN, TAG, `${BUNDLE} Row1 onFocus`); |
| 44 | }) | 44 | }) |
| 45 | .onBlur(() => { | 45 | .onBlur(() => { |
| 46 | hilog.info(DOMAIN, TAG, `${BUNDLE} Row1 onBlur`); | 46 | hilog.info(DOMAIN, TAG, `${BUNDLE} Row1 onBlur`); |
| @@ -59,7 +59,7 @@ export struct FocusAndBlurExample { | |||
| 59 | }) | 59 | }) |
| 60 | } | 60 | } |
| 61 | .onFocus(() => { | 61 | .onFocus(() => { |
| 62 | - hilog.info(DOMAIN, TAG, BUNDLE + 'Row2 onFocus'); | 62 | + hilog.info(DOMAIN, TAG, `${BUNDLE} Row2 onFocus`); |
| 63 | }) | 63 | }) |
| 64 | .onBlur(() => { | 64 | .onBlur(() => { |
| 65 | hilog.info(DOMAIN, TAG, `${BUNDLE} Row2 onBlur`); | 65 | hilog.info(DOMAIN, TAG, `${BUNDLE} Row2 onBlur`); |
| @@ -28,7 +28,7 @@ struct GridEts { | |||
| 28 | unifiedData: UnifiedData | undefined = undefined; | 28 | unifiedData: UnifiedData | undefined = undefined; |
| 29 | timeout: number = 1; | 29 | timeout: number = 1; |
| 30 | finished: boolean = false; | 30 | finished: boolean = false; |
| 31 | - dragEvent: DragEvent | undefined; | 31 | + dragEvent: DragEvent | undefined = undefined; |
| 32 | 32 | ||
| 33 | @Styles | 33 | @Styles |
| 34 | normalStyles(): void{ | 34 | normalStyles(): void{ |
Mcode/DocsSample/ArkUISample/EventProject/entry/src/main/ets/pages/singlegesture/SwipeGesture.ets+3-3
| @@ -32,12 +32,12 @@ export struct Swipe { | |||
| 32 | .width(300) | 32 | .width(300) |
| 33 | .height(200) | 33 | .height(200) |
| 34 | .margin(100) | 34 | .margin(100) |
| 35 | - // 在Column组件上绑定旋转,通过滑动手势的滑动速度和角度修改旋转的角度 | 35 | + // 在Column组件上绑定旋转,通过快滑手势的滑动速度和角度修改旋转的角度 |
| 36 | .rotate({ angle: this.rotateAngle }) | 36 | .rotate({ angle: this.rotateAngle }) |
| 37 | .gesture( | 37 | .gesture( |
| 38 | - // 绑定滑动手势且限制仅在竖直方向滑动时触发 | 38 | + // 绑定快滑手势且限制仅在竖直方向滑动时触发 |
| 39 | SwipeGesture({ direction: SwipeDirection.Vertical }) | 39 | SwipeGesture({ direction: SwipeDirection.Vertical }) |
| 40 | - // 当滑动手势触发时,获取滑动的速度和角度,实现对组件的布局参数的修改 | 40 | + // 当快滑手势触发时,获取滑动的速度和角度,实现对组件的布局参数的修改 |
| 41 | .onAction((event: GestureEvent|undefined) => { | 41 | .onAction((event: GestureEvent|undefined) => { |
| 42 | if(event){ | 42 | if(event){ |
| 43 | this.speed = event.speed; | 43 | this.speed = event.speed; |
| @@ -28,7 +28,7 @@ struct Index { | |||
| 28 | 请将$r('app.string.Drag_instructions')替换为实际资源文件,在本示例中该资源文件的value值为"包括上下两层组件,上层组件绑定长按手势, | 28 | 请将$r('app.string.Drag_instructions')替换为实际资源文件,在本示例中该资源文件的value值为"包括上下两层组件,上层组件绑定长按手势, |
| 29 | 下层组件绑定拖拽。其中上层组件下半区域绑定手势拦截,使该区域响应下层拖拽手势。" | 29 | 下层组件绑定拖拽。其中上层组件下半区域绑定手势拦截,使该区域响应下层拖拽手势。" |
| 30 | */ | 30 | */ |
| 31 | - Text($r('app.string.Drag_instructions')).width('100%').fontSize(20).fontColor('0xffdd00') | 31 | + Text($r('app.string.Drag_instructions')).width('100%').fontSize(20).fontColor('#ffdd00') |
| 32 | Stack({ alignContent: Alignment.Center }) { | 32 | Stack({ alignContent: Alignment.Center }) { |
| 33 | Column() { | 33 | Column() { |
| 34 | // 模拟上半区和下半区 | 34 | // 模拟上半区和下半区 |
| @@ -36,7 +36,7 @@ struct Index { | |||
| 36 | Stack().width('200vp').height('100vp').backgroundColor(Color.Blue) | 36 | Stack().width('200vp').height('100vp').backgroundColor(Color.Blue) |
| 37 | }.width('200vp').height('200vp') | 37 | }.width('200vp').height('200vp') |
| 38 | 38 | ||
| 39 | - // Stack的下半区是绑定了滑动手势的图像区域。 | 39 | + // Stack的下半区是绑定了拖拽手势的图像区域。 |
| 40 | // $r('sys.media.ohos_app_icon') 需要替换为开发者所需的资源文件 | 40 | // $r('sys.media.ohos_app_icon') 需要替换为开发者所需的资源文件 |
| 41 | Image($r('sys.media.ohos_app_icon')) | 41 | Image($r('sys.media.ohos_app_icon')) |
| 42 | .draggable(true) | 42 | .draggable(true) |
| @@ -64,7 +64,7 @@ struct CustomGestures { | |||
| 64 | */ | 64 | */ |
| 65 | promptAction.showToast({ message: $r('app.string.Stop_dragging_prompt') }); | 65 | promptAction.showToast({ message: $r('app.string.Stop_dragging_prompt') }); |
| 66 | }) | 66 | }) |
| 67 | - .tag('longpress') | 67 | + .tag('longPress') |
| 68 | )) | 68 | )) |
| 69 | // [End set_gestures] | 69 | // [End set_gestures] |
| 70 | 70 | ||
| @@ -17,8 +17,8 @@ | |||
| 17 | @Entry | 17 | @Entry |
| 18 | @ComponentV2 | 18 | @ComponentV2 |
| 19 | struct Index { | 19 | struct Index { |
| 20 | - @Local progress: number = 496000; // 初始进度,秒 | 20 | + @Local progress: number = 496000; // 初始进度,毫秒 |
| 21 | - @Local total: number = 27490000; // 总时长,秒 | 21 | + @Local total: number = 27490000; // 总时长,毫秒 |
| 22 | @Local currentWidth: string = '100%'; | 22 | @Local currentWidth: string = '100%'; |
| 23 | @Local currentHeight: string = '100%'; | 23 | @Local currentHeight: string = '100%'; |
| 24 | @Local playbackProgress: string = ''; | 24 | @Local playbackProgress: string = ''; |
| @@ -51,7 +51,7 @@ struct MouseMove { | |||
| 51 | .justifyContent(FlexAlign.Center) | 51 | .justifyContent(FlexAlign.Center) |
| 52 | .borderWidth(2) | 52 | .borderWidth(2) |
| 53 | .borderColor(Color.Red) | 53 | .borderColor(Color.Red) |
| 54 | - .onMouse((event?: MouseEvent) => { // Set the onMouse callback for the column. | 54 | + .onMouse((event?: MouseEvent) => { // 设置Column的onMouse回调 |
| 55 | if (event) { | 55 | if (event) { |
| 56 | this.columnText = 'Column onMouse:\n' + '' + | 56 | this.columnText = 'Column onMouse:\n' + '' + |
| 57 | 'button = ' + event.button + '\n' + | 57 | 'button = ' + event.button + '\n' + |
| @@ -109,7 +109,7 @@ void GetDragData(ArkUI_DragEvent* dragEvent) | |||
| 109 | returnStatus = OH_UdmfRecord_GetFileUri(records[i], imageValue); | 109 | returnStatus = OH_UdmfRecord_GetFileUri(records[i], imageValue); |
| 110 | const char *fileUri = OH_UdsFileUri_GetFileUri(imageValue); | 110 | const char *fileUri = OH_UdsFileUri_GetFileUri(imageValue); |
| 111 | OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00U, "dragTest", | 111 | OH_LOG_Print(LOG_APP, LOG_INFO, 0xFF00U, "dragTest", |
| 112 | - "dragTest OH_UdmfRecord_GetPlainText " | 112 | + "dragTest OH_UdsFileUri_GetFileUri " |
| 113 | "returnStatus= %{public}d " | 113 | "returnStatus= %{public}d " |
| 114 | "fileUri= %{public}s", | 114 | "fileUri= %{public}s", |
| 115 | returnStatus, fileUri); | 115 | returnStatus, fileUri); |