From 9590cc1c7ade846f2f9bc5ac31e99513657c9e7c Mon Sep 17 00:00:00 2001 From: cjand <1747143535@qq.com> Date: Thu, 20 Feb 2025 15:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= 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 | 40 +++++++++---------- .../plugins/camera/utlis/DateTimeUtil.ts | 1 + .../main/ets/image_picker/ImageResizer.ets | 16 ++++---- .../JavaScriptChannelHostApiImpl.ets | 3 +- .../JavaScriptChannelHostApiImpl.ets | 3 +- 6 files changed, 38 insertions(+), 30 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..9b6b39b82 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,23 @@ // Copyright 2013 The Flutter Authors. export enum CameraState { + // Avoid repetition /** Idle, showing preview and not capturing anything. */ STATE_PREVIEW, + // Avoid repetition /** Starting and waiting for autofocus to complete. */ STATE_WAITING_FOCUS, + // Avoid repetition /** Start performing autoexposure. */ STATE_WAITING_PRECAPTURE_START, + // Avoid repetition /** waiting for autoexposure to complete. */ STATE_WAITING_PRECAPTURE_DONE, + // Avoid repetition /** 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..a635236a1 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 @@ -26,8 +26,8 @@ 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 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. */ @@ -36,8 +36,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the exposure lock feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @param cameraProperties instance of the CameraProperties class containing information + * about the cameras features. * @return newly created instance of the ExposureLockFeature class. */ createExposureLockFeature(cameraProperties: CameraProperties): ExposureLockFeature; @@ -45,8 +45,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the exposure offset feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @param cameraProperties instance of the CameraProperties class containing information + * about the cameras features. * @return newly created instance of the ExposureOffsetFeature class. */ createExposureOffsetFeature(cameraProperties: CameraProperties): ExposureOffsetFeature; @@ -54,8 +54,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the flash feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @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; @@ -63,8 +63,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the resolution feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @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. @@ -77,8 +77,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the focus point feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @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 FocusPointFeature class. @@ -91,8 +91,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the FPS range feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @param cameraProperties instance of the CameraProperties class containing information + * about the cameras features. * @return newly created instance of the FpsRangeFeature class. */ @@ -101,8 +101,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the sensor orientation feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @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. @@ -117,8 +117,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the zoom level feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @param cameraProperties instance of the CameraProperties class containing information + * about the cameras features. * @return newly created instance of the ZoomLevelFeature class. */ @@ -127,8 +127,8 @@ export interface CameraFeatureFactory { /** * Creates a new instance of the exposure point feature. * - * @param cameraProperties instance of the CameraProperties class containing information about the - * cameras features. + * @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. 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..6a601d82f 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 @@ -48,6 +48,7 @@ export default class DateTimeUtil { } /** + * Avoid repetition * 时分秒格式修饰 * @param hours * @param minutes 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..66650be45 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 @@ -21,7 +21,8 @@ export class JavaScriptChannelHostApiImpl extends JavaScriptChannelHostApi { /** * Creates a host API that handles creating {@link JavaScriptChannel}s. * - * @param instanceManager maintains instances stored to communicate with Dart objects + * @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 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..66650be45 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 @@ -21,7 +21,8 @@ export class JavaScriptChannelHostApiImpl extends JavaScriptChannelHostApi { /** * Creates a host API that handles creating {@link JavaScriptChannel}s. * - * @param instanceManager maintains instances stored to communicate with Dart objects + * @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 -- Gitee