From 0c1a6043d853d558b92cce46c8fec0089e855bba Mon Sep 17 00:00:00 2001 From: zhangxCode Date: Tue, 3 Jun 2025 09:42:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20third-party-camera=20?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 27 -------------------- entry/src/main/ets/pages/MovingPhotoView.ets | 19 ++++++++++++++ 2 files changed, 19 insertions(+), 27 deletions(-) create mode 100644 entry/src/main/ets/pages/MovingPhotoView.ets diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 1213366..0a75bb6 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -609,31 +609,4 @@ export async function fromBack(context: Context): Promise { storage.setOrCreate('isMovingPhoto', false); storage.setOrCreate('countDownTime', 0); cameraShooting(isVideo, cameraPosition, surfaceId, context, foldAbleStatus); -} - -@Component -struct TestCode { - // [Start moving_photo_view_controller] - @State src: photoAccessHelper.MovingPhoto | undefined = undefined; - - controller: MovingPhotoViewController = new MovingPhotoViewController(); - // [End moving_photo_view_controller] - - build() { - // [Start moving_photo_view] - MovingPhotoView({ - movingPhoto: this.src, - controller: this.controller - }) - // [End moving_photo_view] - } -} - -@Component -struct MovingPhotoView { - @Provide movingPhoto: photoAccessHelper.MovingPhoto | undefined = undefined - @Provide controller: MovingPhotoViewController = new MovingPhotoViewController() - build() { - - } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/MovingPhotoView.ets b/entry/src/main/ets/pages/MovingPhotoView.ets new file mode 100644 index 0000000..a4a6c9c --- /dev/null +++ b/entry/src/main/ets/pages/MovingPhotoView.ets @@ -0,0 +1,19 @@ +import { MovingPhotoView, MovingPhotoViewController, photoAccessHelper } from '@kit.MediaLibraryKit'; + +@Component +struct TestCode { + // [Start moving_photo_view_controller] + @State src: photoAccessHelper.MovingPhoto | undefined = undefined; + + controller: MovingPhotoViewController = new MovingPhotoViewController(); + // [End moving_photo_view_controller] + + build() { + // [Start moving_photo_view] + MovingPhotoView({ + movingPhoto: this.src, + controller: this.controller + }) + // [End moving_photo_view] + } +} \ No newline at end of file -- Gitee