|
|
@@ -4819,23 +4819,6 @@ export struct LocalMusic {
|
|
|
type: ShadowType.BLUR,
|
|
|
color: 'on_primary'
|
|
|
})
|
|
|
- .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) => {
|
|
|
-
|
|
|
- }))
|
|
|
.onClick(()=>{
|
|
|
if (this.isMultiSelect) {
|
|
|
const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
@@ -4879,24 +4862,6 @@ export struct LocalMusic {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- .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() {
|
|
|
Column(){
|
|
|
Text(item.md5Str?.includes('Lossless')?
|
|
|
@@ -4934,24 +4899,6 @@ export struct LocalMusic {
|
|
|
Color.Gray)
|
|
|
.margin({ left: StrUtil.isEmpty(item.artist) ?0: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%')
|
|
|
@@ -4997,6 +4944,23 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ .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) => {
|
|
|
+
|
|
|
+ }))
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.width('100%')
|
|
|
.reuseId('file_item')
|
|
|
@@ -6314,93 +6278,6 @@ export struct LocalMusic {
|
|
|
|
|
|
})
|
|
|
|
|
|
- //拖动List关键代码开始
|
|
|
- .scale({ x: this.scaleSelect(index), y: this.scaleSelect(index) })
|
|
|
- .zIndex(this.dragItem === index ? 1 : 0)
|
|
|
- .translate(this.dragItem === index ? { y: this.offsetY } : { y: 0 })
|
|
|
- .gesture(
|
|
|
- GestureGroup(GestureMode.Sequence,
|
|
|
- LongPressGesture({ repeat: true })
|
|
|
- .onAction((event?: GestureEvent) => {
|
|
|
- animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
- this.scaleItem = index
|
|
|
- })
|
|
|
- })
|
|
|
- .onActionEnd(() => {
|
|
|
- animateTo({ curve: Curve.Friction, duration: 300 }, () => {
|
|
|
- this.scaleItem = -1
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- }),
|
|
|
- PanGesture({ fingers: 1, direction: null, distance: 0 })
|
|
|
- .onActionStart(() => {
|
|
|
- this.dragItem = index // 记录当前拖动项索引
|
|
|
- this.dragRefOffset = 0 // 重置偏移基准
|
|
|
- })
|
|
|
- .onActionUpdate((event: GestureEvent) => {
|
|
|
- this.offsetY = event.offsetY - this.dragRefOffset;
|
|
|
- this.neighborItem = -1;
|
|
|
- let indexA = this.videoLocalList.indexOf(item);
|
|
|
- // LogUtil.info('onecold indexA = '+indexA +' index=='+index)
|
|
|
- let curveValue: curves.ICurve = curves.initCurve(Curve.Sharp);
|
|
|
- let value: number = 0;
|
|
|
-
|
|
|
- if (this.offsetY < 0) {
|
|
|
- value = curveValue.interpolate(-this.offsetY / this.ITEM_INTV);
|
|
|
- this.neighborItem = indexA - 1;
|
|
|
- this.neighborScale = 1 - value / 20;
|
|
|
- } else if (this.offsetY > 0) {
|
|
|
- value = curveValue.interpolate(this.offsetY / this.ITEM_INTV);
|
|
|
- this.neighborItem = indexA + 1;
|
|
|
- this.neighborScale = 1 - value / 20;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (this.offsetY > this.ITEM_INTV / 2 && indexA + 1 < this.videoLocalList.length) {
|
|
|
- animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.offsetY -= this.ITEM_INTV;
|
|
|
- this.dragRefOffset += this.ITEM_INTV;
|
|
|
- this.itemMove(indexA, indexA + 1);
|
|
|
- });
|
|
|
- } else if (this.offsetY < -this.ITEM_INTV / 2 && indexA - 1 >= 0) {
|
|
|
- animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.offsetY += this.ITEM_INTV;
|
|
|
- this.dragRefOffset -= this.ITEM_INTV;
|
|
|
- this.itemMove(indexA, indexA - 1);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
- .onActionEnd((event: GestureEvent) => {
|
|
|
- animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.dragItem = -1
|
|
|
- this.neighborItem = -1
|
|
|
- })
|
|
|
- animateTo({
|
|
|
- curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150
|
|
|
- }, () => {
|
|
|
- this.scaleItem = -1
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
- )
|
|
|
- .onCancel(() => {
|
|
|
- animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
|
|
|
- this.dragItem = -1
|
|
|
- this.neighborItem = -1
|
|
|
- })
|
|
|
- animateTo({
|
|
|
- curve: curves.interpolatingSpring(14, 1, 170, 17), delay: 150
|
|
|
- }, () => {
|
|
|
- this.scaleItem = -1
|
|
|
- })
|
|
|
- })
|
|
|
- ) //拖动List关键代码结束
|
|
|
-
|
|
|
}, (item: VideoItem) => item.filePath + '_' + this.listRefreshKey)
|
|
|
|
|
|
// 加载中指示器
|