Ver Fonte

点击右下角的播放列表 滚动到当前播放歌曲的位置

onecold há 1 ano atrás
pai
commit
bc4e7dc1f1
1 ficheiros alterados com 8 adições e 3 exclusões
  1. 8 3
      entry/src/main/ets/view/LocalMusic.ets

+ 8 - 3
entry/src/main/ets/view/LocalMusic.ets

@@ -3813,7 +3813,7 @@ export struct LocalMusic {
         }
         break;
       case CommonConstants.TYPE_IS_ARTIST:
-        // 进入专辑前安全保存当前滚动偏移量,支持列表和网格
+        // 进入艺术家前安全保存当前滚动偏移量,支持列表和网格
         let offsetA = 0
         if (this.isGridMusic) {
           if (this.scroller && typeof this.scroller.currentOffset === 'function') {
@@ -4038,7 +4038,10 @@ export struct LocalMusic {
                 this.isShowSheet = !this.isShowSheet;
                 this.isFrontWhite = false
                 LogUtil.info('onecold scrollToIndex = '+this.curIndex)
-                this.playListScroller.scrollToIndex(this.curIndex,true, ScrollAlign.CENTER)
+                setTimeout(() => {
+                  this.playListScroller.scrollToIndex(this.curIndex,true, ScrollAlign.CENTER)
+                }, 123)
+
               } else {
                 ToastUtil.showToast('当前播放列表为空,请先导入音乐。')
               }
@@ -6203,7 +6206,9 @@ export struct LocalMusic {
       .onClick(() => {
         this.isShowSheetView = !this.isShowSheetView;
         this.isFrontWhite = true
-        // this.listScroller.scrollToIndex(this.curIndex)
+        setTimeout(() => {
+          this.playListScroller.scrollToIndex(this.curIndex,true, ScrollAlign.CENTER)
+        }, 123)
       })
 
     }