Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
王士厅
2024-04-10 19:14:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
45b9805a09646ed0a21316ef75b0977575f27aa2
45b9805a
1 parent
89818a0d
音频dialog开发
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
sight_harmony/features/wdComponent/src/main/ets/dialog/AudioDialog.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/AudioDialog.ets
0 → 100644
View file @
45b9805
import { WDPlayerController } from 'wdPlayer';
import { PaperReaderSimpleDialog } from './PaperReaderDialog';
import { Logger } from 'wdKit/Index';
const TAG = 'AudioDialog';
@Preview
@CustomDialog
export struct AudioDialog {
private playerController: WDPlayerController = new WDPlayerController();
private simpleAudioDialog: CustomDialogController = new CustomDialogController({
builder: PaperReaderSimpleDialog({
cancel: this.onCancel,
confirm: this.onConfirm,
playerController: this.playerController
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.CenterStart,
offset: { dx: 12, dy: -150 },
})
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
}
/**
* 回调无用
**/
onConfirm() {
Logger.info(TAG, "cj2024 onConfirm = ")
// if (this.playerController != undefined) {
//
// }
// this.status = PlayerConstants.STATUS_PAUSE;
// this.playerController?.pause()
}
build() {
Row() {
Image($r("app.media.icon_audio_pause"))
.objectFit(ImageFit.Contain)
.margin(18)
.width(24)
.height(24)
}
.width(60)
.height(60)
.backgroundColor(Color.White)
.onClick(() => {
if (this.simpleAudioDialog) {
this.simpleAudioDialog.close()
this.simpleAudioDialog.open()
if (this.simpleAudioDialog) {
setTimeout(() => {
console.log('PaperReaderSimpleDialog delay 1s');
if (this.simpleAudioDialog != undefined) {
this.simpleAudioDialog.close()
}
if (this.simpleAudioDialog != undefined) {
this.simpleAudioDialog.open()
}
}, 500000);
}
}
})
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment