|
@@ -358,8 +358,8 @@ export struct LocalMusic {
|
|
|
@State isOneKeyTags:boolean = false
|
|
@State isOneKeyTags:boolean = false
|
|
|
@State isFixMessy:boolean = false
|
|
@State isFixMessy:boolean = false
|
|
|
@StorageProp('isLandscape') @Watch('onIsLandscapeChange') isLandscape: boolean = false;
|
|
@StorageProp('isLandscape') @Watch('onIsLandscapeChange') isLandscape: boolean = false;
|
|
|
- @StorageProp('topRectHeight') topRectHeight: number = px2vp(AppUtil.getStatusBarHeight());
|
|
|
|
|
- @StorageProp('bottomRectHeight') bottomRectHeight: number = 0;
|
|
|
|
|
|
|
+ @StorageProp('topSafeHeight') topSafeHeight: number = 0;
|
|
|
|
|
+ @StorageProp('bottomSafeHeight') bottomSafeHeight: number = 0;
|
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
@StorageProp('windowWidth') windowWidth: number = 0;
|
|
|
@StorageProp('windowHeight') windowHeight: number = 0;
|
|
@StorageProp('windowHeight') windowHeight: number = 0;
|
|
|
@StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
|
|
@StorageProp('isHiCarStatus') isHiCarStatus: boolean = false;
|
|
@@ -678,7 +678,6 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
this.initSetting()
|
|
this.initSetting()
|
|
|
this.UNKONWN = Utility.resourceToString(this.context, $r('app.string.unknown'));
|
|
this.UNKONWN = Utility.resourceToString(this.context, $r('app.string.unknown'));
|
|
|
- this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
|
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
|
this.appName = appName
|
|
this.appName = appName
|
|
|
})
|
|
})
|
|
@@ -2385,7 +2384,8 @@ export struct LocalMusic {
|
|
|
.opacity(this.barBottomOpacity)
|
|
.opacity(this.barBottomOpacity)
|
|
|
.width('90%')
|
|
.width('90%')
|
|
|
.borderRadius(20)
|
|
.borderRadius(20)
|
|
|
- .margin({ bottom:this.bottomRectHeight })
|
|
|
|
|
|
|
+ .margin({ bottom:DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_2IN1
|
|
|
|
|
+ ? 30 :this.bottomSafeHeight })
|
|
|
.backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
|
|
.backgroundBlurStyle(BlurStyle.BACKGROUND_ULTRA_THICK)
|
|
|
.backgroundImage( this.cover)
|
|
.backgroundImage( this.cover)
|
|
|
.visibility(this.isMultiSelect ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isMultiSelect ? Visibility.None : Visibility.Visible)
|
|
@@ -2406,6 +2406,44 @@ export struct LocalMusic {
|
|
|
Column() {
|
|
Column() {
|
|
|
|
|
|
|
|
Stack() {
|
|
Stack() {
|
|
|
|
|
+ //libraryname加上去后onKeyEvent监听不了,因为目前的解决方案是上面的XComponent,去掉libraryname
|
|
|
|
|
+ XComponent({ id: 'for_onKeyEvent',type: XComponentType.SURFACE,
|
|
|
|
|
+ controller: this.xcomponentController })
|
|
|
|
|
+ .onLoad(async (event?: object) => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ .focusable(true)
|
|
|
|
|
+ .height(0)
|
|
|
|
|
+ .focusOnTouch(true)
|
|
|
|
|
+ .defaultFocus(true) // 自动获取键盘焦点
|
|
|
|
|
+ .onKeyEvent((event?: KeyEvent) => {
|
|
|
|
|
+ console.info('onecold点击 onKeyEvent')
|
|
|
|
|
+ // If the button type is pressed, the subsequent code will not be executed; the specific button logic will be executed upon release.
|
|
|
|
|
+ if (!event || event.type !== KeyType.Down) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.info('onecold点击 onKeyEvent event.keyCode: ' + event.keyCode)
|
|
|
|
|
+ //空格键 Space key controls pause/play
|
|
|
|
|
+ if (event.keyCode === KeyCode.KEYCODE_SPACE|| event.keyCode === KeyCode.KEYCODE_MEDIA_PLAY_PAUSE) {
|
|
|
|
|
+ this.playOrPause()
|
|
|
|
|
+ }
|
|
|
|
|
+ if (event.keyCode === KeyCode.KEYCODE_DPAD_UP) {
|
|
|
|
|
+ this.playPrevious()
|
|
|
|
|
+ }
|
|
|
|
|
+ if (event.keyCode === KeyCode.KEYCODE_DPAD_DOWN) {
|
|
|
|
|
+ this.playNext()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Right-click to fast forward
|
|
|
|
|
+ if (event.keyCode === KeyCode.KEYCODE_DPAD_RIGHT) {
|
|
|
|
|
+ this.fastForward()
|
|
|
|
|
+ }
|
|
|
|
|
+ // Left-click to rewind
|
|
|
|
|
+ if (event.keyCode === KeyCode.KEYCODE_DPAD_LEFT) {
|
|
|
|
|
+ this.backForward()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
Column() {
|
|
Column() {
|
|
|
|
|
|
|
|
XComponent({
|
|
XComponent({
|
|
@@ -2420,25 +2458,7 @@ export struct LocalMusic {
|
|
|
this.initDelayPlay(event);
|
|
this.initDelayPlay(event);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- .onKeyEvent((event?: KeyEvent) => {
|
|
|
|
|
- // If the button type is pressed, the subsequent code will not be executed; the specific button logic will be executed upon release.
|
|
|
|
|
- if (!event || event.type !== KeyType.Down) {
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- //空格键 Space key controls pause/play
|
|
|
|
|
- if (event.keyCode === KeyCode.KEYCODE_SPACE) {
|
|
|
|
|
- console.info('onecold playOrPause 1999')
|
|
|
|
|
- this.playOrPause()
|
|
|
|
|
- }
|
|
|
|
|
- // Right-click to fast forward
|
|
|
|
|
- if (event.keyCode === KeyCode.KEYCODE_DPAD_RIGHT) {
|
|
|
|
|
- this.sessionFastForwardCallback(15);
|
|
|
|
|
- }
|
|
|
|
|
- // Left-click to rewind
|
|
|
|
|
- if (event.keyCode === KeyCode.KEYCODE_DPAD_LEFT) {
|
|
|
|
|
- this.sessionRewindCallback(15);
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+
|
|
|
.onDestroy(() => {
|
|
.onDestroy(() => {
|
|
|
})
|
|
})
|
|
|
.width('100%')// .width(this.videoWidth)
|
|
.width('100%')// .width(this.videoWidth)
|
|
@@ -2826,7 +2846,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .padding({ top: this.topRectHeight+10, left: 10, right: 10 })
|
|
|
|
|
|
|
+ .padding({ top: this.topSafeHeight+10, left: 10, right: 10 })
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -4219,7 +4239,7 @@ export struct LocalMusic {
|
|
|
getWaterView(){
|
|
getWaterView(){
|
|
|
Scroll(this.scroller) {
|
|
Scroll(this.scroller) {
|
|
|
Column() {
|
|
Column() {
|
|
|
- Blank().height(this.topRectHeight + 55)
|
|
|
|
|
|
|
+ Blank().height(this.topSafeHeight + 55)
|
|
|
|
|
|
|
|
WaterFlow({
|
|
WaterFlow({
|
|
|
scroller:this.waterScroller,
|
|
scroller:this.waterScroller,
|
|
@@ -4668,7 +4688,7 @@ export struct LocalMusic {
|
|
|
Grid(this.scroller, this.layoutOptionsForHeader) {
|
|
Grid(this.scroller, this.layoutOptionsForHeader) {
|
|
|
GridItem() {
|
|
GridItem() {
|
|
|
Column(){
|
|
Column(){
|
|
|
- Blank().height(this.topRectHeight + 45)
|
|
|
|
|
|
|
+ Blank().height(this.topSafeHeight + 45)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -4704,7 +4724,7 @@ export struct LocalMusic {
|
|
|
.editMode(true)
|
|
.editMode(true)
|
|
|
.transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
.transition(TransitionEffect.move(TransitionEdge.BOTTOM)
|
|
|
.animation({ duration: 500, curve: Curve.Ease }))
|
|
.animation({ duration: 500, curve: Curve.Ease }))
|
|
|
- .padding({bottom:this.bottomBarHeight+this.bottomRectHeight+10})
|
|
|
|
|
|
|
+ .padding({bottom:this.bottomBarHeight+this.bottomSafeHeight+10})
|
|
|
.reuseId('grid_item')
|
|
.reuseId('grid_item')
|
|
|
.layoutWeight(1)
|
|
.layoutWeight(1)
|
|
|
.scrollBar(BarState.Off)
|
|
.scrollBar(BarState.Off)
|
|
@@ -5122,6 +5142,10 @@ export struct LocalMusic {
|
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
|
})
|
|
})
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
|
|
+ if (!Utility.isNoble()) {
|
|
|
|
|
+ this.showVipDialog()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.isExtractAcc = !this.isExtractAcc
|
|
this.isExtractAcc = !this.isExtractAcc
|
|
|
})
|
|
})
|
|
|
MenuItem({
|
|
MenuItem({
|
|
@@ -5132,6 +5156,10 @@ export struct LocalMusic {
|
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
|
})
|
|
})
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
|
|
+ if (!Utility.isNoble()) {
|
|
|
|
|
+ this.showVipDialog()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.isConverter = !this.isConverter
|
|
this.isConverter = !this.isConverter
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -5506,11 +5534,11 @@ export struct LocalMusic {
|
|
|
// })
|
|
// })
|
|
|
// .margin({
|
|
// .margin({
|
|
|
// bottom:this.isShowCoverHeader() ? this.bottomBarHeight+30
|
|
// bottom:this.isShowCoverHeader() ? this.bottomBarHeight+30
|
|
|
- // : this.bottomBarHeight+this.topRectHeight+this.topBarHeight+this.offHeight
|
|
|
|
|
|
|
+ // : this.bottomBarHeight+this.topSafeHeight+this.topBarHeight+this.offHeight
|
|
|
// })
|
|
// })
|
|
|
- .contentStartOffset(this.topRectHeight + 55)
|
|
|
|
|
|
|
+ .contentStartOffset(this.topSafeHeight + 55)
|
|
|
.scrollBar(BarState.Off)
|
|
.scrollBar(BarState.Off)
|
|
|
- .contentEndOffset(this.bottomBarHeight+this.bottomRectHeight)
|
|
|
|
|
|
|
+ .contentEndOffset(this.bottomBarHeight+this.bottomSafeHeight)
|
|
|
.cachedCount(6)
|
|
.cachedCount(6)
|
|
|
.reuseId('list_item')
|
|
.reuseId('list_item')
|
|
|
.borderRadius(20)
|
|
.borderRadius(20)
|
|
@@ -9169,7 +9197,7 @@ export struct LocalMusic {
|
|
|
.width(24)
|
|
.width(24)
|
|
|
.clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
.clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
.bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
|
|
.bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
|
|
|
- height: this.isCoverOpacity() ? '95%' : '93%',
|
|
|
|
|
|
|
+ height: '95%',
|
|
|
preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
|
|
preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
|
|
|
dragBar: true,
|
|
dragBar: true,
|
|
|
showClose: true,
|
|
showClose: true,
|