Bläddra i källkod

继续美化发现页UI

onecold 4 månader sedan
förälder
incheckning
1f459f50d0

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

@@ -92,7 +92,7 @@ export class CommonConstants {
 
   static readonly TWO_FINGER_TYPE = ["小", "中", "大"]
   static readonly DEFAULT_LAYOUT = [ "瀑布流模式","列表模式","网格模式"]
-  static readonly DEFAULT_HOME_TYPE = [ "本地音乐","媒体库","网盘" ,"艺术家","专辑"]
+  static readonly DEFAULT_HOME_TYPE = [ "本地音乐","媒体库","网盘" ,"艺术家","专辑","发现页"]
 
   //德本的接口调用微信支付下单接口返回的支付交易会话ID,该值有效期为2小时。
   static readonly WX_PAY_API: string = "https://pay.ss5.xyz/wechat/prepay"

+ 3 - 0
entry/src/main/ets/common/constants/EventConstants.ets

@@ -58,6 +58,9 @@ export class EventConstants {
   // 播放队列刷新事件(仅刷新列表,不触发重新播放)
   static readonly EVENT_PLAY_QUEUE_REFRESH: number = 2006;
 
+  // 打开本地特殊列表(最近播放/我的收藏)
+  static readonly EVENT_OPEN_LOCAL_SPECIAL_LIST: number = 2007;
+
   /**
    * WebDAV 元数据同步事件
    */

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

@@ -219,6 +219,14 @@ struct NewIndex {
       console.info('onecold 网盘 返回键处理:发送手势返回事件');
       const eventData: emitter.EventData = {};
       emitter.emit({ eventId: EventConstants.EVENT_SWIPE_BACK_DISK }, eventData);
+    } else if(this.mType === 8) {
+      if (this.isShowDrawer) {
+        this.getUIContext()?.animateTo({ duration: 555 }, () => {
+          this.isShowDrawer = false
+        })
+      } else {
+        return false
+      }
     }  else if(this.mType > 0){
       this.getUIContext()?.animateTo({ duration: 555 }, () => {
         // 动画闭包内控制Image组件的出现和消失
@@ -400,6 +408,9 @@ struct NewIndex {
     }else if(this.defalut_home_type==4){
       this.mType = 0
       this.modeType = 3
+    }else if(this.defalut_home_type==5){
+      this.mType = 8
+      this.modeType = 0
     }
     console.info('onecold 网盘 默认首页2 this.mType='+this.mType )
   }
@@ -1219,7 +1230,19 @@ struct NewIndex {
     if(this.mType == 0){
       return this.modeType == index
     }
-    return this.mType+3 == index
+    if (this.mType == 8) {
+      return index == 4
+    }
+    if (this.mType == 2) {
+      return index == 5
+    }
+    if (this.mType == 3) {
+      return index == 6
+    }
+    if (this.mType == 5) {
+      return index == 7
+    }
+    return false
 
   }
 

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

@@ -1916,7 +1916,8 @@ export struct SettingPage {
                 { value: CommonConstants.DEFAULT_HOME_TYPE[1] },
                 { value: CommonConstants.DEFAULT_HOME_TYPE[2] },
                 { value: CommonConstants.DEFAULT_HOME_TYPE[3] },
-                { value: CommonConstants.DEFAULT_HOME_TYPE[4] }
+                { value: CommonConstants.DEFAULT_HOME_TYPE[4] },
+                { value: CommonConstants.DEFAULT_HOME_TYPE[5] }
               ])
                 .font({ size: 15, weight: FontWeight.Medium })
                 .fontColor(Color.Gray)

+ 2 - 1
entry/src/main/ets/view/ConfigTitle.ets

@@ -5,6 +5,7 @@ export struct ConfigTitle {
   @Require @Prop text: string
   @Prop actionText: string = '换一换'
   @Prop showAction: boolean = true
+  @Prop actionSymbol: Resource = $r('sys.symbol.arrow_clockwise')
   onActionClick: () => void = () => {}
 
   build() {
@@ -21,7 +22,7 @@ export struct ConfigTitle {
             .fontSize(14)
             .lineHeight(16)
             .fontColor('#99000000')
-          SymbolGlyph($r('sys.symbol.arrow_clockwise'))
+          SymbolGlyph(this.actionSymbol)
             .attributeModifier(new SymbolGlyphFancyModifier(18, '', ''))
         }
         .onClick(() => {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 657 - 140
entry/src/main/ets/view/FindView.ets


+ 38 - 0
entry/src/main/ets/view/LocalMusic.ets

@@ -1103,6 +1103,13 @@ export struct LocalMusic {
       this.syncWebdavQueueWithoutRestart();
     });
 
+    let eventOpenLocalSpecialList: emitter.InnerEvent = { eventId: EventConstants.EVENT_OPEN_LOCAL_SPECIAL_LIST }
+    emitter.on(eventOpenLocalSpecialList, (eventData: emitter.EventData) => {
+      const data = eventData.data as Record<string, Object>
+      const target = data?.target as string
+      this.openSpecialLocalList(target)
+    });
+
     let eventSetting: emitter.InnerEvent = { eventId: EventConstants.EVENT_SETTING_UPDATE }
     // 监听广播事件(通用设置配置更新)
     emitter.on(eventSetting, (eventData: emitter.EventData) => {
@@ -9305,6 +9312,37 @@ export struct LocalMusic {
     return Utility.getGlobalList(this.videoLocalList, CommonConstants.TYPE_LOCAL);
   }
 
+  private openSpecialLocalList(target: string): void {
+    this.mType = 0
+    this.isShowDrawer = false
+    this.offsetX = 0
+    this.isHistory = false
+    this.isFavMusic = false
+
+    if (target === 'recent') {
+      this.titleName = '最近播放'
+      this.currentTitleName = '最近播放'
+      this.currentTitleCover = $r('app.media.alt')
+      this.updateListData(this.historyList, true)
+      if (ArrayUtil.isNotEmpty(this.historyList)) {
+        this.currentTitleCover = Utility.getFirstCoverFromList(this.historyList)
+      }
+      this.isHistory = true
+      return
+    }
+
+    if (target === 'favorite') {
+      this.titleName = '我的收藏'
+      this.currentTitleName = '我的收藏'
+      this.currentTitleCover = $r('app.media.alt')
+      this.updateListData(this.favList, true)
+      if (ArrayUtil.isNotEmpty(this.favList)) {
+        this.currentTitleCover = Utility.getFirstCoverFromList(this.favList)
+      }
+      this.isFavMusic = true
+    }
+  }
+
   private async tryLoadNextPageForPlayback(): Promise<void> {
     if (this.playQueueScope !== 'view') {
       return;

+ 12 - 0
entry/src/main/resources/base/element/color.json

@@ -235,6 +235,18 @@
     {
       "name": "com_bg",
       "value": "#F7F7F7"
+    },
+    {
+      "name": "find_card_background",
+      "value": "#F6F7FB"
+    },
+    {
+      "name": "find_secondary_text",
+      "value": "#80000000"
+    },
+    {
+      "name": "find_history_background",
+      "value": "#F2F3F5"
     }
   ]
 }

+ 17 - 1
entry/src/main/resources/dark/element/color.json

@@ -205,6 +205,10 @@
       "name": "cancel_button_text",
       "value": "#F5F5F5"
     },
+    {
+      "name": "input_background",
+      "value": "#1A1A1A"
+    },
     {
       "name": "start_window_background_blur",
       "value": "#333333"
@@ -220,6 +224,18 @@
     {
       "name": "com_bg",
       "value": "#141414"
+    },
+    {
+      "name": "find_card_background",
+      "value": "#151515"
+    },
+    {
+      "name": "find_secondary_text",
+      "value": "#99FFFFFF"
+    },
+    {
+      "name": "find_history_background",
+      "value": "#222222"
     }
   ]
-}
+}

Vissa filer visades inte eftersom för många filer har ändrats