Browse Source

Merge remote-tracking branch 'origin/feature/webdav' into feature/webdav

chendeben 9 tháng trước cách đây
mục cha
commit
41d9e2b9e4

+ 1 - 1
entry/src/main/ets/Constants.ets

@@ -13,7 +13,7 @@ export class Constants {
   public static readonly AUDIO_EXTENSIONS = ['.mp3','.mp3','.wma','.mp2','.mov','.flac',
     '.midi','.ra','.aac','.ape','.cda','.alac','.m4a','.ogg','.opus','.wv','.aiff','.amr','.aif','.dff'
     ,'.aif','.au','.eac3','.mlp','.tak','.thd','.tta','.wv','.ac3','.amr','.mka','.mpc','.ra',
-    '.asf','.m2ts','.m4b','.mts','.rm','.wtv','.dts','.av3a','.dsd','.dsf']
+    '.asf','.m2ts','.m4b','.mts','.rm','.wtv','.dts','.av3a','.dsd','.dsf','.wav']
 
   // 图片扩展名
   public static readonly IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.webp', '.bmp']

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

@@ -91,7 +91,7 @@ export class CommonConstants {
   static readonly REAL_MUSIC_FORMAT = ['.mp3','.mp3','.wma','.mp2','.mov','.flac',
     '.midi','.ra','.aac','.ape','.cda','.lrc','.alac','.m4a','.ogg','.opus','.wv','.aiff','.amr','.aif','.dff'
     ,'.aif','.au','.eac3','.mlp','.tak','.thd','.tta','.wv','.ac3','.amr','.mka','.mpc','.ra',
-    '.asf','.m2ts','.m4b','.mts','.rm','.wtv','.dts','.av3a','.dsd','.dsf']
+    '.asf','.m2ts','.m4b','.mts','.rm','.wtv','.dts','.av3a','.dsd','.dsf','.wav']
 
 
   // 倍数格式支持列表

+ 41 - 7
entry/src/main/ets/pages/SettingPage.ets

@@ -22,6 +22,8 @@ import { FastForwardSecondInterface } from './FastForwardSecondInterface'
 // @Entry
 @Component
 export struct SettingPage {
+  @State isCopyFileToDownLoad: boolean = false
+  static readonly IS_COPYFILE_TO_DOWNLOAD: string = 'isCopyFileToDownLoad';
   @State fastForwardSeconds: string = '10'
   @State isShowBackFast: boolean = true//快进快退按钮
   @Consume isShowDrawer: boolean;
@@ -261,6 +263,7 @@ export struct SettingPage {
     this.isLongNameRoLL = PreferencesUtil.getBooleanSync('isLongNameRoLL', true)
     this.isShowBackFast  = PreferencesUtil.getBooleanSync('isShowBackFast', false)
     this.fastForwardSeconds  = PreferencesUtil.getStringSync('fastForwardSeconds', '10')
+    this.isCopyFileToDownLoad = PreferencesUtil.getBooleanSync(SettingPage.IS_COPYFILE_TO_DOWNLOAD, false)
     // 只用 themeMode 控制主题
     this.themeMode = PreferencesUtil.getNumberSync(SettingPage.THEME_MODE, 0)
     this.applyThemeMode(this.themeMode)
@@ -585,13 +588,6 @@ export struct SettingPage {
       Scroll() {
         Column() {
 
-
-          // API设置分组
-          this.apiBuilder()
-          //设置教程
-          this.jcBuilder()
-
-
           // 主题设置分组
           Column() {
             Row() {
@@ -797,6 +793,39 @@ export struct SettingPage {
             .height(55)
             .clickEffect({ level: ClickEffectLevel.HEAVY })
 
+            Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
+
+            //导入视频复制一份到DownLoad目录
+            Row() {
+              SymbolGlyph($r('sys.symbol.save'))
+                .fontSize(20)
+                .fontColor([this.themeColor])
+                .alignSelf(ItemAlign.Center)
+                .margin({ left: 15 })
+              Text('导入音乐复制到DownLoad目录')
+                .margin({ left: 8 })
+                .fontSize(15)
+                .fontColor(Color.Gray)
+                .fontWeight(480)
+                .layoutWeight(1)
+              Toggle({ type: ToggleType.Switch, isOn: this.isCopyFileToDownLoad })
+                .selectedColor(this.themeColor)
+                .switchPointColor(Color.White)
+                .margin({ right: 18 })
+                .onChange((checked: boolean) => {
+                  // if(!this.isCopyFileToDownLoad){
+                  //   ToastUtil.showToast("读取内嵌封面和歌词功能需要开启导入复制开关,不然没有权限读取。")
+                  // }
+                  this.isCopyFileToDownLoad = checked;
+                  PreferencesUtil.put(SettingPage.IS_COPYFILE_TO_DOWNLOAD, this.isCopyFileToDownLoad)
+                  this.sendChangeEvent()
+                })
+                .width(50)
+                .height(30);
+            }
+            .height(55)
+            .clickEffect({level:ClickEffectLevel.HEAVY})
+
             Line().width('100%').height(0.3).backgroundColor($r('app.color.index_tab_unselected_font_color'))
             //播放列表透明
             Row() {
@@ -1546,6 +1575,11 @@ export struct SettingPage {
           })
           .padding(0)
 
+
+          // API设置分组
+          this.apiBuilder()
+          //设置教程
+          this.jcBuilder()
           //显示与隐藏设置
           this.xsBuilder()