Explorar o código

修复歌词可以上下阴影

onecold hai 8 meses
pai
achega
a5c4419551
Modificáronse 2 ficheiros con 11 adicións e 11 borrados
  1. 8 11
      entry/src/main/ets/view/LocalMusic.ets
  2. 3 0
      lib/src/main/ets/view/LyricView2.ets

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

@@ -1174,7 +1174,7 @@ export struct LocalMusic {
           this.listScroller.scrollTo({ xOffset: 0, yOffset: lastOffset })
         }
       }
-    }, 300)
+    }, 100)
 
 
     this.currentPath = Utility.getParentDirectory(this.currentPath)
@@ -6772,10 +6772,7 @@ export struct LocalMusic {
         this.prevOffsetY = currentOffsetY;
       }
 
-      //滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
-      // if (this.isPhoneLan()) {
-      //   this.setBarHeightHide(offset)
-      // } else
+
       if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
         (this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
           this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
@@ -6946,12 +6943,12 @@ export struct LocalMusic {
           setTimeout(() => {
             this.waterScroller.scrollEdge(Edge.Top)
             this.scroller.scrollEdge(Edge.Top)
-          }, 380)
+          }, 200)
         }else{
           if (this.isGridMusic) {
-            this.scroller.scrollEdge(Edge.Top)
+            this.scroller.scrollToIndex(0,false)
           }else{
-            this.listScroller.scrollEdge(Edge.Top)
+            this.listScroller.scrollToIndex(0,false)
           }
         }
         this.rightTopImage = $r('sys.symbol.chevron_left')
@@ -9402,9 +9399,9 @@ export struct LocalMusic {
 
   //是不是1920x720的hicar的屏幕分辨率
   isHiCarKuanBianPing(){
-    if(!this.isHiCar()){
-      return false
-    }
+    // if(!this.isHiCar()){
+    //   return false
+    // }
     const hiCarAspectRatios: HiCarAspectRatio[] = [
       { ratio: 1920 / 720, name: "1920x720" },
     ];

+ 3 - 0
lib/src/main/ets/view/LyricView2.ets

@@ -5,6 +5,8 @@ import { ListAdapter } from '../extensions/ListAdapter';
 import { LyricLine } from '../bean/LyricLine';
 import { LyricWord } from '../bean/LyricWord';
 import { transverter, TransverterType, TransverterLanguage } from "@nutpi/chinese_transverter"
+import { LengthMetrics } from '@kit.ArkUI';
+
 /**
  * A component to display the lyric with scroll animation.
  * This component only support api 10+.
@@ -234,6 +236,7 @@ export struct LyricView2 {
         .height('100%')
         .scrollBar(BarState.Off)
         .cachedCount(this.cacheSize)
+        .fadingEdge(true,{fadingEdgeLength:LengthMetrics.percent(40)})
         .transition(TransitionEffect.asymmetric(
              this.isSingleLine? TransitionEffect.scale({ x: 1.2, y: 1.2 }).animation({ duration: 500 }):
              TransitionEffect.move(TransitionEdge.BOTTOM).animation({ duration: 500 }),