|
@@ -512,9 +512,7 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Preview
|
|
@Preview
|
|
|
@Component
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
export struct LocalMusic {
|
|
|
- // @State button_gradient_state: hdsEffect.PressShadowType = hdsEffect.PressShadowType.NONE;
|
|
|
|
|
- // @State lightIntensity: number = 10;
|
|
|
|
|
- // @State illuminatedType: hdsEffect.PointLightIlluminatedType = hdsEffect.PointLightIlluminatedType.NONE
|
|
|
|
|
|
|
+ @State isShowPrecious: boolean = false //播控条显示上一首按钮
|
|
|
//背景两侧流光控制器
|
|
//背景两侧流光控制器
|
|
|
@State sceneBgController: HdsSceneController|undefined = deviceInfo.sdkApiVersion>=20
|
|
@State sceneBgController: HdsSceneController|undefined = deviceInfo.sdkApiVersion>=20
|
|
|
&&canIUse("SystemCapability.UIDesign.HDSComponent.Core")?
|
|
&&canIUse("SystemCapability.UIDesign.HDSComponent.Core")?
|
|
@@ -592,6 +590,7 @@ export struct LocalMusic {
|
|
|
@State dirList: Array<VideoItem> = []
|
|
@State dirList: Array<VideoItem> = []
|
|
|
@Consume videoLocalList:VideoItem[]
|
|
@Consume videoLocalList:VideoItem[]
|
|
|
@State dataSource: LazyDataSource<VideoItem> = new LazyDataSource(this.videoLocalList)
|
|
@State dataSource: LazyDataSource<VideoItem> = new LazyDataSource(this.videoLocalList)
|
|
|
|
|
+ @State listRefreshKey: number = 0
|
|
|
// @State mediaKuList: Array<VideoItem> = []; //媒体库文件
|
|
// @State mediaKuList: Array<VideoItem> = []; //媒体库文件
|
|
|
@StorageProp('mediaKuList') mediaKuList: Array<VideoItem> = []; //媒体库文件
|
|
@StorageProp('mediaKuList') mediaKuList: Array<VideoItem> = []; //媒体库文件
|
|
|
@State artistList: Array<VideoItem> = []; //艺术家文件
|
|
@State artistList: Array<VideoItem> = []; //艺术家文件
|
|
@@ -1186,6 +1185,7 @@ export struct LocalMusic {
|
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
|
}
|
|
}
|
|
|
initSetting() {
|
|
initSetting() {
|
|
|
|
|
+ this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
|
|
|
this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
this.sortType = PreferencesUtil.getNumberSync(SettingPage.SORT_TYPE, 4)
|
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
@@ -1295,7 +1295,7 @@ export struct LocalMusic {
|
|
|
case 101: //第一次扫描文件夹入库
|
|
case 101: //第一次扫描文件夹入库
|
|
|
ToastUtil.showToast('刷新同步数据库成功!')
|
|
ToastUtil.showToast('刷新同步数据库成功!')
|
|
|
Logger.info('onecold 扫描数据库结束 this.mediaKuList length= ' + this.mediaKuList.length)
|
|
Logger.info('onecold 扫描数据库结束 this.mediaKuList length= ' + this.mediaKuList.length)
|
|
|
- this.doUpdateData()
|
|
|
|
|
|
|
+ this.doAllUpdateData()
|
|
|
break;
|
|
break;
|
|
|
case 102: //查询媒体库列表
|
|
case 102: //查询媒体库列表
|
|
|
this.isRefreshing = false
|
|
this.isRefreshing = false
|
|
@@ -1711,11 +1711,9 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
console.info(`onecold gengxin 1: ${this.videoLocalList.length}`);
|
|
console.info(`onecold gengxin 1: ${this.videoLocalList.length}`);
|
|
|
- // for (let i = 0; i < this.videoLocalList.length; i++) {
|
|
|
|
|
- //
|
|
|
|
|
- // console.info(`onecold gengxin 1: ${this.videoLocalList[i].pixelMapPath}`);
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ for (let i = 0; i < this.videoLocalList.length; i++) {
|
|
|
|
|
+ console.info(`onecold gengxin 1: ${this.videoLocalList[i].name}`);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// this.setButtonStatus()
|
|
// this.setButtonStatus()
|
|
|
this.openMusic(isOpen, destPath,openItem)
|
|
this.openMusic(isOpen, destPath,openItem)
|
|
@@ -1746,7 +1744,8 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
if(openItem){
|
|
if(openItem){
|
|
|
this.doPlay(openItem,0,false,true)
|
|
this.doPlay(openItem,0,false,true)
|
|
|
- this.isShowPlay = true
|
|
|
|
|
|
|
+ // this.isShowPlay = true
|
|
|
|
|
+ this.setShowPlayTrue()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -2978,10 +2977,10 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
- // Button('乱码修复', { type: ButtonType.Capsule, stateEffect: true })
|
|
|
|
|
- // .width(90)
|
|
|
|
|
- // .height(50)
|
|
|
|
|
- // .fontSize(13)
|
|
|
|
|
|
|
+ // Button('乱码', { type: ButtonType.Circle, stateEffect: true })
|
|
|
|
|
+ // .width(45)
|
|
|
|
|
+ // .height(45)
|
|
|
|
|
+ // .fontSize(10)
|
|
|
// .margin({ top: 10, bottom: 10, right: 6 })
|
|
// .margin({ top: 10, bottom: 10, right: 6 })
|
|
|
// .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
// .clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
// .backgroundColor(this.themeColor)
|
|
// .backgroundColor(this.themeColor)
|
|
@@ -4216,7 +4215,8 @@ export struct LocalMusic {
|
|
|
this.handleFileSelection(item, !isChecked);
|
|
this.handleFileSelection(item, !isChecked);
|
|
|
} else {
|
|
} else {
|
|
|
this.doPlay(item,index)
|
|
this.doPlay(item,index)
|
|
|
- this.isShowPlay = true
|
|
|
|
|
|
|
+ this.setShowPlayTrue()
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -4673,7 +4673,7 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
- }, (item: VideoItem) => item.filePath)
|
|
|
|
|
|
|
+ }, (item: VideoItem) => item.filePath + '_' + this.listRefreshKey)
|
|
|
}
|
|
}
|
|
|
// .columnsTemplate('repeat(auto-fit, 160)')
|
|
// .columnsTemplate('repeat(auto-fit, 160)')
|
|
|
.id('waterflow') // 设置id用于截图
|
|
.id('waterflow') // 设置id用于截图
|
|
@@ -5111,7 +5111,7 @@ export struct LocalMusic {
|
|
|
.translate(this.dragItem === index ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
|
|
.translate(this.dragItem === index ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
|
|
|
|
|
|
|
|
|
|
|
|
|
- }, (item: VideoItem) => item.filePath)
|
|
|
|
|
|
|
+ }, (item: VideoItem) => item.filePath + '_' + this.listRefreshKey)
|
|
|
}
|
|
}
|
|
|
.width('94%')
|
|
.width('94%')
|
|
|
.height('100%')
|
|
.height('100%')
|
|
@@ -5482,7 +5482,7 @@ export struct LocalMusic {
|
|
|
.onClick(async () => {
|
|
.onClick(async () => {
|
|
|
this.longItemFilePath = ''
|
|
this.longItemFilePath = ''
|
|
|
await this.openAddToPlaylistDialog(item)
|
|
await this.openAddToPlaylistDialog(item)
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
MenuItem({
|
|
MenuItem({
|
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.square_and_pencil')),
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.square_and_pencil')),
|
|
@@ -5497,8 +5497,11 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
.visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
.visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
.onClick(async() => {
|
|
.onClick(async() => {
|
|
|
- this.setEditStrEmpty()
|
|
|
|
|
|
|
+ this.initEditFields(item)
|
|
|
this.tempLyricContent = await this.getLyricContent(item);
|
|
this.tempLyricContent = await this.getLyricContent(item);
|
|
|
|
|
+ if (StrUtil.isNotEmpty(this.tempLyricContent)) {
|
|
|
|
|
+ this.lyricConStr = this.tempLyricContent
|
|
|
|
|
+ }
|
|
|
if(this.isGridMusic||this.twoFingerType==4){
|
|
if(this.isGridMusic||this.twoFingerType==4){
|
|
|
this.longItemFilePath = item.filePath
|
|
this.longItemFilePath = item.filePath
|
|
|
}else{
|
|
}else{
|
|
@@ -5904,7 +5907,7 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
) //拖动List关键代码结束
|
|
) //拖动List关键代码结束
|
|
|
|
|
|
|
|
- }, (item: VideoItem) => item.filePath)
|
|
|
|
|
|
|
+ }, (item: VideoItem) => item.filePath + '_' + this.listRefreshKey)
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
.scrollBar(BarState.Off)
|
|
.scrollBar(BarState.Off)
|
|
@@ -6502,9 +6505,11 @@ export struct LocalMusic {
|
|
|
.height(this.bottomBarHeight)
|
|
.height(this.bottomBarHeight)
|
|
|
.hitTestBehavior(HitTestMode.Transparent)
|
|
.hitTestBehavior(HitTestMode.Transparent)
|
|
|
.bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
|
|
.bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
|
|
|
- // modalTransition: ModalTransition.DEFAULT,
|
|
|
|
|
- transition: AnimationHelper.transitionInDown(666),
|
|
|
|
|
- backgroundColor: 'rgba(0, 0, 0, 0.9)',
|
|
|
|
|
|
|
+ modalTransition: ModalTransition.NONE,
|
|
|
|
|
+ onWillDisappear: () => {
|
|
|
|
|
+ this.setShowPlayFalse()
|
|
|
|
|
+ },
|
|
|
|
|
+ // backgroundColor: 'rgba(0, 0, 0, 0.9)',
|
|
|
})
|
|
})
|
|
|
.padding({
|
|
.padding({
|
|
|
left: 16,
|
|
left: 16,
|
|
@@ -6523,7 +6528,7 @@ export struct LocalMusic {
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
- .fontColor($r('app.color.text_color'))
|
|
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
.fontWeight(500);
|
|
.fontWeight(500);
|
|
|
Row() {
|
|
Row() {
|
|
|
Text(this.currentSong?.artist)
|
|
Text(this.currentSong?.artist)
|
|
@@ -6532,23 +6537,35 @@ export struct LocalMusic {
|
|
|
.textAlign(TextAlign.Start)
|
|
.textAlign(TextAlign.Start)
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
|
- .fontColor($r('app.color.text_color'));
|
|
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
}
|
|
}
|
|
|
.visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
|
|
.visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
|
|
|
}
|
|
}
|
|
|
|
|
+ .geometryTransition('name', { follow: true }) // 绑定标识符
|
|
|
.alignItems(HorizontalAlign.Center)
|
|
.alignItems(HorizontalAlign.Center)
|
|
|
}
|
|
}
|
|
|
@Builder
|
|
@Builder
|
|
|
playConLeft(isLeft: boolean = true) {
|
|
playConLeft(isLeft: boolean = true) {
|
|
|
Row() {
|
|
Row() {
|
|
|
- RotatingCover({ songLabel: this.currentSong?.pixelMapPath });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // RotatingCover({ songLabel: this.currentSong?.pixelMapPath })
|
|
|
|
|
+ Image( this.currentSong?.pixelMapPath)
|
|
|
|
|
+ .height(45)
|
|
|
|
|
+ .objectFit(ImageFit.Contain)
|
|
|
|
|
+ .alt( $r('app.media.music_red'))
|
|
|
|
|
+ .fillColor(this.themeColor)
|
|
|
|
|
+ .borderRadius(8)
|
|
|
|
|
+ .shadow({
|
|
|
|
|
+ radius: 10,
|
|
|
|
|
+ type: ShadowType.BLUR,
|
|
|
|
|
+ color: 'on_primary'
|
|
|
|
|
+ })
|
|
|
|
|
+ .geometryTransition('cover', { follow: true }) // 绑定标识符
|
|
|
Column() {
|
|
Column() {
|
|
|
Text(this.currentSong?.name)
|
|
Text(this.currentSong?.name)
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
- .fontColor($r('app.color.text_color'))
|
|
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
.fontWeight(500);
|
|
.fontWeight(500);
|
|
|
Row() {
|
|
Row() {
|
|
|
Text(this.currentSong?.artist)
|
|
Text(this.currentSong?.artist)
|
|
@@ -6557,10 +6574,12 @@ export struct LocalMusic {
|
|
|
.textAlign(TextAlign.Start)
|
|
.textAlign(TextAlign.Start)
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE }) //超长滚动
|
|
|
- .fontColor($r('app.color.text_color'));
|
|
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
}
|
|
}
|
|
|
.visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
|
|
.visibility(this.currentSong?.artist? Visibility.Visible:Visibility.None)
|
|
|
}
|
|
}
|
|
|
|
|
+ .padding({left:8})
|
|
|
|
|
+ .geometryTransition('name', { follow: true }) // 绑定标识符
|
|
|
.alignItems(isLeft?HorizontalAlign.Start:HorizontalAlign.End)
|
|
.alignItems(isLeft?HorizontalAlign.Start:HorizontalAlign.End)
|
|
|
.margin({ right: isLeft?22:10 })
|
|
.margin({ right: isLeft?22:10 })
|
|
|
.visibility(isLeft? Visibility.Visible:Visibility.None)
|
|
.visibility(isLeft? Visibility.Visible:Visibility.None)
|
|
@@ -6572,16 +6591,32 @@ export struct LocalMusic {
|
|
|
this.showPlayerView()
|
|
this.showPlayerView()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ setShowPlayTrue(){
|
|
|
|
|
+ this.getUIContext()?.animateTo({
|
|
|
|
|
+ duration: 500,
|
|
|
|
|
+ curve: Curve.Friction
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.isShowPlay = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ setShowPlayFalse(){
|
|
|
|
|
+ this.getUIContext()?.animateTo({
|
|
|
|
|
+ duration: 500,
|
|
|
|
|
+ curve: Curve.Friction
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.isShowPlay = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
//打开播放页
|
|
//打开播放页
|
|
|
showPlayerView() {
|
|
showPlayerView() {
|
|
|
|
|
|
|
|
if (ArrayUtil.isNotEmpty(this.songList)) {
|
|
if (ArrayUtil.isNotEmpty(this.songList)) {
|
|
|
- this.isShowPlay = true;
|
|
|
|
|
|
|
+ this.setShowPlayTrue()
|
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc';
|
|
let lyricPath = this.videoUrl.substring(0, this.videoUrl.lastIndexOf('.')) + '.lrc';
|
|
|
this.initLyric(lyricPath);
|
|
this.initLyric(lyricPath);
|
|
|
this.startAutoHide();
|
|
this.startAutoHide();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
ToastUtil.showToast('当前播放列表为空,请先导入音乐。');
|
|
ToastUtil.showToast('当前播放列表为空,请先导入音乐。');
|
|
|
}
|
|
}
|
|
@@ -6589,12 +6624,14 @@ export struct LocalMusic {
|
|
|
@Builder
|
|
@Builder
|
|
|
playConRigth() {
|
|
playConRigth() {
|
|
|
Row() {
|
|
Row() {
|
|
|
- Image($r('app.media.hm_previous'))
|
|
|
|
|
- .height(28)
|
|
|
|
|
- .width(28)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.backward_end_fill'))
|
|
|
|
|
+ .fontSize(28)
|
|
|
|
|
+ .fontColor([this.themeColor])
|
|
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
|
|
+ .visibility(this.isShowPrecious? Visibility.Visible:Visibility.None)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
- .margin({ left: 8, right: 16 })
|
|
|
|
|
- .fillColor(this.themeColor)
|
|
|
|
|
|
|
+ .margin({ left: 8, right: 14 })
|
|
|
.displayPriority(2)
|
|
.displayPriority(2)
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
if (ArrayUtil.isNotEmpty(this.songList)) {
|
|
if (ArrayUtil.isNotEmpty(this.songList)) {
|
|
@@ -6613,12 +6650,11 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
.color(this.themeColor)// 进度条前景色为灰色
|
|
.color(this.themeColor)// 进度条前景色为灰色
|
|
|
- .backgroundColor($r('app.color.index_background'))
|
|
|
|
|
- .height(40)
|
|
|
|
|
|
|
+ .height(38)
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ? $r('app.media.hm_pause') : $r('app.media.hm_play2'))
|
|
Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ? $r('app.media.hm_pause') : $r('app.media.hm_play2'))
|
|
|
- .height(38)
|
|
|
|
|
- .width(38)
|
|
|
|
|
|
|
+ .height(36)
|
|
|
|
|
+ .width(36)
|
|
|
.displayPriority(3)
|
|
.displayPriority(3)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
@@ -6633,14 +6669,14 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- Image($r('app.media.hm_next'))
|
|
|
|
|
- .height(28)
|
|
|
|
|
- .width(28)
|
|
|
|
|
|
|
+ SymbolGlyph($r('sys.symbol.forward_end_fill'))
|
|
|
|
|
+ .fontSize(28)
|
|
|
|
|
+ .fontColor([this.themeColor])
|
|
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
.margin({
|
|
.margin({
|
|
|
- right: 16,
|
|
|
|
|
- left: 16
|
|
|
|
|
|
|
+ right: 14,
|
|
|
|
|
+ left: 14
|
|
|
})
|
|
})
|
|
|
- .fillColor(this.themeColor)
|
|
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
.displayPriority(2)
|
|
.displayPriority(2)
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
@@ -6653,8 +6689,8 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
Image($r('app.media.hm_playlist'))
|
|
Image($r('app.media.hm_playlist'))
|
|
|
- .height(28)
|
|
|
|
|
- .width(28)
|
|
|
|
|
|
|
+ .height(26)
|
|
|
|
|
+ .width(26)
|
|
|
.displayPriority(1)
|
|
.displayPriority(1)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.5 })
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
@@ -6732,6 +6768,19 @@ export struct LocalMusic {
|
|
|
@State discStr: string = ''
|
|
@State discStr: string = ''
|
|
|
|
|
|
|
|
doUpdateData() {
|
|
doUpdateData() {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+
|
|
|
|
|
+ if (this.modeType === 0) {
|
|
|
|
|
+ this.deleteCache(this.currentPath)
|
|
|
|
|
+ this.getSortedFiles(this.currentPath)
|
|
|
|
|
+ }else if (this.modeType === 1){
|
|
|
|
|
+ workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }, 999)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ doAllUpdateData() {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
if (this.modeType === 0) {
|
|
if (this.modeType === 0) {
|
|
@@ -6741,6 +6790,7 @@ export struct LocalMusic {
|
|
|
workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
workerInstance.postMessage({ code: 2, data: this.context,data2:this.packName });
|
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
workerInstance.postMessage({ code: 3, data: this.context });
|
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
workerInstance.postMessage({ code: 4, data: this.context });
|
|
|
|
|
+
|
|
|
}, 999)
|
|
}, 999)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -6815,45 +6865,60 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- this.table.updateMediaInfo(item.filePath, this.titleStr, this.artistStr, this.ablumStr,this.lyricConStr,
|
|
|
|
|
- this.yearStr,this.genreStr,this.trackStr,this.albumArtistStr,this.composerStr, this.lyricistStr,this.commentStr,this.discStr,
|
|
|
|
|
- (success: boolean, error?: string) => {
|
|
|
|
|
- // this.isShowEdit = false
|
|
|
|
|
|
|
|
|
|
- if (success) {
|
|
|
|
|
- console.log(" onecold 编辑信息成功,数据库已同步");
|
|
|
|
|
- ToastUtil.showToast('内嵌音乐标签成功')
|
|
|
|
|
- this.isShowMoreView = false
|
|
|
|
|
- this.name = this.titleStr
|
|
|
|
|
- if (item.filePath == this.currentSong?.filePath) {
|
|
|
|
|
- this.currentSong.name = this.titleStr
|
|
|
|
|
- this.artist = this.artistStr
|
|
|
|
|
- this.currentSong.artist = this.artistStr
|
|
|
|
|
- this.currentSong.album = this.ablumStr
|
|
|
|
|
- this.currentSong.year = this.yearStr
|
|
|
|
|
- this.currentSong.genre = this.genreStr
|
|
|
|
|
- this.currentSong.track = this.trackStr
|
|
|
|
|
- this.currentSong.lyricContent = this.lyricConStr
|
|
|
|
|
- this.initLyric(item.filePath)
|
|
|
|
|
-
|
|
|
|
|
- this.currentSong.ALBUMARTIST = this.albumArtistStr
|
|
|
|
|
- this.currentSong.COMPOSER = this.composerStr
|
|
|
|
|
- this.currentSong.LYRICIST = this.lyricistStr
|
|
|
|
|
- this.currentSong.COMMENT = this.commentStr
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const task = new taskpool.Task(
|
|
|
|
|
+ updateInfoDb,
|
|
|
|
|
+ this.context,
|
|
|
|
|
+ item.filePath,
|
|
|
|
|
+ this.titleStr,
|
|
|
|
|
+ this.artistStr,
|
|
|
|
|
+ this.ablumStr,
|
|
|
|
|
+ this.lyricConStr,
|
|
|
|
|
+ this.yearStr,this.genreStr,
|
|
|
|
|
+ this.trackStr,this.albumArtistStr,
|
|
|
|
|
+ this.composerStr, this.lyricistStr,
|
|
|
|
|
+ this.commentStr,this.discStr
|
|
|
|
|
+ );
|
|
|
|
|
+ taskpool.execute(task, taskpool.Priority.HIGH).then((result) => {
|
|
|
|
|
+ if (result) {
|
|
|
|
|
+ console.log(" onecold 编辑信息成功,数据库已同步");
|
|
|
|
|
+ ToastUtil.showToast('内嵌音乐标签成功')
|
|
|
|
|
+ this.isShowMoreView = false
|
|
|
|
|
+ this.name = this.titleStr
|
|
|
|
|
+ this.syncEditedFields(item)
|
|
|
|
|
+ if (item.filePath == this.currentSong?.filePath) {
|
|
|
|
|
+ this.currentSong.name = this.titleStr
|
|
|
|
|
+ this.artist = this.artistStr
|
|
|
|
|
+ this.currentSong.artist = this.artistStr
|
|
|
|
|
+ this.currentSong.album = this.ablumStr
|
|
|
|
|
+ this.currentSong.year = this.yearStr
|
|
|
|
|
+ this.currentSong.genre = this.genreStr
|
|
|
|
|
+ this.currentSong.track = this.trackStr
|
|
|
|
|
+ this.currentSong.lyricContent = this.lyricConStr
|
|
|
|
|
+ this.initLyric(item.filePath)
|
|
|
|
|
+
|
|
|
|
|
+ this.currentSong.ALBUMARTIST = this.albumArtistStr
|
|
|
|
|
+ this.currentSong.COMPOSER = this.composerStr
|
|
|
|
|
+ this.currentSong.LYRICIST = this.lyricistStr
|
|
|
|
|
+ this.currentSong.COMMENT = this.commentStr
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.syncListsAfterEdit(item.filePath)
|
|
|
|
|
+ this.doUpdateData()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // ToastUtil.showToast('保存失败' + error?.toString())
|
|
|
|
|
+ console.error(" onecold 编辑信息数据库失败 ");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.doUpdateData()
|
|
|
|
|
- } else {
|
|
|
|
|
- // ToastUtil.showToast('保存失败' + error?.toString())
|
|
|
|
|
- console.error(" onecold 编辑信息数据库失败原因: " + error);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }).catch((error: Error) => {
|
|
|
|
|
+ console.error('onecold Subtitle sync failed:', error);
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
- // 关闭进度条
|
|
|
|
|
- DialogHelper.closeLoading();
|
|
|
|
|
- });
|
|
|
|
|
- console.log(' onecold 元数据标签更新成功,');
|
|
|
|
|
|
|
|
|
|
|
|
+ console.log(' onecold 元数据标签更新成功,');
|
|
|
|
|
|
|
|
|
|
+ // 关闭进度条
|
|
|
|
|
+ DialogHelper.closeLoading();
|
|
|
} else {
|
|
} else {
|
|
|
// 关闭进度条
|
|
// 关闭进度条
|
|
|
DialogHelper.closeLoading();
|
|
DialogHelper.closeLoading();
|
|
@@ -7431,6 +7496,91 @@ export struct LocalMusic {
|
|
|
this.discStr = ''
|
|
this.discStr = ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ initEditFields(item?: VideoItem) {
|
|
|
|
|
+ if (!item) {
|
|
|
|
|
+ this.setEditStrEmpty()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.imagePathStr = ''
|
|
|
|
|
+ this.titleStr = item.name ?? ''
|
|
|
|
|
+ this.artistStr = item.artist ?? ''
|
|
|
|
|
+ this.ablumStr = item.album ?? ''
|
|
|
|
|
+ this.genreStr = item.genre ?? ''
|
|
|
|
|
+ this.yearStr = item.year ?? ''
|
|
|
|
|
+ this.trackStr = item.track ?? ''
|
|
|
|
|
+ this.albumArtistStr = item.ALBUMARTIST ?? ''
|
|
|
|
|
+ this.composerStr = item.COMPOSER ?? ''
|
|
|
|
|
+ this.lyricistStr = item.LYRICIST ?? ''
|
|
|
|
|
+ this.commentStr = item.COMMENT ?? ''
|
|
|
|
|
+ this.discStr = item.disc ?? ''
|
|
|
|
|
+ this.lyricConStr = item.lyricContent ?? ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private syncEditedFields(target?: VideoItem) {
|
|
|
|
|
+ if (!target) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ target.name = this.titleStr
|
|
|
|
|
+ target.artist = this.artistStr
|
|
|
|
|
+ target.album = this.ablumStr
|
|
|
|
|
+ target.lyricContent = this.lyricConStr
|
|
|
|
|
+ target.year = this.yearStr
|
|
|
|
|
+ target.genre = this.genreStr
|
|
|
|
|
+ target.track = this.trackStr
|
|
|
|
|
+ target.ALBUMARTIST = this.albumArtistStr
|
|
|
|
|
+ target.COMPOSER = this.composerStr
|
|
|
|
|
+ target.LYRICIST = this.lyricistStr
|
|
|
|
|
+ target.COMMENT = this.commentStr
|
|
|
|
|
+ target.disc = this.discStr
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private replaceItemInList(list: Array<VideoItem> | undefined, filePath: string,
|
|
|
|
|
+ apply?: (next: Array<VideoItem>) => void) {
|
|
|
|
|
+ if (!list || ArrayUtil.isEmpty(list)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const index = list.findIndex((video: VideoItem) => video.filePath === filePath)
|
|
|
|
|
+ if (index < 0) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const nextList = [...list]
|
|
|
|
|
+ this.syncEditedFields(nextList[index])
|
|
|
|
|
+ apply?.(nextList)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private syncListsAfterEdit(filePath: string) {
|
|
|
|
|
+ this.replaceItemInList(this.videoLocalList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.videoLocalList = next
|
|
|
|
|
+ this.dataSource.pushArrayData(next)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.songList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.songList = next
|
|
|
|
|
+ this.sonDataSource.pushArrayData(next)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.favList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.favList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.historyList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.historyList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.currentSongList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.currentSongList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.mediaKuList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.mediaKuList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.filteredList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.filteredList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.artistList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.artistList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.replaceItemInList(this.albumList, filePath, (next: Array<VideoItem>) => {
|
|
|
|
|
+ this.albumList = next
|
|
|
|
|
+ })
|
|
|
|
|
+ this.listRefreshKey++
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Builder
|
|
@Builder
|
|
|
detailSheet(item:VideoItem) {
|
|
detailSheet(item:VideoItem) {
|
|
|
Scroll() {
|
|
Scroll() {
|
|
@@ -8292,7 +8442,7 @@ export struct LocalMusic {
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.doPlay(item, index, true)
|
|
this.doPlay(item, index, true)
|
|
|
})
|
|
})
|
|
|
- }, (item: VideoItem) => item.filePath)
|
|
|
|
|
|
|
+ }, (item: VideoItem) => item.filePath + '_' + this.listRefreshKey)
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.height('100%')
|
|
.height('100%')
|
|
@@ -8451,6 +8601,10 @@ export struct LocalMusic {
|
|
|
Column() {
|
|
Column() {
|
|
|
this.IjkMusicPlayerView()
|
|
this.IjkMusicPlayerView()
|
|
|
}
|
|
}
|
|
|
|
|
+ .transition(TransitionEffect.asymmetric(
|
|
|
|
|
+ TransitionEffect.opacity(1),
|
|
|
|
|
+ TransitionEffect.OPACITY
|
|
|
|
|
+ ))
|
|
|
.visualEffect(deviceInfo.sdkApiVersion>=20&&this.bgController?
|
|
.visualEffect(deviceInfo.sdkApiVersion>=20&&this.bgController?
|
|
|
new hdsEffect.HdsEffectBuilder()
|
|
new hdsEffect.HdsEffectBuilder()
|
|
|
.shaderEffect({
|
|
.shaderEffect({
|
|
@@ -8479,11 +8633,21 @@ export struct LocalMusic {
|
|
|
if (event) {
|
|
if (event) {
|
|
|
// 只允许向下滑动,向上滑动时限制为0
|
|
// 只允许向下滑动,向上滑动时限制为0
|
|
|
this.translateY = Math.max(0, event.offsetY);
|
|
this.translateY = Math.max(0, event.offsetY);
|
|
|
|
|
+
|
|
|
|
|
+ this.getUIContext().animateTo({
|
|
|
|
|
+ duration: 500,
|
|
|
|
|
+ curve: Curve.Sharp
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.scaleValueImage = Math.min(1, Math.max(0.3, 1 - event.offsetY / 260));
|
|
|
|
|
+ console.info('onecold scaleValueImage:', this.scaleValueImage)
|
|
|
|
|
+
|
|
|
|
|
+ this.scaleValueText =Math.min(1, Math.max(0.6, 1 - event.offsetY / 300));
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.onActionEnd((event?: GestureEvent) => {
|
|
.onActionEnd((event?: GestureEvent) => {
|
|
|
// 使用更低的阈值和滑动速度判断
|
|
// 使用更低的阈值和滑动速度判断
|
|
|
- const minDistance = 100; // 最小滑动距离 100vp
|
|
|
|
|
|
|
+ const minDistance = 300; // 最小滑动距离 100vp
|
|
|
const minVelocity = 500; // 最小滑动速度
|
|
const minVelocity = 500; // 最小滑动速度
|
|
|
|
|
|
|
|
// 获取滑动速度(如果可用)
|
|
// 获取滑动速度(如果可用)
|
|
@@ -8495,18 +8659,22 @@ export struct LocalMusic {
|
|
|
if (shouldClose) {
|
|
if (shouldClose) {
|
|
|
// 添加关闭动画
|
|
// 添加关闭动画
|
|
|
this.getUIContext().animateTo({
|
|
this.getUIContext().animateTo({
|
|
|
- duration: 300,
|
|
|
|
|
- curve: Curve.Smooth
|
|
|
|
|
|
|
+ duration: 600,
|
|
|
|
|
+ curve: Curve.Friction
|
|
|
}, () => {
|
|
}, () => {
|
|
|
this.isShowPlay = false;
|
|
this.isShowPlay = false;
|
|
|
|
|
+ this.scaleValueImage = 1
|
|
|
|
|
+ this.scaleValueText = 1
|
|
|
this.translateY = 0;
|
|
this.translateY = 0;
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
// 回弹动画
|
|
// 回弹动画
|
|
|
this.getUIContext().animateTo({
|
|
this.getUIContext().animateTo({
|
|
|
- duration: 300,
|
|
|
|
|
- curve: Curve.Smooth
|
|
|
|
|
|
|
+ duration: 600,
|
|
|
|
|
+ curve: Curve.Friction
|
|
|
}, () => {
|
|
}, () => {
|
|
|
|
|
+ this.scaleValueImage = 1
|
|
|
|
|
+ this.scaleValueText = 1
|
|
|
this.translateY = 0;
|
|
this.translateY = 0;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -9815,8 +9983,11 @@ export struct LocalMusic {
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
.backgroundColor(Color.Transparent)
|
|
.backgroundColor(Color.Transparent)
|
|
|
.onClick(async () => {
|
|
.onClick(async () => {
|
|
|
- this.setEditStrEmpty()
|
|
|
|
|
|
|
+ this.initEditFields(this.currentSong)
|
|
|
this.tempLyricContent = this.lyricContent
|
|
this.tempLyricContent = this.lyricContent
|
|
|
|
|
+ if (StrUtil.isNotEmpty(this.tempLyricContent)) {
|
|
|
|
|
+ this.lyricConStr = this.tempLyricContent
|
|
|
|
|
+ }
|
|
|
this.isShowEdit = !this.isShowEdit;
|
|
this.isShowEdit = !this.isShowEdit;
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -10058,6 +10229,7 @@ export struct LocalMusic {
|
|
|
@State isCoverTop: boolean = true
|
|
@State isCoverTop: boolean = true
|
|
|
// 添加控制缩放的状态变量
|
|
// 添加控制缩放的状态变量
|
|
|
@State scaleValueImage: number = 1
|
|
@State scaleValueImage: number = 1
|
|
|
|
|
+ @State scaleValueText: number = 1
|
|
|
@Builder
|
|
@Builder
|
|
|
CoverInfo() {
|
|
CoverInfo() {
|
|
|
Column() {
|
|
Column() {
|
|
@@ -10100,20 +10272,24 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
|
- if (this.isCoverTop && !this.isCoverOpacity() && this.isCoverRectangle) {
|
|
|
|
|
|
|
+ if (this.isCoverTop && this.isCoverRectangle) {
|
|
|
Image(this.cover)
|
|
Image(this.cover)
|
|
|
- .height(this.isHiCar()?(px2vp(this.windowHeight)*0.46):'auto')
|
|
|
|
|
- .width(this.isHiCar()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
|
|
|
|
|
|
|
+ .height(this.isHiCar()?(px2vp(this.windowHeight)*0.46):
|
|
|
|
|
+ this.isCoverOpacity()?(px2vp(this.windowHeight)*0.6):'auto')
|
|
|
|
|
+ .width(this.isHiCar()||this.isCoverOpacity()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
|
|
|
.objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
.objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
.alt($r('app.media.alt'))
|
|
.alt($r('app.media.alt'))
|
|
|
.margin({ right: 8, left: 8, top: 8 })
|
|
.margin({ right: 8, left: 8, top: 8 })
|
|
|
.aspectRatio(1)
|
|
.aspectRatio(1)
|
|
|
|
|
+ .geometryTransition('cover') // 绑定标识符
|
|
|
.opacity(this.opacityValueImage)
|
|
.opacity(this.opacityValueImage)
|
|
|
- .scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
|
|
|
|
|
+ .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
|
|
+ // 设置左下角为缩放中心点
|
|
|
|
|
+ centerX: '0%',
|
|
|
|
|
+ centerY: '100%' })
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
- .align(Alignment.Center)//
|
|
|
|
|
.clip(true)
|
|
.clip(true)
|
|
|
.rotate({
|
|
.rotate({
|
|
|
x: 0,
|
|
x: 0,
|
|
@@ -10165,10 +10341,14 @@ export struct LocalMusic {
|
|
|
(this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 162))
|
|
(this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 162))
|
|
|
.objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
.objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
.alt($r('app.media.alt'))
|
|
.alt($r('app.media.alt'))
|
|
|
|
|
+ .geometryTransition('cover') // 绑定标识符
|
|
|
.margin({ right: 20, left: 20,top:this.isCoverRectangle||this.isLandscape?0:43 })
|
|
.margin({ right: 20, left: 20,top:this.isCoverRectangle||this.isLandscape?0:43 })
|
|
|
.aspectRatio(1)
|
|
.aspectRatio(1)
|
|
|
.opacity(this.opacityValueImage)
|
|
.opacity(this.opacityValueImage)
|
|
|
- .scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
|
|
|
|
|
+ .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
|
|
+ // 设置左下角为缩放中心点
|
|
|
|
|
+ centerX: '0%',
|
|
|
|
|
+ centerY: '100%' })
|
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
@@ -10188,24 +10368,26 @@ export struct LocalMusic {
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
- if (this.isPhoneLan()) {
|
|
|
|
|
- Text(this.name)
|
|
|
|
|
- .fontSize(18)
|
|
|
|
|
- .fontWeight(FontWeight.Bold)
|
|
|
|
|
- .margin({ top: 13 })
|
|
|
|
|
- .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
|
|
- .maxLines(1)
|
|
|
|
|
- .width('99%')
|
|
|
|
|
- .textAlign(TextAlign.Center)
|
|
|
|
|
- .fontColor(Color.White)
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.isPhoneLan()) {
|
|
|
|
|
+ Text(this.name)
|
|
|
|
|
+ .fontSize(18)
|
|
|
|
|
+ .fontWeight(FontWeight.Bold)
|
|
|
|
|
+ .margin({ top: 13 })
|
|
|
|
|
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
|
|
+ .maxLines(1)
|
|
|
|
|
+ .width('99%')
|
|
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
|
|
+ .fontColor(Color.White)
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
// 唱针以左上角为点选择逆时针40度
|
|
// 唱针以左上角为点选择逆时针40度
|
|
|
Image($r('app.media.ic_music_cover_hand'))
|
|
Image($r('app.media.ic_music_cover_hand'))
|
|
|
.height(130)
|
|
.height(130)
|
|
@@ -10234,6 +10416,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.justifyContent(FlexAlign.Start)
|
|
.justifyContent(FlexAlign.Start)
|
|
|
.zIndex(1)
|
|
.zIndex(1)
|
|
|
|
|
+ .geometryTransition('name')
|
|
|
.visibility(this.isCoverOpacity() ? Visibility.Visible : Visibility.None)
|
|
.visibility(this.isCoverOpacity() ? Visibility.Visible : Visibility.None)
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -10288,9 +10471,9 @@ export struct LocalMusic {
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
}
|
|
}
|
|
|
.zIndex(1)
|
|
.zIndex(1)
|
|
|
|
|
+ .geometryTransition('name') // 绑定标识符
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
.margin({ left: 15 })
|
|
.margin({ left: 15 })
|
|
|
- .scale({ x: this.scaleValueImage, y: this.scaleValueImage }) // 添加缩放效果
|
|
|
|
|
Blank()
|
|
Blank()
|
|
|
Row(){
|
|
Row(){
|
|
|
|
|
|
|
@@ -10321,6 +10504,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.width('90%')
|
|
.width('90%')
|
|
|
|
|
+ .scale({ x: this.scaleValueText, y: this.scaleValueText }) // 添加缩放效果
|
|
|
.margin({ top: this.isCoverOpacity() ? 10 : isHidden ? 20 : 10 })
|
|
.margin({ top: this.isCoverOpacity() ? 10 : isHidden ? 20 : 10 })
|
|
|
.visibility(this.isCoverOpacity() || isHidden ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isCoverOpacity() || isHidden ? Visibility.None : Visibility.Visible)
|
|
|
}
|
|
}
|
|
@@ -10348,8 +10532,7 @@ export struct LocalMusic {
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
.visibility(this.isHide ? Visibility.Hidden : Visibility.Visible)
|
|
.visibility(this.isHide ? Visibility.Hidden : Visibility.Visible)
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
-
|
|
|
|
|
- this.isShowPlay = false;
|
|
|
|
|
|
|
+ this.setShowPlayFalse()
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -11829,8 +12012,11 @@ export struct LocalMusic {
|
|
|
this.isShowMoreView = false
|
|
this.isShowMoreView = false
|
|
|
break;
|
|
break;
|
|
|
case 15: //编辑标签
|
|
case 15: //编辑标签
|
|
|
- this.setEditStrEmpty()
|
|
|
|
|
|
|
+ this.initEditFields(this.currentSong)
|
|
|
this.tempLyricContent = this.lyricContent
|
|
this.tempLyricContent = this.lyricContent
|
|
|
|
|
+ if (StrUtil.isNotEmpty(this.tempLyricContent)) {
|
|
|
|
|
+ this.lyricConStr = this.tempLyricContent
|
|
|
|
|
+ }
|
|
|
this.isShowEdit = !this.isShowEdit;
|
|
this.isShowEdit = !this.isShowEdit;
|
|
|
break;
|
|
break;
|
|
|
case 16: //悬浮歌词
|
|
case 16: //悬浮歌词
|
|
@@ -14599,3 +14785,42 @@ async function scanCurrentDirectoryTask(context: Context, dirPath: string, lockP
|
|
|
console.error(' 扫描当前目录失败:', error);
|
|
console.error(' 扫描当前目录失败:', error);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+//内嵌标签后更新库
|
|
|
|
|
+@Concurrent
|
|
|
|
|
+async function updateInfoDb(
|
|
|
|
|
+ context: Context,
|
|
|
|
|
+ filePath: string,
|
|
|
|
|
+ titleStr: string,
|
|
|
|
|
+ artistStr: string,
|
|
|
|
|
+ albumStr: string,
|
|
|
|
|
+ lyricConStr: string,
|
|
|
|
|
+ yearStr: string,
|
|
|
|
|
+ genreStr: string,
|
|
|
|
|
+ trackStr: string,
|
|
|
|
|
+ albumArtistStr: string,
|
|
|
|
|
+ composerStr: string,
|
|
|
|
|
+ lyricistStr: string,
|
|
|
|
|
+ commentStr: string,
|
|
|
|
|
+ discStr: string,
|
|
|
|
|
+): Promise<boolean> {
|
|
|
|
|
+ const table: MediaTable = new MediaTable(context);
|
|
|
|
|
+ await new Promise<void>((resolve, reject) => {
|
|
|
|
|
+ table.getRdbStore(context, (err:Error) => {
|
|
|
|
|
+ err ? reject(err) : resolve();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return await new Promise<boolean>((resolve) => {
|
|
|
|
|
+ table.updateMediaInfo(filePath, titleStr, artistStr, albumStr, lyricConStr,
|
|
|
|
|
+ yearStr, genreStr, trackStr, albumArtistStr, composerStr, lyricistStr, commentStr, discStr,
|
|
|
|
|
+ (success: boolean, error?: string) => {
|
|
|
|
|
+ if (success) {
|
|
|
|
|
+ console.log("onecold 编辑信息成功,数据库已同步");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error("onecold 编辑信息数据库失败原因: " + error);
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve(success);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|