onecold 9 месяцев назад
Родитель
Сommit
9d569114a7

+ 121 - 0
entry/src/main/ets/controller/ScreenUtil.ets

@@ -0,0 +1,121 @@
+import { display, window } from '@kit.ArkUI'
+import { Context } from '@kit.AbilityKit'
+import { settings } from '@kit.BasicServicesKit'
+
+class Screen {
+  isInit: boolean = false
+
+  init(context: Context) {
+    if (this.isInit) {
+      return
+    }
+    window.getLastWindow(context).then((windowClass) => {
+      this.isInit = true
+      windowClass.setWindowLayoutFullScreen(true)
+      if (canIUse('SystemCapability.Window.SessionManager')) {
+        windowClass.setWindowDecorVisible(false)
+        if (canIUse('SystemCapability.Applications.Settings.Core')) {
+          settings.registerKeyObserver(context, 'window_pcmode_switch_status', settings.domainName.USER_PROPERTY,
+            () => {
+              this.updatePCMode(context)
+            });
+        }
+      }
+      this.updatePCMode(context)
+      this.updateAvoidArea(windowClass)
+      this.updateScreenSize(windowClass.getWindowProperties().windowRect.width,
+        windowClass.getWindowProperties().windowRect.height)
+      windowClass.on('windowSizeChange', (size) => {
+        this.updateScreenSize(size.width, size.height)
+        this.updateAvoidArea(windowClass)
+      })
+      windowClass.on('avoidAreaChange', () => {
+        this.updateAvoidArea(windowClass)
+      })
+      windowClass.on('keyboardHeightChange', (height) => {
+        if (height == 0) {
+          AppStorage.setOrCreate('main_blur', 0)
+        }
+      })
+    })
+  }
+
+  async updateAvoidArea(windowClass: window.Window) {
+    let cutOut = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT)
+    let system = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM)
+    let nav = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR)
+    let uiContext = windowClass.getUIContext()
+    animateToImmediately({ duration: 300, curve: Curve.Ease }, () => {
+      if (canIUse('SystemCapability.Window.SessionManager')) {
+        AppStorage.setOrCreate('topSafeHeight',
+          uiContext.px2vp(Math.max(cutOut.topRect.height * 1.4, system.topRect.height,
+            windowClass.getWindowDecorHeight())))
+      }
+      AppStorage.setOrCreate('bottomSafeHeight',
+        uiContext.px2vp(Math.max(nav.bottomRect.height, system.bottomRect.height * 1.4,
+          cutOut.bottomRect.height * 1.4)))
+      AppStorage.setOrCreate('leftSafeHeight',
+        uiContext.px2vp(Math.max(cutOut.leftRect.width * 1.4, system.leftRect.width * 1.4)))
+      AppStorage.setOrCreate('rightSafeHeight',
+        uiContext.px2vp(Math.max(cutOut.rightRect.width * 1.4, system.rightRect.width * 1.4)))
+    })
+  }
+
+  updatePCMode(context: Context) {
+    if (canIUse('SystemCapability.Applications.Settings.Core')) {
+      switch (settings.getValueSync(context, 'window_pcmode_switch_status', 'false',
+        settings.domainName.USER_PROPERTY)) {
+        case 'true':
+          AppStorage.setOrCreate('pcMode', true)
+          break
+        case 'false':
+          AppStorage.setOrCreate('pcMode', false)
+          break
+      }
+    }
+  }
+
+  setBarState(context: Context, status: boolean, navigationIndicator: boolean) {
+    if (canIUse('SystemCapability.Window.SessionManager')) {
+      window.getLastWindow(context).then((windowClass) => {
+        windowClass.setSpecificSystemBarEnabled('status', status)
+        windowClass.setSpecificSystemBarEnabled('navigationIndicator', navigationIndicator)
+      })
+    }
+  }
+
+  setKeepScreenOn(context: Context, isOn: boolean) {
+    window.getLastWindow(context).then((windowClass) => {
+      windowClass.setWindowKeepScreenOn(isOn)
+    })
+  }
+
+  async updateScreenSize(width: number | undefined, height: number | undefined) {
+    let screen_width = px2vp(width || display.getPrimaryDisplaySync().width)
+    let screen_height = px2vp(height || display.getDefaultDisplaySync().height)
+    animateToImmediately({ duration: 300, curve: Curve.Ease }, () => {
+      AppStorage.setOrCreate('screen_width', screen_width)
+      AppStorage.setOrCreate('screen_height', screen_height)
+    })
+    this.updateListEmpty(AppStorage.get('list_maximum_columns') as number)
+  }
+
+  updateListEmpty(maxColumns: number) {
+    let list_empty_item: number[] = []
+    let list_line =
+      Math.max(Math.min(Math.floor((AppStorage.get('screen_width') as number | undefined || 0) / 230), maxColumns + 1),
+        AppStorage.get('force_list_style') ? 2 : 1)
+    for (let i = 0; i < list_line; i++) {
+      list_empty_item.push(i)
+    }
+    setTimeout(() => {
+      AppStorage.setOrCreate('list_line', list_line)
+      AppStorage.setOrCreate('list_empty_item', list_empty_item)
+    }, 100)
+
+  }
+}
+
+const ScreenUtil = new Screen()
+
+export default ScreenUtil

