Jelajahi Sumber

优化一些界面

onecold 9 bulan lalu
induk
melakukan
dd0f6b0c84

+ 2 - 2
AppScope/app.json5

@@ -2,8 +2,8 @@
   "app": {
     "bundleName": "com.xgplayer.ttmusic.hm",
     "vendor": "example",
-    "versionCode": 20251116,
-    "versionName": "1.7.0",
+    "versionCode": 20251121,
+    "versionName": "1.7.1",
     "icon": "$media:app_icon",
     "label": "$string:app_name",
     "multiAppMode": {

+ 10 - 7
entry/src/main/ets/dialog/AddSongsToPlaylistDialog.ets

@@ -146,7 +146,7 @@ struct AddSongsToPlaylistDialogContent {
             directories.push(new VideoItem(name, name, fullPath, CommonConstants.TYPE_IS_DIR, 0, ''))
           } else {
             // 仅显示音频文件
-            if (!Utility.isMeidaByExtension(fullPath)) {
+            if (!Utility.isMeidaByExtension(fullPath)&&!fullPath.endsWith('.lrc')&&!fullPath.endsWith('.srt')) {
               continue
             }
             const normalized = this.normalizeLocalPath(fullPath)
@@ -577,10 +577,11 @@ struct AddSongsToPlaylistDialogContent {
   build() {
     Column({ space: 16 }) {
       // 搜索框
-      Row({ space: 8 }) {
+      Row({ space: 2 }) {
         Image($r('app.media.ic_action_search'))
           .width(20)
           .height(20)
+          .padding({ left: 5})
           .fillColor(this.isDarkMode ? '#8E8E93' : $r('app.color.text_color'))
           .opacity(0.6)
 
@@ -590,16 +591,17 @@ struct AddSongsToPlaylistDialogContent {
           .backgroundColor(this.isDarkMode ? '#2C2C2E' : $r('app.color.input_background'))
           .borderRadius(8)
           .padding({ left: 8, right: 8 })
-          .fontSize(14)
+          .fontSize(11)
           .fontColor(this.isDarkMode ? '#FFFFFF' : $r('app.color.text_color'))
           .placeholderColor(this.isDarkMode ? '#8E8E93' : '#999999')
+          .placeholderFont({ size:11 })
           .onChange((value: string) => {
             this.searchText = value
             this.filterSongs()
           })
       }
       .width('100%')
-      .padding(12)
+      .padding(2)
       .backgroundColor(this.isDarkMode ? '#2C2C2E' : $r('app.color.input_background'))
       .borderRadius(20)
 
@@ -609,7 +611,7 @@ struct AddSongsToPlaylistDialogContent {
         selectedIndexes: $viewMode
       })
         .width('100%')
-        .margin({ top: 8 })
+        .margin({ top: 2 })
 
       // 已选择歌曲数量(包含目录展开后的歌曲)
       if (this.totalSelectedCount > 0) {
@@ -909,12 +911,13 @@ struct AddSongsToPlaylistDialogContent {
                       .maxLines(1)
                       .textOverflow({ overflow: TextOverflow.Ellipsis })
                   } else if (item.type === CommonConstants.TYPE_IS_DIR) {
-                    Text('包含子目录内的所有音乐将一起添加')
-                      .fontSize(12)
+                    Text('包含子目录所有音乐')
+                      .fontSize(11)
                       .fontColor(this.isDarkMode ? '#8E8E93' : '#999999')
                       .maxLines(1)
                   }
                 }
+                .alignItems(HorizontalAlign.Start)
                 .layoutWeight(1)
                 .margin({ left: 8 })
 

+ 26 - 9
entry/src/main/ets/view/NavidromePage.ets

@@ -74,7 +74,7 @@ export struct NavidromePage {
   @State tabOptions: SegmentButtonOptions = SegmentButtonOptions.capsule({
     buttons: [{ text: '全部' }, { text: '艺术家' }, { text: '专辑' }] as SegmentButtonItemTuple,
     direction: Direction.Ltr,
-    buttonPadding: { top: 12, bottom: 12 },
+    buttonPadding: { top: 10, bottom: 10 },
     backgroundColor: $r('app.color.index_background'),
     selectedBackgroundColor: $r('app.color.start_window_background'),
     selectedFontColor: $r('app.color.text_color'),
@@ -490,7 +490,7 @@ export struct NavidromePage {
     }
     .width('100%')
     .padding({ top: this.topRectHeight + 5 })
-    .backgroundColor($r('app.color.start_window_background'))
+    // .backgroundColor($r('app.color.start_window_background'))
   }
 
   @Builder
@@ -663,10 +663,13 @@ export struct NavidromePage {
           .height(48)
           .borderRadius(10)
           .sourceSize({ width: 38, height: 38 })
+          .draggable(false)
+          .interpolation(ImageInterpolation.High)// 用于重采样后的抗锯齿
+          .autoResize(true) // 重采样,可减少内存占用
           .alt($r('app.media.music_red'))
           .fillColor(song.pixelMapPath ? undefined : this.themeColor)
           .objectFit(ImageFit.Cover)
-          .margin({ left: 8 })
+          .margin({ left: 20 })
           .onClick(() => {
             this.playSong(song, index, true);
           })
@@ -732,9 +735,13 @@ export struct NavidromePage {
           .width(48)
           .height(48)
           .borderRadius(10)
+          .draggable(false)
+          .interpolation(ImageInterpolation.High)// 用于重采样后的抗锯齿
+          .autoResize(true) // 重采样,可减少内存占用
+          // .sourceSize({ width: 38, height: 38 })
           .fillColor(artist.coverUrl ? undefined : this.themeColor)
           .objectFit(ImageFit.Cover)
-          .margin({ left: 8 })
+          .margin({ left: 20 })
 
         Column({ space: 4 }) {
           Text(artist.name ?? Constants.UNKNOWN_ARTIST)
@@ -774,9 +781,14 @@ export struct NavidromePage {
           .width(48)
           .height(48)
           .borderRadius(10)
+          .clip(true)
+          .draggable(false)
+          // .interpolation(ImageInterpolation.High)// 用于重采样后的抗锯齿
+          // .autoResize(true) // 重采样,可减少内存占用
+          .sourceSize({ width: 38, height: 38 })
           .fillColor(album.coverUrl ? undefined : this.themeColor)
           .objectFit(ImageFit.Cover)
-          .margin({ left: 8 })
+          .margin({ left: 20 })
 
         Column({ space: 4 }) {
           Text(album.name ?? '未知专辑')
@@ -842,7 +854,7 @@ export struct NavidromePage {
     if (album.duration !== undefined) {
       const duration = this.formatSongDuration(album.duration);
       if (duration) {
-        parts.push(duration);
+        parts.push('  '+duration);
       }
     }
     if (album.minYear) {
@@ -993,7 +1005,7 @@ export struct NavidromePage {
             .onClick(() => this.clearFilter())
         }
         .width('90%')
-        .padding({ left: 16, right: 16, top: 6, bottom: 2 })
+        .padding({ left: 16, right: 16, top: 12, bottom: 2 })
       }
 
       List({ space: 8 }) {
@@ -1019,7 +1031,8 @@ export struct NavidromePage {
       }
       .width('100%')
       .layoutWeight(1)
-      .padding({ top: 10, bottom: 10 })
+      .cachedCount(3)
+      .padding({ top: 5, bottom: 5 })
       .listDirection(Axis.Vertical)
       .scrollBar(BarState.Auto)
       .edgeEffect(EdgeEffect.Spring)
@@ -1052,7 +1065,11 @@ export struct NavidromePage {
   build() {
 
     Stack() {
-      this.buildContentView();
+      Column() {
+        this.buildContentView();
+      }
+      .padding({top:this.topRectHeight+98})
+
       Column() {
         this.topTitleBar()
       }