Преглед изворни кода

编辑自定义均衡器的UI

onecold пре 6 месеци
родитељ
комит
3f8cf674a2
1 измењених фајлова са 12 додато и 3 уклоњено
  1. 12 3
      entry/src/main/ets/view/EqualizerView.ets

+ 12 - 3
entry/src/main/ets/view/EqualizerView.ets

@@ -9,6 +9,7 @@ import { EventConstants } from '../common/constants/EventConstants';
 import { AnimationHelper, DialogAction, DialogHelper } from '@pura/harmony-dialog';
 import Logger from '../common/util/Logger';
 import { CommonConstants } from '../common/constants/CommonConstants';
+import { Utility } from '../common/util/Utility';
 
 @Component
 export struct EqualizerView {
@@ -400,6 +401,10 @@ export struct EqualizerViewWithCallback {
   }
 
   private onPresetSelect(index: number): void {
+    if (!Utility.isNoble()) {
+      ToastUtil.showToast("该功能需开通会员,非常感谢您的支持!")
+      return
+    }
     if (index >= 0 && index < this.presets.length) {
       const preset = this.presets[index];
       this.currentPresetId = preset.id;
@@ -922,11 +927,15 @@ export struct EqualizerViewWithCallback {
                 .fontWeight(480)
               Blank()
               // 右侧箭头
-              Image($r('app.media.arrow_right'))
-                .width(22)
-                .height(22)
+              SymbolGlyph(this.showCustomPresets?$r('sys.symbol.chevron_down'):$r('sys.symbol.chevron_right'))
+                .fontSize(22)
+                .fontColor([Color.Gray])
                 .margin({ left: 12, right: 15 })
                 .align(Alignment.Center)
+                .animation({
+                  duration: 500,
+                  curve: Curve.Linear
+                })
             }
             .width('100%')
             .height(50)