Kaynağa Gözat

切换封面动画效果完成后才能播

onecold 1 yıl önce
ebeveyn
işleme
dd04a1acd0

+ 3 - 0
entry/src/main/ets/pages/SettingPage.ets

@@ -56,6 +56,7 @@ export struct SettingPage {
   public static IS_PLAYLIST_BG_GRASS: string = 'isPlayListBgGrass';
   static readonly IS_SWIPE: string = 'isSwipe'
   static readonly IS_AUTO_HIDE_PROGRESS: string = 'IS_AUTO_HIDE_PROGRESS';
+  public static OPEN_SKIPSONG_ANIMATE: string = 'openSkipSongAnimate';
 
   public static THEME_COLOR_LIST: Array<ThemeColorItem> = [
     { name: '玫瑰粉', color: '#FF4081', isVip: false },
@@ -114,6 +115,7 @@ export struct SettingPage {
   @State isSwipe: boolean = false //listItem的左滑开关
   @State isPlayListBgGrass: boolean = true//是否播放列表玻璃透明效果
   @State is_auto_hide_progress: boolean = false
+  @State openSkipSongAnimate: boolean = true//切歌动画效果
 
 
   @State customizeBgPath: string | undefined = '';
@@ -235,6 +237,7 @@ export struct SettingPage {
     this.isPlayListBgGrass = PreferencesUtil.getBooleanSync(SettingPage.IS_PLAYLIST_BG_GRASS, true)
     this.isSwipe = PreferencesUtil.getBooleanSync(SettingPage.IS_SWIPE, true)
     this.is_auto_hide_progress = PreferencesUtil.getBooleanSync(SettingPage.IS_AUTO_HIDE_PROGRESS, false)
+    this.openSkipSongAnimate = PreferencesUtil.getBooleanSync(SettingPage.OPEN_SKIPSONG_ANIMATE, true)
     // 只用 themeMode 控制主题
     this.themeMode = PreferencesUtil.getNumberSync(SettingPage.THEME_MODE, 0)
     this.applyThemeMode(this.themeMode)

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

@@ -10430,12 +10430,10 @@ export struct LocalMusic {
       this.stop();
       this.currentSong = this.songList[this.curIndex]
       this.videoUrl = this.songList[this.curIndex].filePath;
-
-      //this.cover = this.songList[this.curIndex].pixelMapPath
-      this.changeImageAnimation()
       this.artist = this.songList[this.curIndex].artist
       this.name = this.songList[this.curIndex].name
-      this.startPlayOrResumePlay()
+      //this.cover = this.songList[this.curIndex].pixelMapPath
+      this.changeImageAnimation()
 
     }
 
@@ -10447,7 +10445,7 @@ export struct LocalMusic {
       duration: 500,
       curve: Curve.EaseOut,
     }, () => {
-      this.opacityValueImage = 0.3;
+      this.opacityValueImage = 0.1;
       if(this.isCoverRectangle){
         this.scaleValueImage = 0.88
       }
@@ -10463,6 +10461,7 @@ export struct LocalMusic {
       }, () => {
         this.opacityValueImage = 1;
         this.scaleValueImage = 1 // 图标恢复到原始大小
+        this.startPlayOrResumePlay()
       });
     }, 500);
   }
@@ -10514,10 +10513,9 @@ export struct LocalMusic {
       this.currentSong = this.songList[this.curIndex];
       this.videoUrl = this.songList[this.curIndex].filePath;
       this.name = this.songList[this.curIndex].name;
+      this.artist = this.songList[this.curIndex].artist
       // this.cover = this.songList[this.curIndex].pixelMapPath
       this.changeImageAnimation()
-      this.artist = this.songList[this.curIndex].artist
-      this.startPlayOrResumePlay();
     }
   }
 
@@ -10532,10 +10530,9 @@ export struct LocalMusic {
       this.currentSong = this.songList[this.curIndex]
       this.videoUrl = this.songList[index].filePath;
       this.name = this.songList[index].name
-      this.changeImageAnimation()
       this.artist = this.songList[this.curIndex].artist
       this.curIndex = index;
-      this.startPlayOrResumePlay()
+      this.changeImageAnimation()
     }
 
   }
@@ -10561,10 +10558,8 @@ export struct LocalMusic {
     this.currentSong = this.songList[this.curIndex]
     this.videoUrl = this.songList[this.curIndex].filePath;
     this.name = this.songList[this.curIndex].name
-    this.changeImageAnimation()
-    // this.cover = this.songList[this.curIndex].pixelMapPath
     this.artist = this.songList[this.curIndex].artist
-    this.startPlayOrResumePlay()
+    this.changeImageAnimation()
   }
 
   //随机播放模式下点击上一首: 上一首应该应该播放历史记录的第二首
@@ -10592,12 +10587,9 @@ export struct LocalMusic {
       this.stop();
       this.currentSong = this.songList[this.curIndex];
       this.videoUrl = this.songList[this.curIndex].filePath;
-      this.changeImageAnimation()
-      // this.cover = this.songList[this.curIndex].pixelMapPath
       this.artist = this.songList[this.curIndex].artist
       this.name = this.songList[this.curIndex].name;
-
-      this.startPlayOrResumePlay();
+      this.changeImageAnimation()
     }
   }