Bläddra i källkod

修复PlayController的歌名太长导致重叠,修复其他应用打开显示天天静听

onecold 1 år sedan
förälder
incheckning
b494477693
3 ändrade filer med 68 tillägg och 78 borttagningar
  1. 2 2
      AppScope/app.json5
  2. 8 23
      entry/src/main/ets/view/LocalMusic.ets
  3. 58 53
      entry/src/main/module.json5

+ 2 - 2
AppScope/app.json5

@@ -2,8 +2,8 @@
   "app": {
     "bundleName": "com.xgplayer.ttmusic.hm",
     "vendor": "example",
-    "versionCode": 20250717,
-    "versionName": "1.4.6",
+    "versionCode": 20250718,
+    "versionName": "1.4.7",
     "icon": "$media:app_icon",
     "label": "$string:app_name",
     "multiAppMode": {

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

@@ -2530,20 +2530,21 @@ export struct LocalMusic {
             Text(item.name)
               .fontSize(this.twoFingerType==1?12:this.twoFingerType==2?15:18)
               .maxLines(1)
+              .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
               .animation({
                 duration: 555,
                 curve: 'Linear',
               })
               .fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
               $r('app.color.text_color'))
-              .margin({ left:this.twoFingerType==3?18: 10 })
+              .margin({ left:this.twoFingerType==3?6: 8 })
             Row() {
               Text(StrUtil.isEmpty(item.artist) ? item.cTime : item.artist + '  ' + item?.album)
                 .fontSize(this.twoFingerType==1?11:this.twoFingerType==2?12:14)
                 .padding({ top: 8 })
                 .fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
                 $r('app.color.text_color'))
-                .margin({ left:this.twoFingerType==3?18: 10})
+                .margin({ left:this.twoFingerType==3?6: 8})
               Blank()
               Text(item.size)
                 .fontSize(this.twoFingerType==1?11:this.twoFingerType==2?12:14)
@@ -2562,7 +2563,8 @@ export struct LocalMusic {
 
         }
         .height('100%')
-        .width('65%')
+        .margin({ left: 5})
+        .layoutWeight(1)
 
         Column() {
           Checkbox({ name: 'checkbox' + index })
@@ -2587,12 +2589,13 @@ export struct LocalMusic {
             .state(this.animationState)// 动画状态
             .fillMode(FillMode.Forwards)
             .width(18)
+            .margin({ right: 20, top: 8, bottom: 8 })
             .visibility(this.videoUrl === item.filePath ? this.isMultiSelect ? Visibility.None : Visibility.Visible :
             Visibility.None)
             .height(18)
             .iterations(-1) // 播放次数
         }
-        .width('18%')
+
 
       }
     }
@@ -4236,6 +4239,7 @@ export struct LocalMusic {
           .alignItems(HorizontalAlign.Start)
           .margin({ right: 22 })
         }
+        .padding({ right: 18 })
         .layoutWeight(1)
         .clickEffect({level:ClickEffectLevel.MIDDLE, scale: 0.5})
         .onClick(() => {
@@ -5561,22 +5565,6 @@ export struct LocalMusic {
 
     Column() {
 
-      // Stack({ alignContent: Alignment.Center }) {
-      //
-      //
-      //
-      //   Image($r('app.media.icon_load'))
-      //     .objectFit(ImageFit.Auto)
-      //     .width('120px')
-      //     .height('120px')
-      //     .visibility(this.loadingVisible)
-      //     .border({ width: 0 })
-      //     .borderStyle(BorderStyle.Dashed)
-      //
-      //
-      // }
-
-
       Column() {
 
         Column() {
@@ -5593,9 +5581,6 @@ export struct LocalMusic {
           .visibility(DeviceUtil.getDeviceType()==resourceManager.DeviceType.DEVICE_TYPE_2IN1?
           Visibility.Visible:this.isShowPlayPageBack?Visibility.Visible:Visibility.None)
 
-          // .visibility(this.currentBreakpoint !== BreakpointTypeEnum.SM
-          //   ?Visibility.Visible:Visibility.Visible)
-
           if (this.showSpeedDialog) {
             this.SpeedDialog()
           }

+ 58 - 53
entry/src/main/module.json5

@@ -50,6 +50,7 @@
             "actions": [
               "action.system.home",
               "ohos.want.action.viewData",
+              "ohos.want.action.sendData"
             ],
             "uris": [
 
@@ -64,18 +65,21 @@
                 "utd":"general.video",
                 "linkFeature": "FileOpen",
               },
-              {
-                "scheme": "file",
-                "type": "audio/*",
-                "linkFeature": "FileOpen",
-                "maxFileSupported": 1
-              },
-              {
-                "scheme": "file",
-                "type": "video/*",
-                "linkFeature": "FileOpen",
-                "maxFileSupported": 1
-              }
+
+
+
+//              {
+//                "scheme": "file",
+//                "type": "audio/*",
+//                "linkFeature": "FileOpen",
+//                "maxFileSupported": 1
+//              },
+//              {
+//                "scheme": "file",
+//                "type": "video/*",
+//                "linkFeature": "FileOpen",
+//                "maxFileSupported": 1
+//              }
             ],
             "entities": [
               "entity.system.home"
@@ -84,57 +88,58 @@
           }
         ]
       },
-      {
-        "name": "ShareUIAbility",
-        "srcEntry": "./ets/entryability/ShareUIAbility.ets",
-        "description": "$string:EntryAbility_desc",
-        "icon": "$media:icon",
-        "label": "$string:EntryAbility_label",
-        "startWindowIcon": "$media:icon",
-        "startWindowBackground": "$color:start_window_background",
-        "orientation": "portrait",
-        "exported": true,
-        "backgroundModes": [
-          // 长时任务类型的配置项
-          "audioPlayback"
-        ],
-        "skills": [
-          {
-            "actions": [
-              "ohos.want.action.sendData",
-              "ohos.want.action.viewData"
-            ],
-
-            // 目标应用在配置支持接收的数据类型时,需穷举支持的UTD,比如:支持全部图片类型,可声明:general.image
-            // maxFileSupported 对于归属指定类型的文件,标识一次支持接收的最大数量。默认为0,代表不支持此类文件的分享。文件类型归属关系参考:@ohos.data.uniformTypeDescriptor (标准化数据定义与描述)
-            "uris": [
-
+//      {
+//        "name": "ShareUIAbility",
+//        "srcEntry": "./ets/entryability/ShareUIAbility.ets",
+//        "description": "$string:EntryAbility_desc",
+//        "icon": "$media:icon",
+//        "label": "$string:EntryAbility_label",
+//        "startWindowIcon": "$media:icon",
+//        "startWindowBackground": "$color:start_window_background",
+//        "orientation": "portrait",
+//        "exported": true,
+//        "backgroundModes": [
+//          // 长时任务类型的配置项
+//          "audioPlayback"
+//        ],
+//        "skills": [
+//          {
+//            "actions": [
+//              "ohos.want.action.sendData",
+//            ],
+//
+//            // 目标应用在配置支持接收的数据类型时,需穷举支持的UTD,比如:支持全部图片类型,可声明:general.image
+//            // maxFileSupported 对于归属指定类型的文件,标识一次支持接收的最大数量。默认为0,代表不支持此类文件的分享。文件类型归属关系参考:@ohos.data.uniformTypeDescriptor (标准化数据定义与描述)
+//            "uris": [
+//
 //              {
 //                "scheme": "file",
 //                "utd": "general.audio",
 //                "linkFeature": "FileOpen"
 //              },
-              {
-                "scheme": "file",
-                "type": "audio/*",
-                "linkFeature": "FileOpen",
-                "maxFileSupported": 1
-              },
-              {
-                "scheme": "file",
-                "type": "video/*",
-                "linkFeature": "FileOpen",
-                "maxFileSupported": 1
-              },
+//              {
+//                "scheme": "file",
+//                "type": "audio/*",
+//                "linkFeature": "FileOpen",
+//                "maxFileSupported": 1
+//              },
+
+
+//              {
+//                "scheme": "file",
+//                "type": "video/*",
+//                "linkFeature": "FileOpen",
+//                "maxFileSupported": 1
+//              },
 //              {
 //                "scheme": "file",
 //                "utd":"general.video",
 //                "linkFeature": "FileOpen"
 //              }
-            ]
-          }
-        ]
-      }
+//            ]
+//          }
+//        ]
+//      }
 
     ],