|
@@ -190,6 +190,7 @@ export struct LocalMusic {
|
|
|
@State isShowSingleLineLyric: boolean = false //是否显示播放页返回键
|
|
@State isShowSingleLineLyric: boolean = false //是否显示播放页返回键
|
|
|
@State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
@State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
|
@State isCoverTopBig: boolean = false //顶部大封面部分手机显示会和播放控制页重叠
|
|
@State isCoverTopBig: boolean = false //顶部大封面部分手机显示会和播放控制页重叠
|
|
|
|
|
+ @State isSwipe: boolean = false //listItem的左滑开关
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@State isDarkMode: boolean = false
|
|
@State isDarkMode: boolean = false
|
|
|
@State lyricTextWeight: number = 400
|
|
@State lyricTextWeight: number = 400
|
|
@@ -604,6 +605,7 @@ export struct LocalMusic {
|
|
|
this.isPlayListBgGrass = PreferencesUtil.getBooleanSync(SettingPage.IS_PLAYLIST_BG_GRASS, true)
|
|
this.isPlayListBgGrass = PreferencesUtil.getBooleanSync(SettingPage.IS_PLAYLIST_BG_GRASS, true)
|
|
|
this.isShowHeader = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_HEADER, true)
|
|
this.isShowHeader = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_HEADER, true)
|
|
|
this.volume = PreferencesUtil.getNumberSync('DefalutVolume', this.volume)
|
|
this.volume = PreferencesUtil.getNumberSync('DefalutVolume', this.volume)
|
|
|
|
|
+ this.isSwipe = PreferencesUtil.getBooleanSync(SettingPage.IS_SWIPE, true)
|
|
|
//如果是hicar连接状态,这些都是false
|
|
//如果是hicar连接状态,这些都是false
|
|
|
if(this.isHiCarStatus){
|
|
if(this.isHiCarStatus){
|
|
|
this.isShowTitleBar = false//不显示导航栏
|
|
this.isShowTitleBar = false//不显示导航栏
|
|
@@ -2557,6 +2559,40 @@ export struct LocalMusic {
|
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
|
$r('app.color.text_color'))
|
|
$r('app.color.text_color'))
|
|
|
.margin({ left: this.twoFingerType == 3 ? 6 : 8 })
|
|
.margin({ left: this.twoFingerType == 3 ? 6 : 8 })
|
|
|
|
|
+ .bindPopup(this.longItemFilePath === item.filePath, {
|
|
|
|
|
+ builder: this.MenuBuilder(item,index,item.filePath),
|
|
|
|
|
+ placement: Placement.Top,
|
|
|
|
|
+ // autoCancel: true,
|
|
|
|
|
+ mask: {color:'#33000000'},
|
|
|
|
|
+ // popupColor: Color.Yellow,
|
|
|
|
|
+ enableArrow: false,//是否显示箭头
|
|
|
|
|
+ showInSubWindow: false,
|
|
|
|
|
+ onStateChange: (e) => {
|
|
|
|
|
+ if (!e.isVisible) {
|
|
|
|
|
+ this.longItemFilePath = ''
|
|
|
|
|
+ this.tempLyricContent = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ .gesture(LongPressGesture()
|
|
|
|
|
+ .onAction(async () => {
|
|
|
|
|
+ //如果是专辑和艺术家的首页,不能长按
|
|
|
|
|
+ if((this.modeType===2||this.modeType==3)&&!this.isCanBack)
|
|
|
|
|
+ return
|
|
|
|
|
+ //如果是我的收藏 最近播放等也不能长按
|
|
|
|
|
+ if(item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
|
|
+ item.name === LocalMusic.STR_HISTORY_MUSIC
|
|
|
|
|
+ )
|
|
|
|
|
+ return
|
|
|
|
|
+ this.longItemFilePath = item.filePath
|
|
|
|
|
+ this.tempLyricContent = await this.getLyricContent(item)
|
|
|
|
|
+ LogUtil.info('长按this.tempLyricContent = '+this.tempLyricContent)
|
|
|
|
|
+ })
|
|
|
|
|
+ .onActionEnd((event: GestureEvent) => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
Row() {
|
|
Row() {
|
|
|
Text(StrUtil.isEmpty(item.artist) ? item.cTime : item.artist + ' ' + item?.album)
|
|
Text(StrUtil.isEmpty(item.artist) ? item.cTime : item.artist + ' ' + item?.album)
|
|
|
.fontSize(this.twoFingerType == 1 ? 11 : this.twoFingerType == 2 ? 12 : 14)
|
|
.fontSize(this.twoFingerType == 1 ? 11 : this.twoFingerType == 2 ? 12 : 14)
|
|
@@ -2573,6 +2609,24 @@ export struct LocalMusic {
|
|
|
$r('app.color.text_color'))
|
|
$r('app.color.text_color'))
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
}
|
|
}
|
|
|
|
|
+ .gesture(LongPressGesture()
|
|
|
|
|
+ .onAction(async () => {
|
|
|
|
|
+ //如果是专辑和艺术家的首页,不能长按
|
|
|
|
|
+ if((this.modeType===2||this.modeType==3)&&!this.isCanBack)
|
|
|
|
|
+ return
|
|
|
|
|
+ //如果是我的收藏 最近播放等也不能长按
|
|
|
|
|
+ if(item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
|
|
+ item.name === LocalMusic.STR_HISTORY_MUSIC
|
|
|
|
|
+ )
|
|
|
|
|
+ return
|
|
|
|
|
+ this.longItemFilePath = item.filePath
|
|
|
|
|
+ this.tempLyricContent = await this.getLyricContent(item)
|
|
|
|
|
+ LogUtil.info('长按this.tempLyricContent = '+this.tempLyricContent)
|
|
|
|
|
+ })
|
|
|
|
|
+ .onActionEnd((event: GestureEvent) => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.height('100%')
|
|
.height('100%')
|
|
@@ -3693,7 +3747,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
return wightG
|
|
return wightG
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ @State isShowDetail:boolean = false
|
|
|
@Builder
|
|
@Builder
|
|
|
MenuBuilder(item: VideoItem, index: number, filePath: string) {
|
|
MenuBuilder(item: VideoItem, index: number, filePath: string) {
|
|
|
Scroll() {
|
|
Scroll() {
|
|
@@ -3761,6 +3815,25 @@ export struct LocalMusic {
|
|
|
this.showWarnIsDeleteFile(item, index + '', filePath)
|
|
this.showWarnIsDeleteFile(item, index + '', filePath)
|
|
|
this.longItemFilePath = ''
|
|
this.longItemFilePath = ''
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ MenuItem({
|
|
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.info_circle')),
|
|
|
|
|
+ content: $r('app.string.detail')
|
|
|
|
|
+ })
|
|
|
|
|
+ .bindSheet($$this.isShowDetail, this.detailSheet(item), {
|
|
|
|
|
+ height:this.isCoverOpacity()?'95%': '66%',
|
|
|
|
|
+ dragBar: true,
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ blurStyle:BlurStyle.Thin,
|
|
|
|
|
+ preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
|
|
+ backgroundColor:Color.Transparent,
|
|
|
|
|
+ title: { title: '详情信息' }
|
|
|
|
|
+ })
|
|
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.isShowDetail = !this.isShowDetail
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
MenuItem({
|
|
MenuItem({
|
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.share')),
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.share')),
|
|
|
content: $r('app.string.share')
|
|
content: $r('app.string.share')
|
|
@@ -3845,7 +3918,7 @@ export struct LocalMusic {
|
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT })
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT })
|
|
|
.swipeAction((
|
|
.swipeAction((
|
|
|
- (this.modeType == 0 || this.modeType == 1 || ((this.modeType == 3 || this.modeType == 2) && this.isCanBack))
|
|
|
|
|
|
|
+ (this.isSwipe&&this.modeType == 0 || this.modeType == 1 || ((this.modeType == 3 || this.modeType == 2) && this.isCanBack))
|
|
|
&& item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
&& item.type !== CommonConstants.TYPE_IS_CSJAD &&
|
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
!this.isHistory) ? { end: this.DeleteButton(item, index, item.filePath) } : {}) //左滑
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
@@ -4820,10 +4893,10 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
- detailSheet() {
|
|
|
|
|
|
|
+ detailSheet(item:VideoItem) {
|
|
|
Scroll() {
|
|
Scroll() {
|
|
|
Column() {
|
|
Column() {
|
|
|
- this.songDetail()
|
|
|
|
|
|
|
+ this.songDetail(item)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
@@ -4831,14 +4904,14 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
- songDetail() {
|
|
|
|
|
|
|
+ songDetail(currentItem:VideoItem) {
|
|
|
Column() {
|
|
Column() {
|
|
|
- if (this.currentSong) {
|
|
|
|
|
|
|
+ if (currentItem) {
|
|
|
Row() {
|
|
Row() {
|
|
|
Stack() {
|
|
Stack() {
|
|
|
|
|
|
|
|
- Image(StrUtil.isEmpty(this.currentSong.pixelMapPath) ? $r('app.media.music_red') :
|
|
|
|
|
- this.currentSong.pixelMapPath)
|
|
|
|
|
|
|
+ Image(StrUtil.isEmpty(currentItem.pixelMapPath) ? $r('app.media.music_red') :
|
|
|
|
|
+ currentItem.pixelMapPath)
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
|
.height(33)
|
|
.height(33)
|
|
|
.width(33)
|
|
.width(33)
|
|
@@ -4851,7 +4924,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
Column() {
|
|
Column() {
|
|
|
Column() {
|
|
Column() {
|
|
|
- Text(this.currentSong.name)
|
|
|
|
|
|
|
+ Text(currentItem.name)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.maxLines(1)
|
|
.maxLines(1)
|
|
|
.animation({
|
|
.animation({
|
|
@@ -4862,8 +4935,8 @@ export struct LocalMusic {
|
|
|
.fontColor($r('app.color.text_color'))
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
Row() {
|
|
Row() {
|
|
|
- Text(StrUtil.isEmpty(this.currentSong.artist) ? this.currentSong.cTime :
|
|
|
|
|
- this.currentSong.artist + ' ' + this.currentSong?.album)
|
|
|
|
|
|
|
+ Text(StrUtil.isEmpty(currentItem.artist) ? currentItem.cTime :
|
|
|
|
|
+ currentItem.artist + ' ' + currentItem?.album)
|
|
|
.fontSize(11)
|
|
.fontSize(11)
|
|
|
.padding({ top: 8 })
|
|
.padding({ top: 8 })
|
|
|
.fontColor($r('app.color.text_color'))
|
|
.fontColor($r('app.color.text_color'))
|
|
@@ -4891,7 +4964,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong?.artist ? this.currentSong.artist : '未知歌手')
|
|
|
|
|
|
|
+ Text(currentItem?.artist ? currentItem.artist : '未知歌手')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
@@ -4908,7 +4981,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong?.album ? this.currentSong.album : '未知专辑')
|
|
|
|
|
|
|
+ Text(currentItem?.album ?currentItem.album : '未知专辑')
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4923,7 +4996,8 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.totalTime)
|
|
|
|
|
|
|
+ Text(StrUtil.isEmpty(currentItem.duration)?
|
|
|
|
|
+ (this.isShowDetailMore?this.totalTime:'未知'):currentItem.duration)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4938,7 +5012,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(Utility.convertToKHz(this.currentSong.sampleRate))
|
|
|
|
|
|
|
+ Text(Utility.convertToKHz(currentItem.sampleRate))
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4953,7 +5027,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong.trackCount)
|
|
|
|
|
|
|
+ Text(StrUtil.isEmpty(currentItem.trackCount)?'1':currentItem.trackCount)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4968,7 +5042,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(Utility.formatMimeType(this.currentSong.mimeType))
|
|
|
|
|
|
|
+ Text(Utility.formatMimeType(currentItem.mimeType))
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4983,7 +5057,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong.size)
|
|
|
|
|
|
|
+ Text(currentItem.size)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -4998,7 +5072,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong.fileName)
|
|
|
|
|
|
|
+ Text(currentItem.fileName)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -5013,7 +5087,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong.cTime)
|
|
|
|
|
|
|
+ Text(currentItem.cTime)
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -5028,7 +5102,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
.fontSize(14)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
.margin({ left: 22 })
|
|
.margin({ left: 22 })
|
|
|
- Text(this.currentSong.filePath)
|
|
|
|
|
|
|
+ Text(currentItem.filePath)
|
|
|
.fontSize(12)
|
|
.fontSize(12)
|
|
|
.margin({ left: 10 })
|
|
.margin({ left: 10 })
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
@@ -8174,7 +8248,7 @@ export struct LocalMusic {
|
|
|
ForEach(this.moreItems, (more: MoreItem, index: number) => {
|
|
ForEach(this.moreItems, (more: MoreItem, index: number) => {
|
|
|
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
Row() {
|
|
Row() {
|
|
|
- if (more.id === 3) {
|
|
|
|
|
|
|
+ if (more.id === 3&&this.currentSong) {
|
|
|
Image(more.image)
|
|
Image(more.image)
|
|
|
.width(24)
|
|
.width(24)
|
|
|
.height(24)
|
|
.height(24)
|
|
@@ -8182,7 +8256,7 @@ export struct LocalMusic {
|
|
|
Text(more.title)
|
|
Text(more.title)
|
|
|
.fontSize(16)
|
|
.fontSize(16)
|
|
|
.fontColor(Color.White)
|
|
.fontColor(Color.White)
|
|
|
- .bindSheet($$this.isShowDetailMore, this.detailSheet(), {
|
|
|
|
|
|
|
+ .bindSheet($$this.isShowDetailMore, this.detailSheet(this.currentSong), {
|
|
|
height: this.isCoverOpacity() ? '95%' : '75%',
|
|
height: this.isCoverOpacity() ? '95%' : '75%',
|
|
|
dragBar: true,
|
|
dragBar: true,
|
|
|
preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|