diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index de72f864fb0546b2709f302cc89103bce9a1227c..121336673737ff9c89a744bd98659f1a1d7add1c 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -16,7 +16,7 @@ import { dataSharePredicates } from '@kit.ArkData'; import { abilityAccessCtrl, Permissions } from '@kit.AbilityKit'; import { camera } from '@kit.CameraKit'; -import { photoAccessHelper } from '@kit.MediaLibraryKit'; +import { MovingPhotoViewController, photoAccessHelper } from '@kit.MediaLibraryKit'; import { CameraConstants } from '../constants/CameraConstants'; import { filePreview } from '@kit.PreviewKit'; import { @@ -609,4 +609,31 @@ 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