Explorar o código

修复 X5折叠屏的titlebar的和状态栏冲突

onecold hai 1 ano
pai
achega
0fdfc01bcc

+ 1 - 1
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -20,7 +20,7 @@ import { VideoSpeed } from '../../viewmodel/VideoSpeed';
  */
 export class CommonConstants {
 
-  static readonly OPEN_DATE: string = '2025-06-08';
+  static readonly OPEN_DATE: string = '2025-06-10';
 
   static readonly ICP_NO: string = '闽ICP备18015191号-16A';
 

+ 1 - 0
entry/src/main/ets/common/util/LazyDataSource.ets

@@ -125,4 +125,5 @@ export class LazyDataSource<T> extends BasicDataSource<T> {
     this.dataArray.push(...newData);
     this.notifyDataReload();
   }
+
 }

+ 7 - 0
entry/src/main/ets/common/util/Utility.ets

@@ -952,6 +952,13 @@ export class Utility {
 
   }
 
+  static getMusisBg2(index:number):Resource {
+    const adjustedIndex = index % 10;
+    LogUtil.info('getMusisBg adjustedIndex = '+adjustedIndex)
+    return CommonConstants.musicBgList[adjustedIndex]
+
+  }
+
 
 
 

+ 1 - 1
entry/src/main/ets/pages/AboutPage.ets

@@ -60,7 +60,7 @@ export struct AboutPage{
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

+ 2 - 1
entry/src/main/ets/pages/NewIndex.ets

@@ -171,6 +171,7 @@ async aboutToAppear() {
   this.versionName =  AppUtil.getVersionName();
   // await ImageKnife.getInstance().initFileCache(this.context, 256, 256 * 1024 * 1024)
   this.isShowSponsorship = Utility.isOpenTime()
+
 }
 
   /**
@@ -599,7 +600,7 @@ async aboutToAppear() {
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

+ 1 - 1
entry/src/main/ets/pages/ScanFilePage.ets

@@ -128,7 +128,7 @@ export struct ScanFilePage{
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

+ 1 - 1
entry/src/main/ets/pages/SettingPage.ets

@@ -189,7 +189,7 @@ export struct SettingPage {
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

+ 1 - 1
entry/src/main/ets/pages/VipPage.ets

@@ -124,7 +124,7 @@ export  struct  VipPage{
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

+ 1 - 1
entry/src/main/ets/pages/WebIndex.ets

@@ -67,7 +67,7 @@ struct  WebIndex{
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }

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

@@ -504,17 +504,8 @@ export struct LocalMusic {
     if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
       (this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
         this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
-      this.hideDone = false;
-      this.getUIContext().animateTo({
-        duration: 300
-      }, () => {
-        this.bottomBarHeight = 55 + 0;
-        this.topBarHeight = 50 + 0;
-        this.barOpacity = 1;
-        this.barBottomOpacity = 1;
-        this.currentYOffset = 0;
-        this.isHiding = false;
-      });
+      this.setBarHeightNormal()
+
 
     }
   }
@@ -2530,6 +2521,7 @@ export struct LocalMusic {
           }
         })
         .onClick(() => {
+          // ToastUtil.showToast('当前的手机的折叠状态 ='+DisplayUtil.getFoldStatus())
           if (this.modeType === 0) {
             if (ArrayUtil.isNotEmpty(this.getCurFileList())) {
               this.doPlay(this.getCurFileList()[0])
@@ -2801,10 +2793,11 @@ export struct LocalMusic {
     this.itemMove(index, index + 1)
   }
 
+  private scroller: Scroller = new Scroller();
   @Builder
   getGridView(){
 
-    Grid() {
+    Grid(this.scroller) {
       LazyForEach(this.dataSource, (item: VideoItem, index: number) => {
         GridItem() {
           Stack({ alignContent: Alignment.Center }) {
@@ -2852,6 +2845,13 @@ export struct LocalMusic {
                     this.left(index);
                   }
                 })
+
+
+                // if (this.offsetY > this.FIX_VP_Y * 0.7) {
+                //   this.scroller.scrollToIndex(index + 10, true,ScrollAlign.CENTER);
+                // }
+
+
               })
               .onActionEnd(() => {
                 this.getUIContext().animateTo({ curve: curves.interpolatingSpring(0, 1, 400, 38) }, () => {
@@ -2882,7 +2882,7 @@ export struct LocalMusic {
     .layoutWeight(1)
     .scrollBar(BarState.Off)
     .supportAnimation(true)
-    .cachedCount(20)
+    // .cachedCount(5)
     .columnsTemplate('1fr '.repeat(this.currentWidthBreakpoint === WidthBreakpoint.WIDTH_SM ? 2 : 4))
     .rowsGap(12)
     .visibility(this.isGridMusic?Visibility.Visible:Visibility.None)
@@ -2916,7 +2916,7 @@ export struct LocalMusic {
     Stack() {
 
       Column() {
-        Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.ic_avatar6') : item.pixelMapPath)
+        Image(StrUtil.isEmpty(item.pixelMapPath) ?Utility.getMusisBg2(index) : item.pixelMapPath)
           .height(150)
           .width(150)
           .alt($r('app.media.ic_avatar6'))
@@ -3125,7 +3125,7 @@ export struct LocalMusic {
       }
       .width(180)
     }
-    .height('40%')
+    .height(item.type === CommonConstants.TYPE_IS_DIR ?'22%':'40%')
   }
 
 
@@ -4673,7 +4673,7 @@ export struct LocalMusic {
   isPhoneLan() {
     if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
       && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
-      if (DisplayUtil.getFoldStatus() === 0 || DisplayUtil.getFoldStatus() === 2) {
+      if (DisplayUtil.getFoldStatus() === 0 ) {
         return true
       }
     }