|
@@ -115,7 +115,7 @@ import '../common/network/RemoteCacheRegistry';
|
|
|
import { ServerLogUtil } from '../common/util/ServerLogUtil';
|
|
import { ServerLogUtil } from '../common/util/ServerLogUtil';
|
|
|
import { lyricService, SongData } from '../common/service/LyricService';
|
|
import { lyricService, SongData } from '../common/service/LyricService';
|
|
|
import { shouldResolveRemoteLyricOnPlay, tryResolveRemotePlaybackLyric } from '../common/util/RemotePlaybackLyricUtil';
|
|
import { shouldResolveRemoteLyricOnPlay, tryResolveRemotePlaybackLyric } from '../common/util/RemotePlaybackLyricUtil';
|
|
|
-import { resolvePlayerDismissTarget } from '../common/util/PlayerDismissHelper';
|
|
|
|
|
|
|
+import { resolvePlayerDismissMorphTarget } from '../common/util/PlayerDismissHelper';
|
|
|
import {
|
|
import {
|
|
|
cloneVideoItem,
|
|
cloneVideoItem,
|
|
|
preloadNextSongIfNeeded,
|
|
preloadNextSongIfNeeded,
|
|
@@ -774,8 +774,12 @@ export struct LocalMusic {
|
|
|
@StorageLink('songList') songList: Array<VideoItem> = [];
|
|
@StorageLink('songList') songList: Array<VideoItem> = [];
|
|
|
@State translateY: number = 0;
|
|
@State translateY: number = 0;
|
|
|
@State playDismissScale: number = 1;
|
|
@State playDismissScale: number = 1;
|
|
|
|
|
+ @State playDismissScaleY: number = 1;
|
|
|
@State playDismissOpacity: number = 1;
|
|
@State playDismissOpacity: number = 1;
|
|
|
@State playDismissTranslateX: number = 0;
|
|
@State playDismissTranslateX: number = 0;
|
|
|
|
|
+ @State playDismissBorderRadius: number = 0;
|
|
|
|
|
+ @State playDismissProxySize: number = 0;
|
|
|
|
|
+ @State playDismissProxyOpacity: number = 0;
|
|
|
@State isShowSheet: boolean = false;
|
|
@State isShowSheet: boolean = false;
|
|
|
@State isShowSheetView: boolean = false;
|
|
@State isShowSheetView: boolean = false;
|
|
|
@State isShowLyricCopySheet: boolean = false;
|
|
@State isShowLyricCopySheet: boolean = false;
|
|
@@ -784,9 +788,12 @@ export struct LocalMusic {
|
|
|
@State isShowTimeCloseView: boolean = false;
|
|
@State isShowTimeCloseView: boolean = false;
|
|
|
private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Vertical });
|
|
private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Vertical });
|
|
|
private playDismissTimer: number = -1;
|
|
private playDismissTimer: number = -1;
|
|
|
- private readonly playDismissDuration: number = 420;
|
|
|
|
|
|
|
+ private readonly playDismissContentDuration: number = 260;
|
|
|
|
|
+ private readonly playDismissDotDuration: number = 160;
|
|
|
private playOpenFromMiniBarPending: boolean = false;
|
|
private playOpenFromMiniBarPending: boolean = false;
|
|
|
private playOpenTimer: number = -1;
|
|
private playOpenTimer: number = -1;
|
|
|
|
|
+ private readonly playOpenDotDuration: number = 120;
|
|
|
|
|
+ private readonly playOpenExpandDuration: number = 300;
|
|
|
@StorageLink('currIndex') curIndex: number = 0;
|
|
@StorageLink('currIndex') curIndex: number = 0;
|
|
|
@Consume isShowDrawer: boolean;
|
|
@Consume isShowDrawer: boolean;
|
|
|
@Consume offsetX: number;
|
|
@Consume offsetX: number;
|
|
@@ -1529,7 +1536,7 @@ export struct LocalMusic {
|
|
|
this.isShowAllBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_ALLBAR, true)
|
|
this.isShowAllBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_ALLBAR, true)
|
|
|
this.twoFingerType = PreferencesUtil.getNumberSync(SettingPage.TWO_FINGER_TYPE, 3)
|
|
this.twoFingerType = PreferencesUtil.getNumberSync(SettingPage.TWO_FINGER_TYPE, 3)
|
|
|
this.isCircleBtn = PreferencesUtil.getBooleanSync(SettingPage.IS_CIRCLE_BTN, true)
|
|
this.isCircleBtn = PreferencesUtil.getBooleanSync(SettingPage.IS_CIRCLE_BTN, true)
|
|
|
- this.isShowPlayPageBack = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_PLAYPAGE_BACK, true)
|
|
|
|
|
|
|
+ this.isShowPlayPageBack = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_PLAYPAGE_BACK, false)
|
|
|
this.isCoverTopBig = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP_BIG, false)
|
|
this.isCoverTopBig = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP_BIG, false)
|
|
|
this.isShowSingleLineLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SLLYRIC, false)
|
|
this.isShowSingleLineLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SLLYRIC, false)
|
|
|
this.isEnableWordByWordLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_ENABLE_WORD_BY_WORD_LYRIC, true)
|
|
this.isEnableWordByWordLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_ENABLE_WORD_BY_WORD_LYRIC, true)
|
|
@@ -9002,7 +9009,7 @@ export struct LocalMusic {
|
|
|
const viewportHeightVp = this.windowHeight > 0 ? px2vp(this.windowHeight) : 800
|
|
const viewportHeightVp = this.windowHeight > 0 ? px2vp(this.windowHeight) : 800
|
|
|
const useFixedBottomMargin = DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_2IN1
|
|
const useFixedBottomMargin = DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_2IN1
|
|
|
|| this.curDisplayIsHiCar
|
|
|| this.curDisplayIsHiCar
|
|
|
- return resolvePlayerDismissTarget(viewportWidthVp, viewportHeightVp, this.bottomSafeHeight, useFixedBottomMargin)
|
|
|
|
|
|
|
+ return resolvePlayerDismissMorphTarget(viewportWidthVp, viewportHeightVp, this.bottomSafeHeight, useFixedBottomMargin)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private clearPlayDismissTimer(): void {
|
|
private clearPlayDismissTimer(): void {
|
|
@@ -9026,7 +9033,11 @@ export struct LocalMusic {
|
|
|
this.translateY = 0
|
|
this.translateY = 0
|
|
|
this.playDismissTranslateX = 0
|
|
this.playDismissTranslateX = 0
|
|
|
this.playDismissScale = 1
|
|
this.playDismissScale = 1
|
|
|
|
|
+ this.playDismissScaleY = 1
|
|
|
this.playDismissOpacity = 1
|
|
this.playDismissOpacity = 1
|
|
|
|
|
+ this.playDismissBorderRadius = 0
|
|
|
|
|
+ this.playDismissProxySize = 0
|
|
|
|
|
+ this.playDismissProxyOpacity = 0
|
|
|
this.scaleValueImage = 1
|
|
this.scaleValueImage = 1
|
|
|
this.scaleValueText = 1
|
|
this.scaleValueText = 1
|
|
|
this.playDragUiOpacity = 1
|
|
this.playDragUiOpacity = 1
|
|
@@ -9037,30 +9048,50 @@ export struct LocalMusic {
|
|
|
this.playOpenFromMiniBarPending = true
|
|
this.playOpenFromMiniBarPending = true
|
|
|
this.translateY = target.translateY
|
|
this.translateY = target.translateY
|
|
|
this.playDismissTranslateX = target.translateX
|
|
this.playDismissTranslateX = target.translateX
|
|
|
- this.playDismissScale = target.scale
|
|
|
|
|
|
|
+ this.playDismissScale = target.circleScaleX
|
|
|
|
|
+ this.playDismissScaleY = target.circleScaleY
|
|
|
this.playDismissOpacity = 0
|
|
this.playDismissOpacity = 0
|
|
|
|
|
+ this.playDismissBorderRadius = target.circleDiameter / 2
|
|
|
|
|
+ this.playDismissProxySize = target.dotDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 1
|
|
|
this.playDragUiOpacity = 0
|
|
this.playDragUiOpacity = 0
|
|
|
- this.scaleValueImage = Math.max(0.72, target.scale)
|
|
|
|
|
- this.scaleValueText = Math.max(0.88, target.scale)
|
|
|
|
|
|
|
+ this.scaleValueImage = Math.max(0.72, target.circleScaleX)
|
|
|
|
|
+ this.scaleValueText = Math.max(0.88, target.circleScaleY)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private startPlayerViewOpenAnimationIfNeeded(): void {
|
|
private startPlayerViewOpenAnimationIfNeeded(): void {
|
|
|
if (!this.playOpenFromMiniBarPending) {
|
|
if (!this.playOpenFromMiniBarPending) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ const target = this.resolveMiniBarDismissTarget()
|
|
|
this.playOpenFromMiniBarPending = false
|
|
this.playOpenFromMiniBarPending = false
|
|
|
this.getUIContext()?.animateTo({
|
|
this.getUIContext()?.animateTo({
|
|
|
- duration: this.playDismissDuration,
|
|
|
|
|
|
|
+ duration: this.playOpenDotDuration,
|
|
|
curve: Curve.Sharp
|
|
curve: Curve.Sharp
|
|
|
}, () => {
|
|
}, () => {
|
|
|
- this.translateY = 0
|
|
|
|
|
- this.playDismissTranslateX = 0
|
|
|
|
|
- this.playDismissScale = 1
|
|
|
|
|
- this.playDismissOpacity = 1
|
|
|
|
|
- this.playDragUiOpacity = 1
|
|
|
|
|
- this.scaleValueImage = 1
|
|
|
|
|
- this.scaleValueText = 1
|
|
|
|
|
|
|
+ this.playDismissProxySize = target.circleDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 1
|
|
|
|
|
+ this.playDismissOpacity = 0
|
|
|
})
|
|
})
|
|
|
|
|
+ this.playOpenTimer = setTimeout(() => {
|
|
|
|
|
+ this.playOpenTimer = -1
|
|
|
|
|
+ this.getUIContext()?.animateTo({
|
|
|
|
|
+ duration: this.playOpenExpandDuration,
|
|
|
|
|
+ curve: Curve.Friction
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.playDismissProxySize = target.circleDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 0
|
|
|
|
|
+ this.translateY = 0
|
|
|
|
|
+ this.playDismissTranslateX = 0
|
|
|
|
|
+ this.playDismissScale = 1
|
|
|
|
|
+ this.playDismissScaleY = 1
|
|
|
|
|
+ this.playDismissOpacity = 1
|
|
|
|
|
+ this.playDismissBorderRadius = 0
|
|
|
|
|
+ this.playDragUiOpacity = 1
|
|
|
|
|
+ this.scaleValueImage = 1
|
|
|
|
|
+ this.scaleValueText = 1
|
|
|
|
|
+ })
|
|
|
|
|
+ }, this.playOpenDotDuration + 16)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
setShowPlayTrue(fromMiniBar: boolean = false){
|
|
setShowPlayTrue(fromMiniBar: boolean = false){
|
|
@@ -9091,23 +9122,40 @@ export struct LocalMusic {
|
|
|
const target = this.resolveMiniBarDismissTarget()
|
|
const target = this.resolveMiniBarDismissTarget()
|
|
|
|
|
|
|
|
this.clearPlayDismissTimer()
|
|
this.clearPlayDismissTimer()
|
|
|
|
|
+ this.clearPlayOpenTimer()
|
|
|
this.getUIContext()?.animateTo({
|
|
this.getUIContext()?.animateTo({
|
|
|
- duration: this.playDismissDuration,
|
|
|
|
|
|
|
+ duration: this.playDismissContentDuration,
|
|
|
curve: Curve.Sharp
|
|
curve: Curve.Sharp
|
|
|
}, () => {
|
|
}, () => {
|
|
|
this.translateY = target.translateY
|
|
this.translateY = target.translateY
|
|
|
this.playDismissTranslateX = target.translateX
|
|
this.playDismissTranslateX = target.translateX
|
|
|
- this.playDismissScale = target.scale
|
|
|
|
|
- this.playDismissOpacity = 0
|
|
|
|
|
|
|
+ this.playDismissScale = target.circleScaleX
|
|
|
|
|
+ this.playDismissScaleY = target.circleScaleY
|
|
|
|
|
+ this.playDismissOpacity = 0.12
|
|
|
|
|
+ this.playDismissBorderRadius = target.circleDiameter / 2
|
|
|
|
|
+ this.playDismissProxySize = target.circleDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 1
|
|
|
this.playDragUiOpacity = 0
|
|
this.playDragUiOpacity = 0
|
|
|
- this.scaleValueImage = Math.max(0.72, target.scale)
|
|
|
|
|
- this.scaleValueText = Math.max(0.88, target.scale)
|
|
|
|
|
|
|
+ this.scaleValueImage = Math.max(0.72, target.circleScaleX)
|
|
|
|
|
+ this.scaleValueText = Math.max(0.88, target.circleScaleY)
|
|
|
})
|
|
})
|
|
|
this.playDismissTimer = setTimeout(() => {
|
|
this.playDismissTimer = setTimeout(() => {
|
|
|
- this.playDismissTimer = -1
|
|
|
|
|
- this.isShowPlay = false
|
|
|
|
|
- this.isShowCoverScaleGuide = false
|
|
|
|
|
- }, this.playDismissDuration + 16)
|
|
|
|
|
|
|
+ this.playDismissOpacity = 0
|
|
|
|
|
+ this.playDismissProxySize = target.circleDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 1
|
|
|
|
|
+ this.getUIContext()?.animateTo({
|
|
|
|
|
+ duration: this.playDismissDotDuration,
|
|
|
|
|
+ curve: Curve.EaseIn
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ this.playDismissProxySize = target.dotDiameter
|
|
|
|
|
+ this.playDismissProxyOpacity = 0
|
|
|
|
|
+ })
|
|
|
|
|
+ this.playDismissTimer = setTimeout(() => {
|
|
|
|
|
+ this.playDismissTimer = -1
|
|
|
|
|
+ this.isShowPlay = false
|
|
|
|
|
+ this.isShowCoverScaleGuide = false
|
|
|
|
|
+ }, this.playDismissDotDuration + 16)
|
|
|
|
|
+ }, this.playDismissContentDuration + 16)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
setShowPlayFalse(){
|
|
setShowPlayFalse(){
|
|
@@ -12274,27 +12322,63 @@ export struct LocalMusic {
|
|
|
.animation({ curve: Curve.Sharp, duration: 300 })
|
|
.animation({ curve: Curve.Sharp, duration: 300 })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ private MusicPlayDismissProxyDot() {
|
|
|
|
|
+ Stack({ alignContent: Alignment.Center }) {
|
|
|
|
|
+ Image(StrUtil.isNotEmpty(this.cover) ? this.cover as string : $r('app.media.alt'))
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .objectFit(ImageFit.Cover)
|
|
|
|
|
+ .alt($r('app.media.alt'))
|
|
|
|
|
+ }
|
|
|
|
|
+ .width(this.playDismissProxySize)
|
|
|
|
|
+ .height(this.playDismissProxySize)
|
|
|
|
|
+ .borderRadius(this.playDismissProxySize)
|
|
|
|
|
+ .clip(true)
|
|
|
|
|
+ .opacity(this.playDismissProxyOpacity)
|
|
|
|
|
+ .translate({ x: this.playDismissTranslateX, y: this.translateY })
|
|
|
|
|
+ .shadow({
|
|
|
|
|
+ radius: 18,
|
|
|
|
|
+ type: ShadowType.BLUR,
|
|
|
|
|
+ color: 'on_primary'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Builder
|
|
@Builder
|
|
|
MusicPlayBuilder() {
|
|
MusicPlayBuilder() {
|
|
|
- Column() {
|
|
|
|
|
- this.IjkMusicPlayerView()
|
|
|
|
|
- }
|
|
|
|
|
- .visualEffect(deviceInfo.sdkApiVersion>=20&&this.bgController?
|
|
|
|
|
- new hdsEffect.HdsEffectBuilder()
|
|
|
|
|
- .shaderEffect({
|
|
|
|
|
- effectType: hdsEffect.EffectType.UV_BACKGROUND_FLOW_LIGHT,
|
|
|
|
|
- animation: {
|
|
|
|
|
- duration: 10000,
|
|
|
|
|
- iterations: -1,
|
|
|
|
|
- autoPlay: true,
|
|
|
|
|
- onFinish: ()=> {
|
|
|
|
|
- console.info('Succeeded in finishing');
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- controller: this.bgController,
|
|
|
|
|
- })
|
|
|
|
|
- .buildEffect():null)
|
|
|
|
|
|
|
+ Stack({ alignContent: Alignment.Center }) {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ this.IjkMusicPlayerView()
|
|
|
|
|
+ }
|
|
|
|
|
+ .visualEffect(deviceInfo.sdkApiVersion>=20&&this.bgController&&this.playDismissOpacity>=1
|
|
|
|
|
+ && this.playDismissProxySize<=0 && this.playDismissBorderRadius<=0 ?
|
|
|
|
|
+ new hdsEffect.HdsEffectBuilder()
|
|
|
|
|
+ .shaderEffect({
|
|
|
|
|
+ effectType: hdsEffect.EffectType.UV_BACKGROUND_FLOW_LIGHT,
|
|
|
|
|
+ animation: {
|
|
|
|
|
+ duration: 10000,
|
|
|
|
|
+ iterations: -1,
|
|
|
|
|
+ autoPlay: true,
|
|
|
|
|
+ onFinish: ()=> {
|
|
|
|
|
+ console.info('Succeeded in finishing');
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ controller: this.bgController,
|
|
|
|
|
+ })
|
|
|
|
|
+ .buildEffect():null)
|
|
|
|
|
+
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .borderRadius(this.playDismissBorderRadius)
|
|
|
|
|
+ .clip(true)
|
|
|
|
|
+ .translate({ x: this.playDismissTranslateX, y: this.translateY })
|
|
|
|
|
+ .scale({ x: this.playDismissScale, y: this.playDismissScaleY })
|
|
|
|
|
+ .opacity(this.playDismissOpacity)
|
|
|
|
|
|
|
|
|
|
+ if (this.playDismissProxySize > 0) {
|
|
|
|
|
+ this.MusicPlayDismissProxyDot()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
.height('100%')
|
|
.height('100%')
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.onAppear(() => {
|
|
.onAppear(() => {
|
|
@@ -12303,9 +12387,6 @@ export struct LocalMusic {
|
|
|
.onDisAppear(() => {
|
|
.onDisAppear(() => {
|
|
|
this.resetMusicPlayDismissState()
|
|
this.resetMusicPlayDismissState()
|
|
|
})
|
|
})
|
|
|
- .translate({ x: this.playDismissTranslateX, y: this.translateY })
|
|
|
|
|
- .scale({ x: this.playDismissScale, y: this.playDismissScale })
|
|
|
|
|
- .opacity(this.playDismissOpacity)
|
|
|
|
|
.gesture(
|
|
.gesture(
|
|
|
PanGesture(this.panOption)
|
|
PanGesture(this.panOption)
|
|
|
.onActionUpdate((event?: GestureEvent) => {
|
|
.onActionUpdate((event?: GestureEvent) => {
|
|
@@ -12332,7 +12413,7 @@ export struct LocalMusic {
|
|
|
duration: 500,
|
|
duration: 500,
|
|
|
curve: Curve.Sharp
|
|
curve: Curve.Sharp
|
|
|
}, () => {
|
|
}, () => {
|
|
|
- this.scaleValueImage = Math.min(1, Math.max(0.5, 1 - this.translateY / 880));
|
|
|
|
|
|
|
+ this.scaleValueImage = Math.min(1, Math.max(0.4, 1 - this.translateY / 400));
|
|
|
console.info('onecold scaleValueImage:', this.scaleValueImage)
|
|
console.info('onecold scaleValueImage:', this.scaleValueImage)
|
|
|
this.scaleValueText = Math.min(1, Math.max(0.88, 1 - this.translateY / 2000));
|
|
this.scaleValueText = Math.min(1, Math.max(0.88, 1 - this.translateY / 2000));
|
|
|
this.playDragUiOpacity = Math.min(1, Math.max(0, 1 - this.translateY / 300));
|
|
this.playDragUiOpacity = Math.min(1, Math.max(0, 1 - this.translateY / 300));
|
|
@@ -14316,7 +14397,6 @@ export struct LocalMusic {
|
|
|
.alt($r('app.media.alt'))
|
|
.alt($r('app.media.alt'))
|
|
|
.margin({ right: 8, left: 8, top: 5 })
|
|
.margin({ right: 8, left: 8, top: 5 })
|
|
|
.aspectRatio(1)
|
|
.aspectRatio(1)
|
|
|
- .geometryTransition('cover') // 绑定标识符
|
|
|
|
|
.opacity(this.opacityValueImage)
|
|
.opacity(this.opacityValueImage)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
.bindContextMenu(this.MenuImageBuilder(this.cover), ResponseType.LongPress,
|
|
.bindContextMenu(this.MenuImageBuilder(this.cover), ResponseType.LongPress,
|
|
@@ -14332,7 +14412,6 @@ export struct LocalMusic {
|
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
.visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
.borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
.clip(true)
|
|
.clip(true)
|
|
|
-
|
|
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 1000, // 与 setInterval 同步
|
|
duration: 1000, // 与 setInterval 同步
|
|
|
curve: Curve.Linear,
|
|
curve: Curve.Linear,
|