+ 42 - 47
entry/src/main/ets/pages/ChartsCount.ets

@@ -12,10 +12,12 @@ import { AudioQuality, FFMpegTags } from '../common/util/Utility';
 import MediaTable from '../common/util/MediaTable';
 import { McPieChart, Options } from '@mcui/mccharts'
 import { ComponentContent } from '@kit.ArkUI';
+import { ButtonFancyModifier, ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil';
 
 // 批量编辑标签
 @Component
 export struct ChartsCount {
+  @StorageProp('topSafeHeight') topSafeHeight: number = 0;
   @Consume mType: number;
   private listScroller: ListScroller = new ListScroller()
   @State isLyric:boolean = true
@@ -161,6 +163,46 @@ export struct ChartsCount {
   }
 
 
+  @Builder
+  topTitleBar(){
+    Column() {
+      Row({ space: 15 }) {
+
+        //左侧滑动按钮
+        Button({ type: ButtonType.Circle, stateEffect: true }) {
+          SymbolGlyph($r('sys.symbol.sort'))
+            .attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
+        }
+        .attributeModifier(new ButtonFancyModifier(40, 40))
+        .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+        .animation({ duration: 300, curve: Curve.Ease })
+        .onClick(() => {
+          this.getUIContext().animateTo({ duration: 555 }, () => {
+            // 动画闭包内控制Image组件的出现和消失
+            this.isShowDrawer = !this.isShowDrawer
+            this.offsetX = 0
+          })
+
+        })
+        .attributeModifier(new ShadowModifier())
+        .zIndex(0)
+
+        Text($r('app.string.music_charts'))
+          .margin({left:3,right:10})
+          .fontColor($r('app.color.text_color'))
+          .fontSize(19)
+          .maxLines(1)
+          .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
+          .layoutWeight(1)
+          .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+
+
+      }
+    }
+    .padding({ top: this.topSafeHeight+10, left: 10, right: 10,bottom:12 })
+    .width('100%')
+  }
+
 
   build() {
     Column(){
@@ -280,53 +322,6 @@ export struct ChartsCount {
     .height('auto').width('100%')
   }
 
-
-
-
-
-  @Builder
-  topTitleBar() {
-    // 顶部安全区和自定义标题栏
-    Column() {
-      // 顶部安全区
-      Blank()
-        .height(this.topRectHeight)
-        .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
-        .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
-      // 自定义标题栏(Stack实现绝对居中)
-      Stack() {
-        // 居中标题
-        Text('歌曲统计')
-          .fontSize(18)
-          .fontColor(Color.White)
-          .align(Alignment.Center)
-        // 左右按钮
-        Row() {
-          Image($r('app.media.menu'))
-            .width(26)
-            .height(26)
-            .margin({ left: 12, right: 8 })
-            .onClick(() => {
-              this.getUIContext().animateTo({ duration: 666 }, () => {
-                // 动画闭包内控制Image组件的出现和消失
-                this.isShowDrawer = !this.isShowDrawer
-                this.offsetX = 0
-                // this.mType =0
-              })
-            })
-          Blank().flexGrow(1)
-          Blank().width(32)
-        }
-        .height(48)
-        .width('100%')
-        .alignItems(VerticalAlign.Center)
-      }
-      .height(48)
-      .width('100%')
-      .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
-    }
-  }
-
   @Builder
   private MusicItem(item: VideoItem, index: number) {
     Button({ type: ButtonType.Normal, stateEffect: true }) {

+ 4 - 4
entry/src/main/ets/pages/NewIndex.ets

@@ -90,7 +90,7 @@ struct NewIndex {
   @State isShowSponsorship: boolean = false
   /** 音乐是否为零状态(预留) */
   @Provide('isMusicZero') isMusicZero: boolean = false;
-  @State isShowTitleBar: boolean = true //是否显示分类导航条
+  @State isShowTitleBar: boolean = false //是否显示分类导航条
   /** 本地音乐列表,持久化存储 */
   @StorageLink('musicLocalList') musicLocalList: Array<VideoItem> = []
   @Provide isFavMusic: boolean = false
@@ -247,7 +247,7 @@ struct NewIndex {
 
   async aboutToAppear() {
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
-    this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, true)
+    this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
     this.idDefaultMediaKu = PreferencesUtil.getBooleanSync('idDefaultMediaKu', false)
     if(this.idDefaultMediaKu){
       this.modeType = 1
@@ -739,7 +739,7 @@ struct NewIndex {
 
   @Builder
   buildTabCate() {
-    ForEach(this.isHiCar()||!this.isShowTitleBar?mainViewModel.getDrawerData():mainViewModel.getDrawerData2(), (item: ItemData, index: number) => {
+    ForEach(mainViewModel.getDrawerData(), (item: ItemData, index: number) => {
       ListItem() {
         Button({ type: ButtonType.Capsule, stateEffect: true }) {
           Row() {
@@ -756,7 +756,7 @@ struct NewIndex {
                 .height(22)
                 .alignSelf(ItemAlign.Center)
                 .fillColor(this.themeColor)
-                .margin({ left: 25 })
+                .margin({ left: 15 })
             }
 
             // 菜单标题

+ 43 - 35
entry/src/main/ets/pages/ScanFilePage.ets

@@ -16,12 +16,14 @@ import { BreakpointTypeEnum } from '../common/util/BreakpointSystem'
 import { resourceManager } from '@kit.LocalizationKit'
 import { common, ConfigurationConstant } from '@kit.AbilityKit'
 import { DialogHelper } from '@pura/harmony-dialog'
+import { ButtonFancyModifier, ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil'
 
 
 @Preview
 // @Entry
 @Component
 export struct ScanFilePage{
+  @StorageProp('topSafeHeight') topSafeHeight: number = 0;
   // 新增状态变量
   @State currentInsertCount: number = 0 // 当前已扫描并插入的歌曲数量
   @State currentFilePath: string = '' // 当前正在处理的文件路径
@@ -173,49 +175,55 @@ export struct ScanFilePage{
     this.currentInsertCount = count
   }
 
+  @Builder
+  topTitleBar(){
+    Column() {
+      Row({ space: 15 }) {
+
+        //左侧滑动按钮
+        Button({ type: ButtonType.Circle, stateEffect: true }) {
+          SymbolGlyph($r('sys.symbol.sort'))
+            .attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
+        }
+        .attributeModifier(new ButtonFancyModifier(40, 40))
+        .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+        .animation({ duration: 300, curve: Curve.Ease })
+        .onClick(() => {
+          this.getUIContext().animateTo({ duration: 555 }, () => {
+            // 动画闭包内控制Image组件的出现和消失
+            this.isShowDrawer = !this.isShowDrawer
+            this.offsetX = 0
+          })
 
+        })
+        .attributeModifier(new ShadowModifier())
+        .zIndex(0)
+
+        Text($r('app.string.file_scan'))
+          .margin({left:3,right:10})
+          .fontColor($r('app.color.text_color'))
+          .fontSize(19)
+          .maxLines(1)
+          .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
+          .layoutWeight(1)
+          .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+
+
+      }
+    }
+    .padding({ top: this.topSafeHeight+10, left: 10, right: 10,bottom:12 })
+    .width('100%')
+  }
 
   build() {
     Column() {
+      // 顶部安全区和自定义标题栏
       // 顶部安全区和自定义标题栏
       Column() {
-        // 顶部安全区
-        Blank()
-          .height(this.topRectHeight)
-          .backgroundColor(this.isDarkMode?$r('app.color.title_bar_bg'):this.themeColor)
-          .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
-        // 自定义标题栏(Stack实现绝对居中)
-        Stack() {
-          // 居中标题
-          Text('文件扫描')
-            .fontSize(18)
-            .fontColor(Color.White)
-            .align(Alignment.Center)
-          // 左右按钮
-          Row() {
-            Image($r('app.media.menu'))
-              .width(28)
-              .height(28)
-              .margin({ left: 12, right: 8 })
-              .onClick(() => {
-                animateTo({ duration: 555 }, () => {
-                  // 动画闭包内控制Image组件的出现和消失
-                  this.isShowDrawer = !this.isShowDrawer
-                  this.offsetX = 0
-                })
-              })
-            Blank().flexGrow(1)
-            Blank().width(32)
-          }
-          .height(48)
-          .width('100%')
-          .alignItems(VerticalAlign.Center)
-        }
-        .height(48)
-        .width('100%')
-        .backgroundColor(this.isDarkMode?$r('app.color.title_bar_bg'):this.themeColor)
+        this.topTitleBar()
       }
 
+
       Scroll(){
         Column() {
 

+ 77 - 37
entry/src/main/ets/pages/SettingPage.ets

@@ -17,11 +17,13 @@ import { bundleManager } from '@kit.AbilityKit'
 import { hilog } from '@kit.PerformanceAnalysisKit'
 import { SelectItem } from './SelectItem'
 import { FastForwardSecondInterface } from './FastForwardSecondInterface'
+import { ButtonFancyModifier, ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil'
 
 @Preview
 // @Entry
 @Component
 export struct SettingPage {
+  @StorageProp('topSafeHeight') topSafeHeight: number = 0;
   @State isCopyFileToDownLoad: boolean = false
   static readonly IS_COPYFILE_TO_DOWNLOAD: string = 'isCopyFileToDownLoad';
   @State fastForwardSeconds: string = '10'
@@ -544,46 +546,84 @@ export struct SettingPage {
     .borderRadius(24)
   }
 
-  build() {
+
+  @Builder
+  topTitleBar(){
     Column() {
-      Column() {
-        Line().width('100%').height('100%')
-      }
-      .height(this.topRectHeight)
-      .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
-      .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
-
-      // 自定义标题栏
-      Stack() {
-        // 居中标题
-        Text('通用设置')
-          .fontSize(20)
-          .fontColor(Color.White)
-          .align(Alignment.Center)
-        // 左侧返回按钮
-        Row() {
-          Image($r('app.media.left_back_white'))
-            .width(26)
-            .height(26)
-            .margin({ left: 12, right: 8 })
-            .onClick(() => {
-              this.getUIContext()?.animateTo({ duration: 555 }, () => {
-                // 动画闭包内控制Image组件的出现和消失
-                // this.isShowDrawer = !this.isShowDrawer
-                // this.offsetX = 0
-                this.mType =0
-              })
-            })
-          Blank().flexGrow(1)
-          Blank().width(32)
+      Row({ space: 15 }) {
+
+        //左侧滑动按钮
+        Button({ type: ButtonType.Circle, stateEffect: true }) {
+          SymbolGlyph($r('sys.symbol.chevron_left'))
+            .attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
         }
-        .height(48)
-        .width('100%')
-        .alignItems(VerticalAlign.Center)
+        .attributeModifier(new ButtonFancyModifier(40, 40))
+        .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+        .animation({ duration: 300, curve: Curve.Ease })
+        .onClick(() => {
+            this.getUIContext()?.animateTo({ duration: 555 }, () => {
+              this.mType =0
+            })
+        })
+        .attributeModifier(new ShadowModifier())
+        .zIndex(0)
+
+        Text($r('app.string.setting'))
+          .margin({left:3,right:10})
+          .fontColor($r('app.color.text_color'))
+          .fontSize(19)
+          .maxLines(1)
+          .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
+          .layoutWeight(1)
+          .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+
       }
-      .height(48)
-      .width('100%')
-      .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
+    }
+    .padding({ top: this.topSafeHeight+10, left: 10, right: 10,bottom:12 })
+    .width('100%')
+  }
+
+  build() {
+    Column() {
+      this.topTitleBar()
+      // Column() {
+      //   Line().width('100%').height('100%')
+      // }
+      // .height(this.topRectHeight)
+      // .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
+      // .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
+      //
+      // // 自定义标题栏
+      // Stack() {
+      //   // 居中标题
+      //   Text('通用设置')
+      //     .fontSize(20)
+      //     .fontColor(Color.White)
+      //     .align(Alignment.Center)
+      //   // 左侧返回按钮
+      //   Row() {
+      //     Image($r('app.media.left_back_white'))
+      //       .width(26)
+      //       .height(26)
+      //       .margin({ left: 12, right: 8 })
+      //       .onClick(() => {
+      //         this.getUIContext()?.animateTo({ duration: 555 }, () => {
+      //           // 动画闭包内控制Image组件的出现和消失
+      //           // this.isShowDrawer = !this.isShowDrawer
+      //           // this.offsetX = 0
+      //           this.mType =0
+      //         })
+      //       })
+      //     Blank().flexGrow(1)
+      //     Blank().width(32)
+      //   }
+      //   .height(48)
+      //   .width('100%')
+      //   .alignItems(VerticalAlign.Center)
+      // }
+      // .height(48)
+      // .width('100%')
+      // .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
 
       Scroll() {
         Column() {

+ 2 - 6
entry/src/main/ets/pages/SplashIndex.ets

@@ -6,11 +6,7 @@ import { router, window } from '@kit.ArkUI'
 import { CommonConstants, STR_LOCK_VIDEO, VIP_FILEPATH } from '../common/constants/CommonConstants'
 import { CSJUtil } from '../common/util/CSJUtil'
 import { ConfigManager } from '../common/util/ConfigManager'
-// import { AdSlotBuilder, CSJAdCreator, CSJAdSdk, CSJSplashAd,
-//   CSJSplashAdCloseType,
-//   CSJSplashAdInteractionListener,
-//   CSJSplashAdLoadListener,
-//   CSJSplashAdLoadParam,} from '@csj/openadsdk'
+import ScreenUtil from '../controller/ScreenUtil'
 import { UIUtil } from '../common/util/UIUtil'
 import { PrintBiddingTokenUtils } from '../common/util/PrintBiddintTokenUtils'
 import { DemoConstants } from '../entryability/DemoConstants'
@@ -134,7 +130,7 @@ struct  SplashIndex{
   @State videoLocalList: VideoItem[] = []
   @State expireDate:string = ''
   async mkDownLoadDir(){
-
+    ScreenUtil.init(this.context)
     const documentViewPicker = new picker.DocumentViewPicker()
     let documentSaveResult = await documentViewPicker.save({ pickerMode: picker.DocumentPickerMode.DOWNLOAD })
     let download_path = new fileUri.FileUri(documentSaveResult[0]).path

+ 44 - 37
entry/src/main/ets/pages/UserCenter.ets

@@ -23,6 +23,7 @@ import UserUtil, { VipFeature, VipPlanApi, VipPlanListApiResponse, WeChatPrepayI
 import { Utility } from '../common/util/Utility';
 import { pinyin4js } from '@ohos/pinyin4js';
 import { CustomContentDialog } from '@kit.ArkUI';
+import { ButtonFancyModifier, ShadowModifier, SymbolGlyphFancyModifier } from '../common/util/AttributeModifierUtil';
 
 
 // 微信支付相关工具方法
@@ -135,6 +136,7 @@ export struct UserCenter {
   @State subscriptionEndDate: string = '';
   @State isForever: boolean = false;
   @StorageProp('currentBreakpoint') currentBreakpoint: string = BreakpointTypeEnum.MD;
+  @StorageProp('topSafeHeight') topSafeHeight: number = 0;
   @State vipFeatures: VipFeature[] = [
     {
       icon: $r('app.media.wusunyinzhi'),
@@ -440,46 +442,51 @@ export struct UserCenter {
     this.wxEventHandler.unregisterOnWXRespCallback(this.onWXResp)
   }
 
-  build() {
+
+  @Builder
+  topTitleBar(){
     Column() {
-      // 顶部安全区和自定义标题栏
-      Column() {
-        // 顶部安全区
-        Blank()
-          .height(this.topRectHeight)
-          .backgroundColor(this.isDarkMode ? $r('app.color.title_bar_bg') : this.themeColor)
-          .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
-        // 自定义标题栏(Stack实现绝对居中)
-        Stack() {
-          // 居中标题
-          Text('用户中心')
-            .fontSize(18)
-            .fontColor(Color.White)
-            .align(Alignment.Center)
-          // 左右按钮
-          Row() {
-            Image($r('app.media.menu'))
-              .width(26)
-              .height(26)
-              .margin({ left: 12, right: 8 })
-              .onClick(() => {
-                animateTo({ duration: 555 }, () => {
-                  // 动画闭包内控制Image组件的出现和消失
-                  this.isShowDrawer = !this.isShowDrawer
-                  this.offsetX = 0
-                })
-              })
-            Blank().flexGrow(1)
-            Blank().width(32)
-          }
-          .height(48)
-          .width('100%')
-          .alignItems(VerticalAlign.Center)
+      Row({ space: 15 }) {
+
+        //左侧滑动按钮
+        Button({ type: ButtonType.Circle, stateEffect: true }) {
+          SymbolGlyph($r('sys.symbol.sort'))
+            .attributeModifier(new SymbolGlyphFancyModifier(25, '', ''))
         }
-        .height(48)
-        .width('100%')
-        .backgroundColor(this.isDarkMode ? $r('app.color.user_center_card_background') : this.themeColor)
+        .attributeModifier(new ButtonFancyModifier(40, 40))
+        .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+        .animation({ duration: 300, curve: Curve.Ease })
+        .onClick(() => {
+          this.getUIContext().animateTo({ duration: 555 }, () => {
+            // 动画闭包内控制Image组件的出现和消失
+            this.isShowDrawer = !this.isShowDrawer
+            this.offsetX = 0
+          })
+
+        })
+        .attributeModifier(new ShadowModifier())
+        .zIndex(0)
+
+        Text("用户中心")
+          .margin({left:3,right:10})
+          .fontColor($r('app.color.text_color'))
+          .fontSize(19)
+          .maxLines(1)
+          .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
+          .layoutWeight(1)
+          .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
+
+
       }
+    }
+    .padding({ top: this.topSafeHeight+10, left: 10, right: 10,bottom:12 })
+    .width('100%')
+  }
+
+  build() {
+    Column() {
+      // 顶部安全区和自定义标题栏
+      this.topTitleBar()
 
       Scroll() {
         Column() {

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

@@ -1682,6 +1682,45 @@ export struct LocalMusic {
           return b.cTime.localeCompare(a.cTime);
         });
         break;
+      case 8:
+        this.videoLocalList.sort((a:  VideoItem, b: VideoItem): number => {
+          // 1. Sort by type first
+          const typeOrder: number = getTypeOrder(a.type)  - getTypeOrder(b.type);
+          if (typeOrder !== 0) {
+            return typeOrder;
+          }
+
+          // 2. Then sort by artist count (numeric comparison)
+          let  sortMap:Map<string, VideoItem[]>= new Map<string, VideoItem[]>();
+          if(this.modeType === 2){
+            sortMap = this.artistMap
+          }else{
+            sortMap = this.albumMap
+          }
+          const aArtistCount: number = sortMap.get(a.name)?.length  || 0;
+          const bArtistCount: number = sortMap.get(b.name)?.length  || 0;
+          return aArtistCount - bArtistCount;
+        });
+        break;
+      case 9:
+        this.videoLocalList.sort((a:  VideoItem, b: VideoItem): number => {
+          // 1. Sort by type first
+          const typeOrder: number = getTypeOrder(a.type)  - getTypeOrder(b.type);
+          if (typeOrder !== 0) {
+            return typeOrder;
+          }
+
+          let  sortMap:Map<string, VideoItem[]>= new Map<string, VideoItem[]>();
+          if(this.modeType === 2){
+            sortMap = this.artistMap
+          }else{
+            sortMap = this.albumMap
+          }
+          const aArtistCount: number = sortMap.get(a.name)?.length  || 0;
+          const bArtistCount: number = sortMap.get(b.name)?.length  || 0;
+          return bArtistCount - aArtistCount;
+        });
+        break;
     }
   }
 

+ 1 - 22
entry/src/main/ets/viewmodel/MainViewModel.ets

@@ -59,33 +59,12 @@ export  class  MainViewModel{
 
       new ItemData($r('app.string.setting'),  { type: 'symbol', value: $r('sys.symbol.gearshape') },MainViewModel.MENU_SETTING,false),
       new ItemData($r('app.string.about_me'), { type: 'symbol', value: $r('sys.symbol.info_shield') },MainViewModel.MENU_ABOUT,false),
-      // new ItemData($r('app.string.haoping'), { type: 'symbol', value: $r('sys.symbol.flower') },MainViewModel.MENU_HAOPING,false),
-      // new ItemData($r('app.string.persion_duty'),{ type: 'symbol', value: $r('sys.symbol.doc_plaintext') },MainViewModel.MENU_DUTY,false),
-      // new ItemData($r('app.string.yszc'), { type: 'symbol', value: $r('sys.symbol.lock') },MainViewModel.MENU_YSZC,false),
-      new ItemData($r('app.string.share_tt'),  { type: 'symbol', value: $r('sys.symbol.share') },MainViewModel.MENU_SHARE,false),
-      // new ItemData($r('app.string.nor_setting'), $r('app.media.hm_gps'),MainViewModel.MENU_SETTING,false),
-    ];
-    return drawerGridData;
-  }
-
-  getDrawerData2(): Array<ItemData> {
-    let drawerGridData: ItemData[] = [
-      new ItemData($r('app.string.local_music'), { type: 'symbol', value: $r('sys.symbol.music') }, MainViewModel.MENU_MUSIC, false),
-      new ItemData($r('app.string.user_center'), { type: 'symbol', value: $r('sys.symbol.person') }, MainViewModel.MENU_USER, false),
-      new ItemData($r('app.string.file_scan'), { type: 'symbol', value: $r('sys.symbol.doc_text_badge_magnifyingglass') },MainViewModel.MENU_FILE_SCAN,false),
-      new ItemData($r('app.string.music_charts'), { type: 'symbol', value: $r('sys.symbol.doc_plaintext') },MainViewModel.MENU_CHARTS,false),
 
-      new ItemData($r('app.string.setting'),  { type: 'symbol', value: $r('sys.symbol.gearshape') },MainViewModel.MENU_SETTING,false),
-      new ItemData($r('app.string.about_me'), { type: 'symbol', value: $r('sys.symbol.info_shield') },MainViewModel.MENU_ABOUT,false),
-      // new ItemData($r('app.string.vip'), { type: 'symbol', value: $r('sys.symbol.vip_hand') }, MainViewModel.MENU_VIP, false),
-      //new ItemData($r('app.string.haoping'), { type: 'symbol', value: $r('sys.symbol.flower') },MainViewModel.MENU_HAOPING,false),
-      // new ItemData($r('app.string.persion_duty'),{ type: 'symbol', value: $r('sys.symbol.doc_plaintext') },MainViewModel.MENU_DUTY,false),
-      // new ItemData($r('app.string.yszc'), { type: 'symbol', value: $r('sys.symbol.lock') },MainViewModel.MENU_YSZC,false),
-      new ItemData($r('app.string.share_tt'),  { type: 'symbol', value: $r('sys.symbol.share') },MainViewModel.MENU_SHARE,false),
     ];
     return drawerGridData;
   }
 
+
   //首页安全体检,查看密码,网络测速的模块数据
   getWiFiGridData(): Array<ItemData> {
     let firstGridData: ItemData[] = [

+ 4 - 0
entry/src/main/resources/dark/element/color.json

@@ -204,6 +204,10 @@
     {
       "name": "cancel_button_text",
       "value": "#F5F5F5"
+    },
+    {
+      "name": "start_window_background_blur",
+      "value": "#333333"
     }
   ]
 }