Sfoglia il codice sorgente

优化播放器背景在切换歌曲时闪烁的问题

chendeben 11 mesi fa
parent
commit
133dc44d12
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      entry/src/main/ets/view/LocalMusic.ets

+ 6 - 6
entry/src/main/ets/view/LocalMusic.ets

@@ -12558,7 +12558,7 @@ export struct LocalMusic {
       duration: 300,
       duration: 300,
       curve: Curve.EaseOut
       curve: Curve.EaseOut
     }, () => {
     }, () => {
-      this.backgroundOpacity = 0.3;
+      this.backgroundOpacity = 0.7;
     });
     });
 
 
     // 第二步:延迟后更新背景并淡入
     // 第二步:延迟后更新背景并淡入
@@ -12630,10 +12630,10 @@ export struct LocalMusic {
 
 
     // 第一步:淡出当前背景
     // 第一步:淡出当前背景
     this.getUIContext()?.animateTo({
     this.getUIContext()?.animateTo({
-      duration: 300,
+      duration: 200,
       curve: Curve.EaseOut
       curve: Curve.EaseOut
     }, () => {
     }, () => {
-      this.backgroundOpacity = 0.3;
+      this.backgroundOpacity = 0.7;
     });
     });
 
 
     // 第二步:延迟后更新背景并淡入
     // 第二步:延迟后更新背景并淡入
@@ -12643,13 +12643,13 @@ export struct LocalMusic {
       // 第三步:淡入新背景
       // 第三步:淡入新背景
       setTimeout(() => {
       setTimeout(() => {
         this.getUIContext()?.animateTo({
         this.getUIContext()?.animateTo({
-          duration: 400,
+          duration: 300,
           curve: Curve.EaseIn
           curve: Curve.EaseIn
         }, () => {
         }, () => {
           this.backgroundOpacity = 1.0;
           this.backgroundOpacity = 1.0;
         });
         });
-      }, 100);
-    }, 350);
+      }, 50);
+    }, 250);
   }
   }
 
 
   // 存储已播放的歌曲索引
   // 存储已播放的歌曲索引