From c716b4c165057a51732f7bf47e82cb44a9c6ba11 Mon Sep 17 00:00:00 2001 From: hexagon1337 Date: Sat, 22 Feb 2025 10:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E5=91=8A?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hexagon1337 --- .../src/main/ets/component/XComponentView.ets | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/entry/src/main/ets/component/XComponentView.ets b/entry/src/main/ets/component/XComponentView.ets index a7dfcc7..289d32c 100644 --- a/entry/src/main/ets/component/XComponentView.ets +++ b/entry/src/main/ets/component/XComponentView.ets @@ -15,9 +15,9 @@ import { common } from '@kit.AbilityKit'; import XComponentContext from "../interface/XComponentContext"; -import { newPAGFile, newPAGView, PAGComposition, newPAGComposition } from '@ohos/libpag'; +import { newPAGFile, newPAGView, newPAGComposition } from '@ohos/libpag'; import { PAGScaleMode } from '@ohos/libpag'; -import prompt from '@ohos.prompt'; +import { promptAction } from '@kit.ArkUI'; enum EnumPagPlayState { @@ -32,14 +32,14 @@ enum EnumPagPlayState { export struct XComponentView { private PAGFile = new newPAGFile(); private PAGView = new newPAGView(); - private xComponentContext: XComponentContext | undefined = undefined; + xComponentContext: XComponentContext | undefined = undefined; @State currentStatus: string = "init"; @State isPause: boolean = true; @State repeateCount: string = '' @State currentFrame: string = this.getResourceString('Retrieve_the_current_frame') @State isPlaying: string = this.getResourceString('Determine_whether_the_current_animation_is_playing') - private componentIndex: number = 0 - private pagPath: Array = [] + componentIndex: number = 0 + pagPath: Array = [] @State startFrame: string = ''; private xcomponentId: string = 'xcomponentId' + (Math.random() * 10000); private pagCompoition: newPAGComposition | undefined = undefined; @@ -247,7 +247,7 @@ export struct XComponentView { // 添加动画播放监听 let playFuc = (state: number) => { console.log(`PAGView.play state=====${state}`) - prompt.showToast({ + promptAction.showToast({ message: this.getResourceString('Animation_playback_monitoring_successful'), duration: 1000, bottom: 100 @@ -258,7 +258,7 @@ export struct XComponentView { // 添加重复监听 let RepeatCountFuc = (RepeatCount: number) => { console.log(`PAGView.RepeatCount state=====${RepeatCount}`) - prompt.showToast({ + promptAction.showToast({ message: this.getResourceString('Animation_repeated_monitoring_successful'), duration: 1000, bottom: 100 @@ -283,7 +283,7 @@ export struct XComponentView { // 添加动画暂停监听 let pauseFuc = (state: number) => { console.log(`PAGView.pauseFuc state=====${state}`) - prompt.showToast({ + promptAction.showToast({ message: this.getResourceString('Animation_pause_listening_successful'), duration: 1000, bottom: 100 @@ -302,7 +302,7 @@ export struct XComponentView { // 添加动画停止监听 let stopFuc = (state: number) => { console.log(`PAGView.stop state=====${state}`) - prompt.showToast({ + promptAction.showToast({ message: this.getResourceString('Animation_stopped_listening_successfully'), duration: 1000, bottom: 100 -- Gitee