|
|
@@ -506,6 +506,7 @@ export struct LocalMusic {
|
|
|
@State isSwipe: boolean = false //listItem的左滑开关
|
|
|
@State openSkipSongAnimate: boolean = true//切歌动画效果
|
|
|
@State isPlayPageSwipeNext: boolean = true // 播放页上滑切歌
|
|
|
+ @State isLightText: boolean = true //是否开启歌词发光
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@State isDarkMode: boolean = false
|
|
|
@State lyricTextWeight: number = 400
|
|
|
@@ -1386,7 +1387,9 @@ export struct LocalMusic {
|
|
|
this.isCoverTopBig = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP_BIG, false)
|
|
|
this.isShowSingleLineLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SLLYRIC, false)
|
|
|
this.isEnableWordByWordLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_ENABLE_WORD_BY_WORD_LYRIC, true)
|
|
|
+ this.isLightText = PreferencesUtil.getBooleanSync(SettingPage.IS_LIGHT_TEXT, true)
|
|
|
this.syncWordByWordLyricMode()
|
|
|
+ this.syncLyricLightTextMode()
|
|
|
this.longPressSpeed = PreferencesUtil.getNumberSync(SettingPage.LONG_PRESS_SPEED, 3)
|
|
|
this.isPlayListBgGrass = PreferencesUtil.getBooleanSync(SettingPage.IS_PLAYLIST_BG_GRASS, true)
|
|
|
this.isShowHeader = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_HEADER, true)
|
|
|
@@ -3136,23 +3139,37 @@ export struct LocalMusic {
|
|
|
ToastUtil.showToast('当前歌曲无效');
|
|
|
return;
|
|
|
}
|
|
|
- if (this.currentSong.type !== CommonConstants.TYPE_LOCAL) {
|
|
|
- ToastUtil.showToast('仅支持本地歌曲更换封面');
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
const sandboxCoverUri = await this.pickCoverImageToSandbox();
|
|
|
if (StrUtil.isEmpty(sandboxCoverUri)) {
|
|
|
return;
|
|
|
}
|
|
|
+ const coverUri = sandboxCoverUri as string;
|
|
|
|
|
|
this.loadingDialogId = DialogHelper.showLoadingDialog();
|
|
|
try {
|
|
|
+ if (isRemoteCloudType(this.currentSong.type)) {
|
|
|
+ this.cover = coverUri;
|
|
|
+ this.currentSong.pixelMapPath = coverUri;
|
|
|
+ this.syncRemoteManagerSong(this.currentSong);
|
|
|
+ await this.persistRemoteMetadataToDb(this.currentSong);
|
|
|
+ this.emitRemoteMetadataUpdated(this.currentSong);
|
|
|
+ this.currentSong = cloneVideoItem(this.currentSong);
|
|
|
+ AppStorage.setOrCreate('currentSong', this.currentSong);
|
|
|
+ ToastUtil.showToast('更换封面成功');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.currentSong.type !== CommonConstants.TYPE_LOCAL) {
|
|
|
+ ToastUtil.showToast('当前歌曲类型暂不支持更换封面');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const task = new taskpool.Task(
|
|
|
replaceLocalMusicCoverTask,
|
|
|
this.context,
|
|
|
this.currentSong.filePath,
|
|
|
- FileUtil.getFilePath(sandboxCoverUri!)
|
|
|
+ FileUtil.getFilePath(coverUri)
|
|
|
);
|
|
|
const result = await taskpool.execute(task, taskpool.Priority.HIGH) as boolean;
|
|
|
if (!result) {
|
|
|
@@ -3160,8 +3177,8 @@ export struct LocalMusic {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- this.cover = sandboxCoverUri;
|
|
|
- this.currentSong.pixelMapPath = sandboxCoverUri;
|
|
|
+ this.cover = coverUri;
|
|
|
+ this.currentSong.pixelMapPath = coverUri;
|
|
|
await this.doUpateEditedFields(this.currentSong);
|
|
|
ToastUtil.showToast('更换封面成功');
|
|
|
} catch (error) {
|
|
|
@@ -10412,8 +10429,8 @@ export struct LocalMusic {
|
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
|
})
|
|
|
- .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 600 }),
|
|
|
- TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
+ // .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 600 }),
|
|
|
+ // TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE })
|
|
|
//拖动List关键代码开始
|
|
|
.scale({ x: this.scaleSelect(index), y: this.scaleSelect(index) })
|
|
|
@@ -11240,6 +11257,12 @@ export struct LocalMusic {
|
|
|
this.lyricControllerSingle.setEnableWordByWordLyric(this.isEnableWordByWordLyric)
|
|
|
}
|
|
|
|
|
|
+ private syncLyricLightTextMode(): void {
|
|
|
+ this.lyricController.setLightText(this.isLightText)
|
|
|
+ this.lyricControllerXF.setLightText(this.isLightText)
|
|
|
+ this.lyricControllerSingle.setLightText(this.isLightText)
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 初始化歌词加载与展示逻辑
|
|
|
* @param lyricPath 歌词文件路径(支持普通.lrc和加密.lrcc)
|
|
|
@@ -11265,6 +11288,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
this.syncWordByWordLyricMode()
|
|
|
+ this.syncLyricLightTextMode()
|
|
|
this.initPipLyricSetting()
|
|
|
this.lyricControllerSingle
|
|
|
.setTextSize(15)
|
|
|
@@ -11859,14 +11883,14 @@ export struct LocalMusic {
|
|
|
.fontWeight(FontWeight.Bolder)
|
|
|
.fontColor(Color.White)
|
|
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
- .margin({ left: this.currentLyricAlignMode === 0 ? 8 : 0 })
|
|
|
+ .margin({ left: 10 })
|
|
|
Row() {
|
|
|
Text(this.currentSong?.artist !== undefined ? this.currentSong?.artist : '')
|
|
|
.fontSize(13)
|
|
|
.fontWeight(FontWeight.Bolder)
|
|
|
.padding({ top: 8 })
|
|
|
.fontColor(Color.White)
|
|
|
- .margin({ left: this.currentLyricAlignMode === 0 ? 8 : 0 })
|
|
|
+ .margin({ left: 10 })
|
|
|
Blank()
|
|
|
|
|
|
}
|
|
|
@@ -11912,7 +11936,7 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
.width(this.currentLyricAlignModePip === 1?'98%':'90%%')
|
|
|
- .padding({ left: 25, right: 25 })
|
|
|
+ .padding({ left: 28, right: 28 })
|
|
|
.height(58)
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
}
|
|
|
@@ -13106,6 +13130,36 @@ export struct LocalMusic {
|
|
|
top: 10,
|
|
|
bottom: 10
|
|
|
})
|
|
|
+
|
|
|
+ Row() {
|
|
|
+ Text(`歌词发光:`)
|
|
|
+ .fontSize(14)
|
|
|
+ .fontColor(Color.White)
|
|
|
+
|
|
|
+ Column() {
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isLightText })
|
|
|
+ .selectedColor(this.themeColor)
|
|
|
+ .switchPointColor(Color.White)
|
|
|
+ .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .onChange((checked: boolean) => {
|
|
|
+ this.isLightText = checked;
|
|
|
+ PreferencesUtil.putSync(SettingPage.IS_LIGHT_TEXT, this.isLightText)
|
|
|
+ this.syncLyricLightTextMode()
|
|
|
+ })
|
|
|
+ .width(50)
|
|
|
+ .height(30)
|
|
|
+ .alignSelf(ItemAlign.Start)
|
|
|
+ .margin({ left: 12 })
|
|
|
+ Blank()
|
|
|
+ }
|
|
|
+ .width('76%')
|
|
|
+ }
|
|
|
+ .margin({
|
|
|
+ left: 20,
|
|
|
+ right: 15,
|
|
|
+ top: 10,
|
|
|
+ bottom: 10
|
|
|
+ })
|
|
|
}
|
|
|
Row() {
|
|
|
Text(`歌词居中:`)
|
|
|
@@ -13477,7 +13531,6 @@ export struct LocalMusic {
|
|
|
.textAlign(TextAlign.End)
|
|
|
|
|
|
}
|
|
|
- .width('76%')
|
|
|
.margin({
|
|
|
left: 20,
|
|
|
right: 45,
|
|
|
@@ -13514,7 +13567,7 @@ export struct LocalMusic {
|
|
|
.textAlign(TextAlign.End)
|
|
|
|
|
|
}
|
|
|
- .width('76%')
|
|
|
+
|
|
|
.margin({
|
|
|
left: 20,
|
|
|
right: 45,
|
|
|
@@ -13552,7 +13605,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
}
|
|
|
- .width('76%')
|
|
|
+
|
|
|
.margin({
|
|
|
left: 20,
|
|
|
right: 45,
|
|
|
@@ -13598,7 +13651,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
}
|
|
|
- .width('76%')
|
|
|
+
|
|
|
.margin({
|
|
|
left: 20,
|
|
|
right: 45,
|