diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 121336673737ff9c89a744bd98659f1a1d7add1c..0a75bb616dd4ca302033ff30cc656c56cd8758d1 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 0000000000000000000000000000000000000000..a4a6c9cd1af8b451e2258829ad178fa388dd1a98 --- /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