Просмотр исходного кода

播放页进度条调整优化

onecold 1 год назад
Родитель
Сommit
315746da25

+ 1 - 0
entry/src/main/ets/entryability/EntryAbility.ets

@@ -186,6 +186,7 @@ export default class EntryAbility extends UIAbility {
             globalThis.windowClass = data // 赋值给全局变量windowClass
 
             let curDisplay = display.getDisplayByIdSync(windowClass.getWindowProperties().displayId);
+            console.info('twocold curDisplay = '+curDisplay.name);
             if(curDisplay.name =='HiCar'||curDisplay.name =='SuperLauncher'){
                 AppStorage.setOrCreate('curDisplayIsHiCar', true);
             }else{

+ 46 - 37
entry/src/main/ets/view/LocalMusic.ets

@@ -7198,50 +7198,59 @@ export struct LocalMusic {
   @Builder
   TopPlayProgressView(){
     Row() {
-      Row(){
-        Text(this.currentTime)
-          .fontSize($r('app.float.slider_font_size'))
-          .fontColor(Color.White)
-          .margin({ right: 3,left:33 })
-        Slider({
-          value: this.progressValue,
-          min: 0,
-          max: this.PROGRESS_MAX_VALUE,
-          step: 1,
-          style: SliderStyle.OutSet
-        })
-          .blockColor('rgba(255,255,255,1)')
-          .trackColor('rgba(255,255,255,0.3)')
-          .selectedColor(Color.White)
-          .trackThickness(PlayConstants.PROGRESS_TRACK_THICKNESS)
-          .layoutWeight(1)
-          .showSteps(false)
-          .showTips(true)
-          .enabled(this.slideEnable)
-          .onChange((value: number, mode: SliderChangeMode) => {
-            // if (mode == 2) {
-            this.isSeekTo = true;
-            this.mDestroyPage = false;
-            this.showLoadIng();
-            LogUtils.getInstance().LOGI("slider-->seekValue start:" + value);
-            let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
-            this.seekTo(seekValue + "");
-            // this.setProgress()
-            LogUtils.getInstance().LOGI("slider-->seekValue end:" + seekValue);
-            this.isSeekTo = false;
-            // }
+      Column(){
+        Row(){
+          Slider({
+            value: this.progressValue,
+            min: 0,
+            max: this.PROGRESS_MAX_VALUE,
+            step: 1,
+            style: SliderStyle.InSet
           })
-        Text(this.totalTime)
-          .fontSize($r('app.float.slider_font_size'))
-          .fontColor(Color.White)
-          .margin({ left:1,right:20 })
+            .blockColor('rgba(255,255,255,1)')
+            .trackColor('rgba(255,255,255,0.3)')
+            .selectedColor(Color.White)
+            .trackThickness(4)
+            .layoutWeight(1)
+            .showSteps(false)
+            .showTips(true)
+            .enabled(this.slideEnable)
+            .onChange((value: number, mode: SliderChangeMode) => {
+              // if (mode == 2) {
+              this.isSeekTo = true;
+              this.mDestroyPage = false;
+              this.showLoadIng();
+              LogUtils.getInstance().LOGI("slider-->seekValue start:" + value);
+              let seekValue = value * (this.mIjkMediaPlayer.getDuration() / 100);
+              this.seekTo(seekValue + "");
+              // this.setProgress()
+              LogUtils.getInstance().LOGI("slider-->seekValue end:" + seekValue);
+              this.isSeekTo = false;
+              // }
+            })
+
+        }
+        .padding({ right: 7,left:28 })
+        Row(){
+          Text(this.currentTime)
+            .fontSize(10)
+            .fontColor(Color.White)
+          Blank()
+            .layoutWeight(1)
+          Text(this.totalTime)
+            .fontSize(10)
+            .fontColor(Color.White)
+        }
+        .justifyContent(FlexAlign.Start)
+        .padding({ right: 18,left:35 })
       }
 
+
     }
     //x5的竖屏模式需要99%
     .width('95%')
     .justifyContent(FlexAlign.Center)
-    .margin({bottom:13})
+    .margin({bottom:5})
     .animation({
       duration: 666,
       curve: 'ease-in-out' // 可选动画曲线