From c9bf4bce367d9941740af66ede15ec2dcdd14670 Mon Sep 17 00:00:00 2001 From: cjand <1747143535@qq.com> Date: Tue, 18 Feb 2025 15:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F=E7=B1=BB?= =?UTF-8?q?=E4=BC=BC=E4=BB=A3=E7=A0=81=E7=89=87=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cjand <1747143535@qq.com> --- .../io/flutter/plugins/camera/CameraState.ets | 5 --- .../camera/features/CameraFeatureFactory.ets | 44 ------------------- .../plugins/camera/utlis/DateTimeUtil.ts | 6 --- .../main/ets/image_picker/ImageResizer.ets | 16 +++---- .../JavaScriptChannelHostApiImpl.ets | 8 ---- .../JavaScriptChannelHostApiImpl.ets | 8 ---- 6 files changed, 8 insertions(+), 79 deletions(-) diff --git a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/CameraState.ets b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/CameraState.ets index 8a2c23089..9e09f1391 100644 --- a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/CameraState.ets +++ b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/CameraState.ets @@ -5,18 +5,13 @@ // Copyright 2013 The Flutter Authors. export enum CameraState { - /** Idle, showing preview and not capturing anything. */ STATE_PREVIEW, - /** Starting and waiting for autofocus to complete. */ STATE_WAITING_FOCUS, - /** Start performing autoexposure. */ STATE_WAITING_PRECAPTURE_START, - /** waiting for autoexposure to complete. */ STATE_WAITING_PRECAPTURE_DONE, - /** Capturing an image. */ STATE_CAPTURING, } \ No newline at end of file diff --git a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/features/CameraFeatureFactory.ets b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/features/CameraFeatureFactory.ets index ffd3fb0ae..42c358a67 100644 --- a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/features/CameraFeatureFactory.ets +++ b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/features/CameraFeatureFactory.ets @@ -23,14 +23,6 @@ import camera from '@ohos.multimedia.camera'; export interface CameraFeatureFactory { - /** - * Creates a new instance of the auto focus feature. - * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. - * @param recordingVideo indicates if the camera is currently recording. - * @return newly created instance of the AutoFocusFeature class. - */ createAutoFocusFeature(cameraProperties: CameraProperties, recordingVideo: boolean): AutoFocusFeature; /** @@ -51,24 +43,8 @@ export interface CameraFeatureFactory { */ createExposureOffsetFeature(cameraProperties: CameraProperties): ExposureOffsetFeature; - /** - * Creates a new instance of the flash feature. - * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. - * @return newly created instance of the FlashFeature class. - */ createFlashFeature(cameraProperties: CameraProperties): FlashFeature; - /** - * Creates a new instance of the resolution feature. - * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. - * @param initialSetting initial resolution preset. - * @param cameraName the name of the camera which can be used to identify the camera device. - * @return newly created instance of the ResolutionFeature class. - */ createResolutionFeature( cameraProperties: CameraProperties, initialSetting: ResolutionPreset, @@ -98,17 +74,6 @@ export interface CameraFeatureFactory { createFpsRangeFeature(cameraProperties: CameraProperties): FpsRangeFeature; - /** - * Creates a new instance of the sensor orientation feature. - * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. - * @param activity current activity associated with the camera plugin. - * @param dartMessenger instance of the DartMessenger class, used to send state updates back to - * Dart. - * @return newly created instance of the SensorOrientationFeature class. - */ - createSensorOrientationFeature( cameraProperties: CameraProperties, ability: Ability, @@ -124,15 +89,6 @@ export interface CameraFeatureFactory { createZoomLevelFeature(cameraProperties: CameraProperties): ZoomLevelFeature; - /** - * Creates a new instance of the exposure point feature. - * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. - * @param sensorOrientationFeature instance of the SensorOrientationFeature class containing - * information about the sensor and device orientation. - * @return newly created instance of the ExposurePointFeature class. - */ createExposurePointFeature( cameraProperties: CameraProperties, diff --git a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/utlis/DateTimeUtil.ts b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/utlis/DateTimeUtil.ts index 6fd1e1189..2b6250f23 100644 --- a/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/utlis/DateTimeUtil.ts +++ b/packages/camera/camera_ohos/ohos/src/main/ets/io/flutter/plugins/camera/utlis/DateTimeUtil.ts @@ -47,12 +47,6 @@ export default class DateTimeUtil { return `${year}${this.fill(month)}${this.fill(date)}`; } - /** - * 时分秒格式修饰 - * @param hours - * @param minutes - * @param seconds - */ concatTime(hours: number, minutes: number, seconds: number): string { return `${this.fill(hours)}${this.fill(minutes)}${this.fill(seconds)}`; } diff --git a/packages/image_picker/image_picker_ohos/ohos/src/main/ets/image_picker/ImageResizer.ets b/packages/image_picker/image_picker_ohos/ohos/src/main/ets/image_picker/ImageResizer.ets index 5590a12cd..11d405736 100644 --- a/packages/image_picker/image_picker_ohos/ohos/src/main/ets/image_picker/ImageResizer.ets +++ b/packages/image_picker/image_picker_ohos/ohos/src/main/ets/image_picker/ImageResizer.ets @@ -91,26 +91,26 @@ export default class ImageResizer { let shouldDownscale: boolean = shouldDownscaleWidth || shouldDownscaleHeight; if (shouldDownscale) { - let downscaledWidth: number = (height / originalHeight) * originalWidth; - let downscaledHeight: number = (width / originalWidth) * originalHeight; + let realDownscaledWidth: number = (height / originalHeight) * originalWidth; + let realDownscaledHeight: number = (width / originalWidth) * originalHeight; if (width < height) { if (!hasMaxWidth) { - width = downscaledWidth; + width = realDownscaledWidth; } else { - height = downscaledHeight; + height = realDownscaledHeight; } } else if (height < width) { if (!hasMaxHeight) { - height = downscaledHeight; + height = realDownscaledHeight; } else { - width = downscaledWidth; + width = realDownscaledWidth; } } else { if (originalWidth < originalHeight) { - width = downscaledWidth; + width = realDownscaledWidth; } else if (originalHeight < originalWidth) { - height = downscaledHeight; + height = realDownscaledHeight; } } } diff --git a/packages/webview_flutter-v4.4.4/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets b/packages/webview_flutter-v4.4.4/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets index 527e8141f..0b65c56fc 100644 --- a/packages/webview_flutter-v4.4.4/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets +++ b/packages/webview_flutter-v4.4.4/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets @@ -18,14 +18,6 @@ export class JavaScriptChannelHostApiImpl extends JavaScriptChannelHostApi { /** Handles creating {@link JavaScriptChannel}s for a {@link JavaScriptChannelHostApiImpl}. */ - /** - * Creates a host API that handles creating {@link JavaScriptChannel}s. - * - * @param instanceManager maintains instances stored to communicate with Dart objects - * @param javaScriptChannelCreator handles creating {@link JavaScriptChannel}s - * @param flutterApi handles sending messages to Dart - * @param platformThreadHandler handles making callbacks on the desired thread - */ constructor( instanceManager: InstanceManager, javaScriptChannelCreator: JavaScriptChannelCreator, flutterApi: JavaScriptChannelFlutterApiImpl diff --git a/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets b/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets index 527e8141f..0b65c56fc 100644 --- a/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets +++ b/packages/webview_flutter/webview_flutter_ohos/ohos/src/main/ets/io.flutter.plugins/webview_flutter/JavaScriptChannelHostApiImpl.ets @@ -18,14 +18,6 @@ export class JavaScriptChannelHostApiImpl extends JavaScriptChannelHostApi { /** Handles creating {@link JavaScriptChannel}s for a {@link JavaScriptChannelHostApiImpl}. */ - /** - * Creates a host API that handles creating {@link JavaScriptChannel}s. - * - * @param instanceManager maintains instances stored to communicate with Dart objects - * @param javaScriptChannelCreator handles creating {@link JavaScriptChannel}s - * @param flutterApi handles sending messages to Dart - * @param platformThreadHandler handles making callbacks on the desired thread - */ constructor( instanceManager: InstanceManager, javaScriptChannelCreator: JavaScriptChannelCreator, flutterApi: JavaScriptChannelFlutterApiImpl -- Gitee