Explorar el Código

hicar模式的

onecold hace 1 año
padre
commit
da069b2e23
Se han modificado 1 ficheros con 8 adiciones y 3 borrados
  1. 8 3
      entry/src/main/ets/view/LocalMusic.ets

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

@@ -6066,6 +6066,9 @@ export struct LocalMusic {
 
   //是不是1920x720的hicar的屏幕分辨率
   isHiCarKuanBianPing(){
+    if(!this.isHiCar()){
+      return false
+    }
     const hiCarAspectRatios: HiCarAspectRatio[] = [
       { ratio: 1920 / 720, name: "1920x720" },
     ];
@@ -6078,7 +6081,7 @@ export struct LocalMusic {
       LogUtil.info('twocold isHiCarKuanBianPing Math.abs(currentRatio - hiCarRatio.ratio)= ' + Math.abs(currentRatio - hiCarRatio.ratio))
       if (Math.abs(currentRatio - hiCarRatio.ratio) <= RATIO_TOLERANCE) {
         // LogUtil.info(`HiCar detected: ${hiCarRatio.name}, actual: ${this.windowWidth}x${this.windowHeight}`);
-        return this.isHiCar();
+        return true;
       }
     }
 
@@ -6088,7 +6091,9 @@ export struct LocalMusic {
 
   //是不是hicar的屏幕分辨率
   isHiCarSmall() {
-
+    if(!this.isHiCar()){
+      return false
+    }
     if(this.windowWidth>1800&&this.windowHeight>=1200)//大屏幕可以Grid
       return false
 
@@ -6106,7 +6111,7 @@ export struct LocalMusic {
       LogUtil.info('twocold isHiCarSmall isHiCarStatus= ' + this.isHiCarStatus);
       if (Math.abs(currentRatio - hiCarRatio.ratio) <= RATIO_TOLERANCE) {
         // LogUtil.info(`HiCar detected: ${hiCarRatio.name}, actual: ${this.windowWidth}x${this.windowHeight}`);
-        return this.isHiCar();
+        return true;
       }
     }