王士厅

fix: 音频悬浮窗关闭按钮比播放按钮尺寸偏大

@@ -35,6 +35,7 @@ struct Index { @@ -35,6 +35,7 @@ struct Index {
35 @State @Watch("moveWindow") windowPosition: Position = { x: vp2px(12), y: vp2px(576) }; 35 @State @Watch("moveWindow") windowPosition: Position = { x: vp2px(12), y: vp2px(576) };
36 private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.All }); 36 private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.All });
37 private subWindow:window.Window | null = null 37 private subWindow:window.Window | null = null
  38 + @State start: boolean = true
38 39
39 async aboutToAppear() { 40 async aboutToAppear() {
40 this.subWindow = window.findWindow("subWindow") 41 this.subWindow = window.findWindow("subWindow")
@@ -108,12 +109,13 @@ struct Index { @@ -108,12 +109,13 @@ struct Index {
108 Stack({ alignContent: Alignment.End }) { 109 Stack({ alignContent: Alignment.End }) {
109 Column() { //标题 时间 进度条 110 Column() { //标题 时间 进度条
110 Marquee({ 111 Marquee({
111 - start: true, 112 + start: this.start,
112 step: 5, 113 step: 5,
113 loop: Number.POSITIVE_INFINITY, 114 loop: Number.POSITIVE_INFINITY,
114 fromStart: true, 115 fromStart: true,
115 src: this.audioTitle 116 src: this.audioTitle
116 }) 117 })
  118 + .marqueeUpdateStrategy(MarqueeUpdateStrategy.DEFAULT)
117 .width("60%") 119 .width("60%")
118 .height(20) 120 .height(20)
119 .fontColor('#222222') 121 .fontColor('#222222')
@@ -124,9 +126,10 @@ struct Index { @@ -124,9 +126,10 @@ struct Index {
124 // .onStart(() => { 126 // .onStart(() => {
125 // console.info('Marquee animation complete onStart') 127 // console.info('Marquee animation complete onStart')
126 // }) 128 // })
127 - // .onBounce(() => {  
128 - // console.info('Marquee animation complete onBounce')  
129 - // }) 129 + .onBounce(() => {
  130 + console.info('Marquee animation complete onBounce')
  131 + this.start = false
  132 + })
130 // .onFinish(() => { 133 // .onFinish(() => {
131 // console.info('Marquee animation complete onFinish') 134 // console.info('Marquee animation complete onFinish')
132 // }) 135 // })
@@ -186,8 +189,8 @@ struct Index { @@ -186,8 +189,8 @@ struct Index {
186 })) 189 }))
187 Image($r("app.media.icon_audio_close")) 190 Image($r("app.media.icon_audio_close"))
188 .objectFit(ImageFit.Contain) 191 .objectFit(ImageFit.Contain)
189 - .width(32)  
190 - .height(32) 192 + .width(24)
  193 + .height(24)
191 .gesture( 194 .gesture(
192 TapGesture() 195 TapGesture()
193 .onAction((event: GestureEvent) => { 196 .onAction((event: GestureEvent) => {