|
|
@@ -2890,8 +2890,28 @@ export struct LocalMusic {
|
|
|
.alt($r('app.media.music_red'))
|
|
|
.borderRadius('100%')
|
|
|
.clip(true)
|
|
|
+ .draggable(false)
|
|
|
+ .interpolation(ImageInterpolation.Medium)// 用于重采样后的抗锯齿
|
|
|
+ .autoResize(true) // 重采样,可减少内存占用
|
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
|
.margin({ left: 20 })
|
|
|
+ .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) => {
|
|
|
+
|
|
|
+ }))
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -3773,6 +3793,16 @@ export struct LocalMusic {
|
|
|
this.MusicItemGrid(item, index)
|
|
|
}
|
|
|
}
|
|
|
+ .bindContextMenu(this.MenuBuilder(item, index, item.filePath), ResponseType.LongPress,
|
|
|
+ {
|
|
|
+ preview: MenuPreviewMode.IMAGE,
|
|
|
+ previewAnimationOptions: { scale: [0.8, 1.0] },
|
|
|
+ })
|
|
|
+ .bindContextMenu(this.MenuBuilder(item, index, item.filePath), ResponseType.RightClick,
|
|
|
+ {
|
|
|
+ preview: MenuPreviewMode.IMAGE,
|
|
|
+ previewAnimationOptions: { scale: [0.8, 1.0] },
|
|
|
+ })
|
|
|
.transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.8, y: 0.8 }).animation({ duration: 500 }),
|
|
|
TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT })
|
|
|
@@ -3781,66 +3811,66 @@ export struct LocalMusic {
|
|
|
.translate(this.dragItem === index ? { x: this.offsetX, y: this.offsetY } : { x: 0, y: 0 })
|
|
|
.hitTestBehavior(this.isDraggable(this.videoLocalList.indexOf(item)) ? HitTestMode.Default : HitTestMode.None)
|
|
|
//长按拖动代码
|
|
|
- .gesture(
|
|
|
- GestureGroup(GestureMode.Sequence,
|
|
|
- LongPressGesture({ repeat: true })
|
|
|
- .onAction(() => {
|
|
|
- this.getUIContext().animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
- this.scaleItem = index;
|
|
|
- })
|
|
|
- })
|
|
|
- .onActionEnd(() => {
|
|
|
- this.getUIContext().animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
- this.scaleItem = -1;
|
|
|
- })
|
|
|
- }),
|
|
|
- PanGesture({ fingers: 1, direction: null, distance: 0 })
|
|
|
- .onActionStart(() => {
|
|
|
- this.dragItem = index;
|
|
|
- this.dragRefOffSetX = 0;
|
|
|
- this.dragRefOffSetY = 0;
|
|
|
- })
|
|
|
- .onActionUpdate((event: GestureEvent) => {
|
|
|
- this.offsetX = event.offsetX - this.dragRefOffSetX;
|
|
|
- this.offsetY = event.offsetY - this.dragRefOffSetY;
|
|
|
- this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- let index = this.videoLocalList.indexOf(item);
|
|
|
- if (this.offsetY >= this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)) {
|
|
|
- this.down(index);
|
|
|
- } else if (this.offsetY <= -this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)) {
|
|
|
- this.up(index);
|
|
|
- } else if (this.offsetX >= this.FIX_VP_X / 2 && (this.offsetY <= 50 && this.offsetY >= -50)) {
|
|
|
- this.right(index);
|
|
|
- } else if (this.offsetX <= -this.FIX_VP_Y / 2 && (this.offsetY <= 50 && this.offsetY >= -50)) {
|
|
|
- this.left(index);
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- // if (this.offsetY > this.FIX_VP_Y * 0.7) {
|
|
|
- // this.scroller.scrollToIndex(index + 10, true,ScrollAlign.CENTER);
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
- .onActionEnd(() => {
|
|
|
- this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.dragItem = -1;
|
|
|
- })
|
|
|
- this.getUIContext().animateTo({ curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150 }, () => {
|
|
|
- this.scaleItem = -1;
|
|
|
- })
|
|
|
- })
|
|
|
- )
|
|
|
- .onCancel(() => {
|
|
|
- this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.dragItem = -1;
|
|
|
- })
|
|
|
- this.getUIContext().animateTo({ curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150 }, () => {
|
|
|
- this.scaleItem = -1;
|
|
|
- })
|
|
|
- })
|
|
|
- )
|
|
|
+ // .gesture(
|
|
|
+ // GestureGroup(GestureMode.Sequence,
|
|
|
+ // LongPressGesture({ repeat: true })
|
|
|
+ // .onAction(() => {
|
|
|
+ // this.getUIContext().animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
+ // this.scaleItem = index;
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // .onActionEnd(() => {
|
|
|
+ // this.getUIContext().animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
+ // this.scaleItem = -1;
|
|
|
+ // })
|
|
|
+ // }),
|
|
|
+ // PanGesture({ fingers: 1, direction: null, distance: 0 })
|
|
|
+ // .onActionStart(() => {
|
|
|
+ // this.dragItem = index;
|
|
|
+ // this.dragRefOffSetX = 0;
|
|
|
+ // this.dragRefOffSetY = 0;
|
|
|
+ // })
|
|
|
+ // .onActionUpdate((event: GestureEvent) => {
|
|
|
+ // this.offsetX = event.offsetX - this.dragRefOffSetX;
|
|
|
+ // this.offsetY = event.offsetY - this.dragRefOffSetY;
|
|
|
+ // this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
+ // let index = this.videoLocalList.indexOf(item);
|
|
|
+ // if (this.offsetY >= this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)) {
|
|
|
+ // this.down(index);
|
|
|
+ // } else if (this.offsetY <= -this.FIX_VP_Y / 2 && (this.offsetX <= 44 && this.offsetX >= -44)) {
|
|
|
+ // this.up(index);
|
|
|
+ // } else if (this.offsetX >= this.FIX_VP_X / 2 && (this.offsetY <= 50 && this.offsetY >= -50)) {
|
|
|
+ // this.right(index);
|
|
|
+ // } else if (this.offsetX <= -this.FIX_VP_Y / 2 && (this.offsetY <= 50 && this.offsetY >= -50)) {
|
|
|
+ // this.left(index);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // if (this.offsetY > this.FIX_VP_Y * 0.7) {
|
|
|
+ // // this.scroller.scrollToIndex(index + 10, true,ScrollAlign.CENTER);
|
|
|
+ // // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ // .onActionEnd(() => {
|
|
|
+ // this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
+ // this.dragItem = -1;
|
|
|
+ // })
|
|
|
+ // this.getUIContext().animateTo({ curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150 }, () => {
|
|
|
+ // this.scaleItem = -1;
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // )
|
|
|
+ // .onCancel(() => {
|
|
|
+ // this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
+ // this.dragItem = -1;
|
|
|
+ // })
|
|
|
+ // this.getUIContext().animateTo({ curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150 }, () => {
|
|
|
+ // this.scaleItem = -1;
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // )
|
|
|
|
|
|
// [End gesture_start]
|
|
|
// [EndExclude GridItem_start]
|
|
|
@@ -3975,6 +4005,9 @@ export struct LocalMusic {
|
|
|
Image(StrUtil.isEmpty(item.pixelMapPath) ? Utility.getMusisBg2(index) : item.pixelMapPath)
|
|
|
.height(this.getGridHeight())
|
|
|
.width(this.getGridWight())
|
|
|
+ .draggable(false)
|
|
|
+ .interpolation(ImageInterpolation.Medium)// 用于重采样后的抗锯齿
|
|
|
+ .autoResize(true) // 重采样,可减少内存占用
|
|
|
.alt($r('app.media.ic_avatar2'))
|
|
|
.clip(true)
|
|
|
.borderRadius({
|
|
|
@@ -3983,6 +4016,17 @@ export struct LocalMusic {
|
|
|
bottomLeft: 0,
|
|
|
bottomRight: 0
|
|
|
})
|
|
|
+ .bindSheet(this.longItemFilePath== item.filePath, this.editSheet(item), {
|
|
|
+ height: this.isCoverOpacity() ? '95%' : '88%',
|
|
|
+ dragBar: true,
|
|
|
+ onDisappear: () => {
|
|
|
+ this.longItemFilePath = '';
|
|
|
+ this.tempLyricContent = ''
|
|
|
+ },
|
|
|
+ showClose: true,
|
|
|
+ preferType: SheetType.CENTER ,
|
|
|
+ title: { title: '编辑信息' }
|
|
|
+ })
|
|
|
.draggable(false)
|
|
|
.opacity(this.opacityItem)// 绑定透明度
|
|
|
// .transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
@@ -4005,6 +4049,18 @@ export struct LocalMusic {
|
|
|
duration: 555,
|
|
|
curve: 'Linear',
|
|
|
})
|
|
|
+ .bindSheet(this.longItemFilePathDetail== item.filePath, this.detailSheet(item), {
|
|
|
+ height: '95%',
|
|
|
+ dragBar: true,
|
|
|
+ showClose: true,
|
|
|
+ onDisappear: () => {
|
|
|
+ this.longItemFilePathDetail = '';
|
|
|
+ },
|
|
|
+ blurStyle:BlurStyle.Thin,
|
|
|
+ backgroundColor:Color.Transparent,
|
|
|
+ preferType: SheetType.CENTER ,
|
|
|
+ title: { title: '详情' }
|
|
|
+ })
|
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
|
$r('app.color.text_color'))
|
|
|
|
|
|
@@ -4054,42 +4110,43 @@ export struct LocalMusic {
|
|
|
.alignItems(HorizontalAlign.Center) // 关键:使内容水平居中
|
|
|
|
|
|
}
|
|
|
- .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) => {
|
|
|
-
|
|
|
- })
|
|
|
- )
|
|
|
+ // .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) => {
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ // )
|
|
|
.height(this.twoFingerType == 3 ? 60 : this.twoFingerType == 2 ? 55 : 42)
|
|
|
.width(this.getGridWight())
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
@@ -4101,7 +4158,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.width(this.getGridWight())
|
|
|
.borderRadius(12)
|
|
|
- .backgroundImage(item.pixelMapPath)
|
|
|
+ .backgroundImage(StrUtil.isEmpty(item.pixelMapPath)?Utility.getMusisBg2(index):item.pixelMapPath)
|
|
|
.backgroundImageSize({ height: '100%', width: '100%' })
|
|
|
.backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
|
|
|
.animation({ curve: Curve.Sharp, duration: 300 })
|
|
|
@@ -4187,108 +4244,141 @@ export struct LocalMusic {
|
|
|
return wightG
|
|
|
}
|
|
|
@State isShowDetail:boolean = false
|
|
|
+ // @State isShowDetailGrid:boolean = false
|
|
|
+ // @State isShowEditGrid:boolean = false
|
|
|
+ @State longItemFilePathDetail:string =''
|
|
|
@Builder
|
|
|
MenuBuilder(item: VideoItem, index: number, filePath: string) {
|
|
|
- Scroll() {
|
|
|
- Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
|
|
- Menu() {
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier(Utility.getIsFav(this.favList, item) ?
|
|
|
- $r('sys.symbol.heart_fill') : $r('sys.symbol.heart')),
|
|
|
+ if(
|
|
|
+ ((this.modeType===2||this.modeType==3)&&!this.isCanBack)
|
|
|
+ ||(item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
+ item.name === LocalMusic.STR_HISTORY_MUSIC)
|
|
|
+ ){
|
|
|
+ //如果是专辑和艺术家的首页,不能长按
|
|
|
+ //如果是我的收藏 最近播放等也不能长按
|
|
|
+ }else{
|
|
|
|
|
|
- content: Utility.getIsFav(this.favList, item) ? '取消收藏' : '收藏'
|
|
|
- })
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- if (item) {
|
|
|
- this.doFav(item)
|
|
|
- }
|
|
|
- this.longItemFilePath = ''
|
|
|
+ Scroll() {
|
|
|
+ Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
|
|
+ Menu() {
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier(Utility.getIsFav(this.favList, item) ?
|
|
|
+ $r('sys.symbol.heart_fill') : $r('sys.symbol.heart')),
|
|
|
|
|
|
+ content: Utility.getIsFav(this.favList, item) ? '取消收藏' : '收藏'
|
|
|
})
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.forward_end_fill')),
|
|
|
- content: '下一首播放'
|
|
|
- })
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- this.addToNextPlay(item);
|
|
|
- this.longItemFilePath = ''
|
|
|
- })
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
+ .onClick(() => {
|
|
|
+ if (item) {
|
|
|
+ this.doFav(item)
|
|
|
+ }
|
|
|
+ this.longItemFilePath = ''
|
|
|
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.square_and_pencil')),
|
|
|
- content: '编辑信息'
|
|
|
- })
|
|
|
- .bindSheet($$this.isShowEdit, this.editSheet(item), {
|
|
|
- height: this.isCoverOpacity() ? '95%' : '88%',
|
|
|
- dragBar: true,
|
|
|
- showClose: true,
|
|
|
- preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
- title: { title: '编辑信息' }
|
|
|
+ })
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.forward_end_fill')),
|
|
|
+ content: '下一首播放'
|
|
|
})
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- this.isShowEdit = !this.isShowEdit;
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
+ .onClick(() => {
|
|
|
+ this.addToNextPlay(item);
|
|
|
+ this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.square_and_pencil')),
|
|
|
+ content: '编辑信息'
|
|
|
})
|
|
|
+ .bindSheet($$this.isShowEdit, this.editSheet(item), {
|
|
|
+ height: this.isCoverOpacity() ? '95%' : '88%',
|
|
|
+ dragBar: true,
|
|
|
+ showClose: true,
|
|
|
+ preferType: SheetType.CENTER ,
|
|
|
+ title: { title: '编辑信息' }
|
|
|
+ })
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
+ .onClick(async() => {
|
|
|
+ this.tempLyricContent = await this.getLyricContent(item);
|
|
|
+ // console.info('onecold 长按this.tempLyricContent' +this.tempLyricContent)
|
|
|
+ if(this.isGridMusic){
|
|
|
+ this.longItemFilePath = item.filePath
|
|
|
+ }else{
|
|
|
+ this.isShowEdit = !this.isShowEdit;
|
|
|
+ }
|
|
|
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.rename')),
|
|
|
- content: $r('app.string.rename')
|
|
|
- })
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ?
|
|
|
- (item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
- item.name === LocalMusic.STR_HISTORY_MUSIC ? Visibility.None : Visibility.Visible) : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- this.showReNameDialog(item, index + '', filePath)
|
|
|
- this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.checkmark_square_on_square')),
|
|
|
+ content: $r('app.string.select_all')
|
|
|
})
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.trash')),
|
|
|
- content: $r('app.string.delete')
|
|
|
- })
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ?
|
|
|
- (item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
- item.name === LocalMusic.STR_HISTORY_MUSIC ? Visibility.None : Visibility.Visible) : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- this.showWarnIsDeleteFile(item, index + '', filePath)
|
|
|
- this.longItemFilePath = ''
|
|
|
+ .onClick(() => {
|
|
|
+ this.isMultiSelect = !this.isMultiSelect
|
|
|
+ this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.rename')),
|
|
|
+ content: $r('app.string.rename')
|
|
|
})
|
|
|
-
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.info_circle')),
|
|
|
- content: $r('app.string.detail')
|
|
|
- })
|
|
|
- .bindSheet($$this.isShowDetail, this.detailSheet(item), {
|
|
|
- height:this.isCoverOpacity()?'95%': '95%',
|
|
|
- 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 ?
|
|
|
+ (item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
+ item.name === LocalMusic.STR_HISTORY_MUSIC ? Visibility.None : Visibility.Visible) : Visibility.Visible)
|
|
|
+ .onClick(() => {
|
|
|
+ this.showReNameDialog(item, index + '', filePath)
|
|
|
+ this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.trash')),
|
|
|
+ content: $r('app.string.delete')
|
|
|
})
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- this.isShowDetail = !this.isShowDetail
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ?
|
|
|
+ (item.name === LocalMusic.STR_LOCK_VIDEO || item.name === LocalMusic.STR_FAC_VIDEO ||
|
|
|
+ item.name === LocalMusic.STR_HISTORY_MUSIC ? Visibility.None : Visibility.Visible) : Visibility.Visible)
|
|
|
+ .onClick(() => {
|
|
|
+ this.showWarnIsDeleteFile(item, index + '', filePath)
|
|
|
+ this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.info_circle')),
|
|
|
+ content: $r('app.string.detail')
|
|
|
})
|
|
|
+ .bindSheet($$this.isShowDetail, this.detailSheet(item), {
|
|
|
+ height:'95%',
|
|
|
+ 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(() => {
|
|
|
+ if(this.isGridMusic){
|
|
|
+ this.longItemFilePathDetail = item.filePath
|
|
|
+ }else{
|
|
|
+ this.isShowDetail = !this.isShowDetail
|
|
|
+ }
|
|
|
|
|
|
- MenuItem({
|
|
|
- symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.share')),
|
|
|
- content: $r('app.string.share')
|
|
|
- })
|
|
|
- .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
- .onClick(() => {
|
|
|
- Utility.doShareMusic(item, getContext(this) as common.UIAbilityContext)
|
|
|
- this.longItemFilePath = ''
|
|
|
+ })
|
|
|
+
|
|
|
+ MenuItem({
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.share')),
|
|
|
+ content: $r('app.string.share')
|
|
|
})
|
|
|
+ .visibility(item.type === CommonConstants.TYPE_IS_DIR ? Visibility.None : Visibility.Visible)
|
|
|
+ .onClick(() => {
|
|
|
+ Utility.doShareMusic(item, getContext(this) as common.UIAbilityContext)
|
|
|
+ this.longItemFilePath = ''
|
|
|
+ })
|
|
|
|
|
|
+ }
|
|
|
+ .font({ size: 15, weight: FontWeight.Normal })
|
|
|
}
|
|
|
- .font({ size: 15, weight: FontWeight.Normal })
|
|
|
+ .width(180)
|
|
|
}
|
|
|
- .width(180)
|
|
|
+ .height('auto')
|
|
|
}
|
|
|
- .height(item.type === CommonConstants.TYPE_IS_DIR ? 150 : 400)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private listMaxScrollOffsetY: number = 0
|
|
|
@@ -5100,7 +5190,12 @@ export struct LocalMusic {
|
|
|
|
|
|
this.table.updateMediaInfo(item.filePath, this.titleStr, this.artistStr, this.ablumStr,
|
|
|
(success: boolean, error?: string) => {
|
|
|
- this.isShowEdit = false
|
|
|
+ // this.isShowEdit = false
|
|
|
+ if(this.isGridMusic){
|
|
|
+ this.longItemFilePath =''
|
|
|
+ }else{
|
|
|
+ this.isShowEdit = false
|
|
|
+ }
|
|
|
if (success) {
|
|
|
console.log(" onecold 编辑信息成功,数据库已同步");
|
|
|
ToastUtil.showToast('保存成功')
|
|
|
@@ -5350,7 +5445,6 @@ export struct LocalMusic {
|
|
|
.margin({ right: 20, bottom: 20 })
|
|
|
.onClick(async () => {
|
|
|
this.doEdit(item)
|
|
|
-
|
|
|
})
|
|
|
|
|
|
Button('取消')
|
|
|
@@ -5362,7 +5456,12 @@ export struct LocalMusic {
|
|
|
.stateEffect(true)
|
|
|
.margin({ left: 20, bottom: 20 })
|
|
|
.onClick(async () => {
|
|
|
- this.isShowEdit = false
|
|
|
+
|
|
|
+ if(this.isGridMusic){
|
|
|
+ this.longItemFilePath =''
|
|
|
+ }else{
|
|
|
+ this.isShowEdit = false
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
.margin({
|
|
|
@@ -5450,11 +5549,11 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('歌手名:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem?.artist ? currentItem.artist : '未知歌手')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 10 })
|
|
|
.layoutWeight(1)
|
|
|
|
|
|
@@ -5467,12 +5566,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('专辑名:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem?.album ?currentItem.album : '未知专辑')
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5482,13 +5581,13 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('时长:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(StrUtil.isEmpty(currentItem.duration)?
|
|
|
(this.isShowDetailMore?this.totalTime:'未知'):currentItem.duration)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5498,12 +5597,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('采样率:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(Utility.convertToKHz(currentItem.sampleRate))
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5513,12 +5612,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('比特率:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.bit_rate)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5528,12 +5627,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('风格:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.genre)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5543,12 +5642,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('发行时间:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.year)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5558,12 +5657,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('质量评分:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.probe_score+"")
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5573,12 +5672,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('音轨号:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.track)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5589,12 +5688,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('格式:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(Utility.formatMimeType(currentItem.mimeType))
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5604,12 +5703,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('播放次数:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.playCount?.toString())
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5621,12 +5720,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('流数量:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.nb_streams?.toString())
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5636,12 +5735,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('文件大小:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.size)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5651,12 +5750,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('文件名:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.fileName)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5666,12 +5765,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('修改时间:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.cTime)
|
|
|
.fontSize(14)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5681,12 +5780,12 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Text('存放目录:')
|
|
|
.fontSize(14)
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
Text(currentItem.filePath)
|
|
|
.fontSize(12)
|
|
|
.margin({ left: 10 })
|
|
|
- .fontColor(Color.White)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
.layoutWeight(1)
|
|
|
}
|
|
|
.margin({ top: 10, bottom: 10 })
|
|
|
@@ -6996,6 +7095,12 @@ export struct LocalMusic {
|
|
|
|
|
|
//根据item返回歌词内容
|
|
|
async getLyricContent(item: VideoItem): Promise<string> {
|
|
|
+ let neiqianLrc = ''
|
|
|
+ let lyContent = item?.lyricContent
|
|
|
+ if(lyContent&&StrUtil.isNotEmpty(lyContent)){//取数据库里面的歌词lyContent
|
|
|
+ neiqianLrc = lyContent
|
|
|
+ return neiqianLrc
|
|
|
+ }
|
|
|
try {
|
|
|
let filePath = item.filePath;
|
|
|
let lyricPath = filePath.substring(0, filePath.lastIndexOf('.')) + '.lrc';
|
|
|
@@ -7377,10 +7482,8 @@ export struct LocalMusic {
|
|
|
(this.isPuraWP() ? 58 : 99)
|
|
|
})
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
- .height(this.isCoverOpacity() ? '95%' : '80%')
|
|
|
-
|
|
|
+ .height(this.isCoverOpacity() ? this.isPhoneLan()?'95%':'90%' : '82%')
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Builder
|
|
|
@@ -7405,69 +7508,67 @@ export struct LocalMusic {
|
|
|
@Builder
|
|
|
BottomControl() {
|
|
|
Column() {
|
|
|
+ this.TopPlayProgressView()
|
|
|
//播放 暂停,下一首,上一首
|
|
|
this.playCenterView()
|
|
|
-
|
|
|
-
|
|
|
//播放进度条
|
|
|
- this.playProgressView()
|
|
|
-
|
|
|
-
|
|
|
+ this.BottomView()
|
|
|
}
|
|
|
- .position({ bottom: this.isHiCarSmall()?50:(this.isCoverOpacity() ? 55 : 100) }) // 将 固定在底部
|
|
|
+ .position({ bottom: this.isHiCarSmall()?50:(this.isCoverOpacity() ? 55 : 70) }) // 将 固定在底部
|
|
|
|
|
|
}
|
|
|
|
|
|
//播放控制上一首 下一首 暂停和播放
|
|
|
@Builder
|
|
|
- playCenterView() {
|
|
|
+ playCenterView(){
|
|
|
Row() {
|
|
|
Row({ space: 20 }) {
|
|
|
|
|
|
|
|
|
- Button({ type: ButtonType.Circle, stateEffect: true }) {
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
//更多功能
|
|
|
Image($r('app.media.menu'))
|
|
|
.width(24)
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE })
|
|
|
+ .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
.bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
|
|
|
height: this.isCoverOpacity() ? '95%' : '93%',
|
|
|
- preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
+ preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
|
|
|
dragBar: true,
|
|
|
showClose: true,
|
|
|
blurStyle: BlurStyle.Thin,
|
|
|
backgroundColor: Color.Transparent,
|
|
|
})
|
|
|
}
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .margin({ left: 5 })
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.onClick(() => {
|
|
|
this.isShowMoreView = !this.isShowMoreView;
|
|
|
})
|
|
|
|
|
|
- Button({ type: ButtonType.Circle, stateEffect: true }) {
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
Image($r('app.media.ic_previous'))
|
|
|
.width(33)
|
|
|
- .clickEffect({ level: ClickEffectLevel.HEAVY })
|
|
|
+ .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
}
|
|
|
.onClick(async () => {
|
|
|
this.playPrevious()
|
|
|
})
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.margin({ left: 5 })
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
- Button({ type: ButtonType.Circle, stateEffect: true }) {
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
Column() {
|
|
|
Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
|
|
|
- (this.isCircleBtn ? $r('app.media.hm_pause') : $r('app.media.ic_public_play'))
|
|
|
- : (this.isCircleBtn ? $r('app.media.hm_play2') : $r('app.media.ic_public_pause')))
|
|
|
- .width(this.isPhoneLan() ? 48 : 60)
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ (this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
|
|
|
+ : (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
|
|
|
+ .width(this.isPhoneLan()?45:55)
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.fillColor(Color.White)
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
.onClick(async () => {
|
|
|
@@ -7480,14 +7581,14 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.layoutWeight(1)
|
|
|
- .margin({ left: 38, right: 38 })
|
|
|
+ // .margin({ left: 38, right: 38 })
|
|
|
|
|
|
|
|
|
Row({ space: 20 }) {
|
|
|
Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
Image($r('app.media.ic_next'))
|
|
|
.width(33)
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
.onClick(() => {
|
|
|
|
|
|
@@ -7499,16 +7600,16 @@ export struct LocalMusic {
|
|
|
.margin({ right: 5 })
|
|
|
.width(33)
|
|
|
|
|
|
- Button({ type: ButtonType.Circle, stateEffect: true }) {
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
//添加或取消收藏
|
|
|
- Image(Utility.getIsFav(this.favList, this.currentSong) ?
|
|
|
- $r('app.media.add_fac_light') : $r('app.media.add_fac'))
|
|
|
+ Image(Utility.getIsFav(this.favList,this.currentSong)?
|
|
|
+ $r('app.media.add_fac_light'):$r('app.media.add_fac'))
|
|
|
.width(24)
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE })
|
|
|
+ .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
.aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
.onClick(async () => {
|
|
|
- if (this.currentSong) {
|
|
|
+ if(this.currentSong){
|
|
|
this.doFav(this.currentSong)
|
|
|
}
|
|
|
})
|
|
|
@@ -7517,17 +7618,198 @@ export struct LocalMusic {
|
|
|
.width(24)
|
|
|
|
|
|
}
|
|
|
-
|
|
|
// .margin({ left: 5 })
|
|
|
|
|
|
}
|
|
|
- .width('100%')
|
|
|
- .margin({ left: 10, right: 10, bottom: this.isCoverOpacity() ? 0 : 20 })
|
|
|
+ .width('95%')
|
|
|
+ .margin({ bottom:this.isCoverOpacity()?0:20 })
|
|
|
+ .justifyContent(FlexAlign.SpaceEvenly)
|
|
|
+ }
|
|
|
+
|
|
|
+ //播放进度条
|
|
|
+ @Builder
|
|
|
+ TopPlayProgressView(){
|
|
|
+ Row() {
|
|
|
+ Column(){
|
|
|
+ Row(){
|
|
|
+ Slider({
|
|
|
+ value: this.progressValue,
|
|
|
+ min: 0,
|
|
|
+ max: this.PROGRESS_MAX_VALUE,
|
|
|
+ step: 1,
|
|
|
+ style: SliderStyle.InSet
|
|
|
+ })
|
|
|
+ .blockColor('rgba(255,255,255,1)')
|
|
|
+ .trackColor('rgba(255,255,255,0.3)')
|
|
|
+ .selectedColor(Color.White)
|
|
|
+ .trackThickness(4)
|
|
|
+ .layoutWeight(1)
|
|
|
+ .showSteps(false)
|
|
|
+ .showTips(true)
|
|
|
+ .enabled(this.slideEnable)
|
|
|
+ .onChange((value: number, mode: SliderChangeMode) => {
|
|
|
+ // if (mode == 2) {
|
|
|
+ this.isSeekTo = true;
|
|
|
+ this.mDestroyPage = false;
|
|
|
+ this.showLoadIng();
|
|
|
+ LogUtils.getInstance().LOGI("slider-->seekValue start:" + value);
|
|
|
+ let seekValue = value * ((this.unifiedPlayerService.getIjkPlayer() as IjkMediaPlayer)?.getDuration() / 100);
|
|
|
+ this.seekTo(seekValue + "");
|
|
|
+ // this.setProgress()
|
|
|
+ LogUtils.getInstance().LOGI("slider-->seekValue end:" + seekValue);
|
|
|
+ this.isSeekTo = false;
|
|
|
+ // }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ .padding({ right: 7,left:28 })
|
|
|
+ Row(){
|
|
|
+ Text(this.currentTime)
|
|
|
+ .fontSize(10)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ Blank()
|
|
|
+ .layoutWeight(1)
|
|
|
+ Text(this.totalTime)
|
|
|
+ .fontSize(10)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ }
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ .padding({ right: 18,left:35 })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ //x5的竖屏模式需要99%
|
|
|
+ .width(this.isLandscape?'80%':'93%')
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
+ .margin({bottom:5})
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out' // 可选动画曲线
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
//播放进度条
|
|
|
@Builder
|
|
|
+ BottomView(){
|
|
|
+ Row() {
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ Column() {
|
|
|
+ if (this.playType === 0) {
|
|
|
+ Image($r('app.media.loop'))
|
|
|
+ .width(27)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ } else if (this.playType === 1) {
|
|
|
+ Image($r('app.media.single'))
|
|
|
+ .width(27)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ } else if (this.playType === 2) {
|
|
|
+ Image($r('app.media.normal_play'))
|
|
|
+ .width(27)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ } else if (this.playType === 3) {
|
|
|
+ Image($r('app.media.random'))
|
|
|
+ .width(27)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .layoutWeight(1)
|
|
|
+ .margin({ left: 5 })
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
+ .onClick(async () => {
|
|
|
+ this.setLoopMode()
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ Column() {
|
|
|
+ Image($r('app.media.full_4'))
|
|
|
+ .width(25)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .layoutWeight(1)
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
+ .onClick(async () => {
|
|
|
+ if (this.isLandscape) {
|
|
|
+ this.setOrientation(window.Orientation.USER_ROTATION_PORTRAIT);
|
|
|
+ } else {
|
|
|
+ this.setOrientation(window.Orientation.USER_ROTATION_LANDSCAPE);
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ Column() {
|
|
|
+ Image($r('app.media.lyric'))
|
|
|
+ .width(26)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .layoutWeight(1)
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
+ .onClick(async () => {
|
|
|
+ this.isLyricSetting = !this.isLyricSetting;
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ //播放列表
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ Image($r('app.media.hm_playlist'))
|
|
|
+ .width(24)
|
|
|
+ .fillColor(Color.White)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ .bindSheet($$this.isShowSheetView, this.PlayListSheet(), {
|
|
|
+ height: '95%',
|
|
|
+ dragBar: true,
|
|
|
+ showClose: true,
|
|
|
+ preferType: this.currentBreakpoint !== BreakpointTypeEnum.SM ? SheetType.CENTER : SheetType.BOTTOM,
|
|
|
+ blurStyle: BlurStyle.Thin,
|
|
|
+ backgroundColor: this.isPlayListBgGrass?Color.Transparent:$r('app.color.silvery'),
|
|
|
+ title: {
|
|
|
+ title: Utility.resourceToString(this.context, $r('app.string.current_play_list'))
|
|
|
+ + `(${this.songList.length}首)`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .layoutWeight(1)
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .clickEffect({level:ClickEffectLevel.LIGHT, scale: 0.5})
|
|
|
+ .onClick(() => {
|
|
|
+ this.isShowSheetView = !this.isShowSheetView;
|
|
|
+ if(this.isPlayListBgGrass){
|
|
|
+ this.isFrontWhite = true
|
|
|
+ }else{
|
|
|
+ this.isFrontWhite = false
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.playListScroller.scrollToIndex(this.curIndex,true, ScrollAlign.CENTER)
|
|
|
+ }, 123)
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ .width(this.isLandscape?'88%':'95%')
|
|
|
+ .justifyContent(FlexAlign.SpaceAround)
|
|
|
+ .height(30)
|
|
|
+ .margin({top:3})
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out' // 可选动画曲线
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //旧版本播放进度条
|
|
|
+ @Builder
|
|
|
playProgressView() {
|
|
|
Row() {
|
|
|
Button({ type: ButtonType.Circle, stateEffect: true }) {
|