|
|
@@ -1499,7 +1499,6 @@ export struct LocalMusic {
|
|
|
this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, true)
|
|
|
this.isShowAllBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_ALLBAR, true)
|
|
|
this.twoFingerType = PreferencesUtil.getNumberSync(SettingPage.TWO_FINGER_TYPE, 2)
|
|
|
- this.isCoverTop = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP, true)
|
|
|
this.isCircleBtn = PreferencesUtil.getBooleanSync(SettingPage.IS_CIRCLE_BTN, true)
|
|
|
this.isShowPlayPageBack = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_PLAYPAGE_BACK, true)
|
|
|
this.isCoverTopBig = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP_BIG, false)
|
|
|
@@ -3371,7 +3370,8 @@ export struct LocalMusic {
|
|
|
})
|
|
|
}
|
|
|
.bindContentCover($$this.isShowPlay, this.MusicPlayBuilder(), {
|
|
|
- modalTransition: ModalTransition.DEFAULT,
|
|
|
+ modalTransition: this.isCoverRectangle?ModalTransition.DEFAULT:ModalTransition.NONE,
|
|
|
+ transition: this.isCoverRectangle?null:AnimationHelper.transitionInDown(500),
|
|
|
onWillDisappear: () => {
|
|
|
this.setShowPlayFalse()
|
|
|
},
|
|
|
@@ -5057,11 +5057,11 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Stack() {
|
|
|
|
|
|
- Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.music_red') : item.pixelMapPath)
|
|
|
+ Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.alt') : item.pixelMapPath)
|
|
|
.fillColor(this.themeColor)
|
|
|
.height(this.twoFingerType == 3 ? 55 : this.twoFingerType == 2 ? 50 : 40)
|
|
|
.width(this.twoFingerType == 3 ? 55 : this.twoFingerType == 2 ? 50 : 40)
|
|
|
- .alt($r('app.media.music_red'))
|
|
|
+ .alt($r('app.media.alt'))
|
|
|
.borderRadius(this.isCoverRectangle?9:'100%')
|
|
|
.clip(true)
|
|
|
.draggable(false)
|
|
|
@@ -8230,7 +8230,7 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Stack() {
|
|
|
|
|
|
- Image(StrUtil.isEmpty(currentItem.pixelMapPath) ? $r('app.media.music_red') :
|
|
|
+ Image(StrUtil.isEmpty(currentItem.pixelMapPath) ? $r('app.media.alt') :
|
|
|
currentItem.pixelMapPath)
|
|
|
.fillColor(this.themeColor)
|
|
|
.height(80)
|
|
|
@@ -9127,10 +9127,10 @@ export struct LocalMusic {
|
|
|
Row() {
|
|
|
Stack() {
|
|
|
|
|
|
- Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.music_red') : item.pixelMapPath)
|
|
|
+ Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.alt') : item.pixelMapPath)
|
|
|
.height(this.sonTwoFingerType == 3||this.sonTwoFingerType==4 ? 55 : this.sonTwoFingerType == 2 ? 48 : 40)
|
|
|
.width(this.sonTwoFingerType == 3||this.sonTwoFingerType==4 ? 55 : this.sonTwoFingerType == 2 ? 48 : 40)
|
|
|
- .alt($r('app.media.music_red'))
|
|
|
+ .alt($r('app.media.alt'))
|
|
|
.fillColor(this.themeColor)
|
|
|
.borderRadius(this.isCoverRectangle?11:'100%')
|
|
|
.clip(true)
|
|
|
@@ -9526,8 +9526,6 @@ export struct LocalMusic {
|
|
|
//播放标题
|
|
|
Column() {
|
|
|
this.PlayTitle()
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
.position({ x: 0, y: this.isCoverOpacity() ? 15 : 40 })
|
|
|
.width('100%')
|
|
|
@@ -10871,151 +10869,24 @@ export struct LocalMusic {
|
|
|
|
|
|
@State is_auto_hide_progress: boolean = false //手机横屏自动隐藏播放进退条,点击屏幕可以显示,倒计时4秒后又自动隐藏
|
|
|
@State isCoverRectangle: boolean = false
|
|
|
- @State isCoverTop: boolean = true
|
|
|
// 添加控制缩放的状态变量
|
|
|
@State scaleValueImage: number = 1
|
|
|
@State scaleValueText: number = 1
|
|
|
@Builder
|
|
|
CoverInfo() {
|
|
|
Column() {
|
|
|
-
|
|
|
- //如果是方形,判断是不是封面在顶部,如果不是顶部,显示musicNameInfo, 如果是圆形显示musicNameInfo
|
|
|
- if (this.isCoverRectangle) {
|
|
|
- if (!this.isCoverTop) {
|
|
|
- this.musicNameInfo(false)
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.musicNameInfo(false)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
Stack() {
|
|
|
- // 唱片旋转效果
|
|
|
- Image($r('app.media.ic_music_disc'))
|
|
|
- .width(245)
|
|
|
- .height(245)
|
|
|
- .margin({ right: 20, left: 20 ,top:this.isCoverRectangle||this.isLandscape?0:43})
|
|
|
- .aspectRatio(1)
|
|
|
- .opacity(this.isCoverOpacity() || this.isCoverRectangle ? 0 : 1)
|
|
|
- .visibility(this.isCoverOpacity() || this.isCoverRectangle ? Visibility.None : Visibility.Visible)
|
|
|
- .borderRadius('100%')
|
|
|
- .align(Alignment.Center)
|
|
|
- .clip(true)// .rotate({ x: 0, y: 0, z: 1, angle: this.rotateAngle })
|
|
|
- .rotate({
|
|
|
- angle: this.rotateAngle,
|
|
|
- centerX: "50%",
|
|
|
- centerY: "50%",
|
|
|
- })
|
|
|
- .animation({
|
|
|
- duration: 100,
|
|
|
- curve: Curve.Linear
|
|
|
- })
|
|
|
- .shadow({
|
|
|
- radius: 22,
|
|
|
- type: ShadowType.BLUR,
|
|
|
- color: 'on_primary'
|
|
|
- })
|
|
|
-
|
|
|
Column() {
|
|
|
- if (this.isCoverTop && this.isCoverRectangle) {
|
|
|
- Image(this.cover)
|
|
|
- .height(this.isHiCar()?(px2vp(this.windowHeight)*0.43):
|
|
|
- this.isCoverOpacity()?(px2vp(this.windowHeight)*0.54):'auto')
|
|
|
- .width(this.isHiCar()||this.isCoverOpacity()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
|
|
|
- .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
- .alt($r('app.media.alt'))
|
|
|
- .margin({ right: 8, left: 8, top: 8 })
|
|
|
- .aspectRatio(1)
|
|
|
- .geometryTransition('cover') // 绑定标识符
|
|
|
- .opacity(this.opacityValueImage)
|
|
|
- .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
- // 设置左下角为缩放中心点
|
|
|
- centerX: '0%',
|
|
|
- centerY: '100%' })
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
- .visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
- .borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
- .clip(true)
|
|
|
- .rotate({
|
|
|
- x: 0,
|
|
|
- y: 0,
|
|
|
- z: 1,
|
|
|
- angle: this.rotateAngle
|
|
|
- })
|
|
|
- .shadow({
|
|
|
- radius: 22,
|
|
|
- type: ShadowType.BLUR,
|
|
|
- color: 'on_primary'
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.isMusicBGCover = !this.isMusicBGCover
|
|
|
- })
|
|
|
- // .visualEffect(new hdsEffect.HdsEffectBuilder()
|
|
|
- // .shaderEffect({
|
|
|
- // effectType: hdsEffect.EffectType.DUAL_EDGE_FLOW_LIGHT,
|
|
|
- // animation: {
|
|
|
- // duration: 4000,
|
|
|
- // iterations: -1,
|
|
|
- // autoPlay: true,
|
|
|
- // onFinish: () => {
|
|
|
- // console.info('Succeeded in finishing');
|
|
|
- // }
|
|
|
- // },
|
|
|
- // controller: this.controller,
|
|
|
- // params: {
|
|
|
- // firstEdgeFlowLight: {
|
|
|
- // startPos: 0,
|
|
|
- // endPos: 1.0,
|
|
|
- // color: '#1AD0F1',
|
|
|
- // },
|
|
|
- // secondEdgeFlowLight: {
|
|
|
- // startPos: 0.5,
|
|
|
- // endPos: 1.5,
|
|
|
- // color: '#FFA4E5',
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
- // .buildEffect())
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.musicNameInfo(false)
|
|
|
+ //方形封面布局
|
|
|
+ if (this.isCoverRectangle) {
|
|
|
+ this.RectangleCoverView()
|
|
|
} else {
|
|
|
- Image(this.cover)
|
|
|
- .height(this.isHiCarSmall()?(this.isHiCarKuanBianPing()?140:px2vp(this.windowHeight)*0.38):
|
|
|
- (this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 162))
|
|
|
- .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
- .alt($r('app.media.alt'))
|
|
|
- .geometryTransition('cover') // 绑定标识符
|
|
|
- .margin({ right: 20, left: 20,top:this.isCoverRectangle||this.isLandscape?0:43 })
|
|
|
- .aspectRatio(1)
|
|
|
- .opacity(this.opacityValueImage)
|
|
|
- .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
- // 设置左下角为缩放中心点
|
|
|
- centerX: '0%',
|
|
|
- centerY: '100%' })
|
|
|
- .visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
- .borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
- .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
- .align(Alignment.Center)//
|
|
|
- .clip(true)
|
|
|
- .shadow({
|
|
|
- radius: 22,
|
|
|
- type: ShadowType.BLUR,
|
|
|
- color: 'on_primary'
|
|
|
- })
|
|
|
- .rotate({
|
|
|
- x: 0,
|
|
|
- y: 0,
|
|
|
- z: 1,
|
|
|
- angle: this.rotateAngle
|
|
|
- })
|
|
|
- .onClick(() => {
|
|
|
- this.isMusicBGCover = !this.isMusicBGCover
|
|
|
- })
|
|
|
-
|
|
|
+ //圆形封面布局
|
|
|
+ this.CicleCoverView()
|
|
|
}
|
|
|
|
|
|
+ this.musicNameInfo(false)
|
|
|
+
|
|
|
if (this.isPhoneLan()) {
|
|
|
Text(this.name)
|
|
|
.fontSize(18)
|
|
|
@@ -11032,14 +10903,6 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
.width('100%')
|
|
|
- // 唱针以左上角为点选择逆时针40度
|
|
|
- Image($r('app.media.ic_music_cover_hand'))
|
|
|
- .height(130)
|
|
|
- .margin({ bottom: 220, top: 0 })
|
|
|
- .align(Alignment.Top)
|
|
|
- .rotate({ angle: this.rotateAngle2, centerX: 0, centerY: 0 })
|
|
|
- .opacity(this.isCoverOpacity() || this.isCoverRectangle ? 0 : 1)
|
|
|
- .visibility(this.isHiCar()||this.isCoverOpacity() || this.isCoverRectangle ? Visibility.None : Visibility.Visible)
|
|
|
|
|
|
|
|
|
Column({ space: 8 }) {
|
|
|
@@ -11089,6 +10952,119 @@ export struct LocalMusic {
|
|
|
.clip(true)
|
|
|
|
|
|
}
|
|
|
+ //方形封面布局
|
|
|
+ @Builder
|
|
|
+ RectangleCoverView(){
|
|
|
+
|
|
|
+ Stack({alignContent:Alignment.Center}){
|
|
|
+ Image(this.cover)
|
|
|
+ .height(this.isHiCar()?(px2vp(this.windowHeight)*0.43):
|
|
|
+ this.isCoverOpacity()?(px2vp(this.windowHeight)*0.54):'auto')
|
|
|
+ .width(this.isHiCar()||this.isCoverOpacity()?'auto':this.isBigScreen() ? '72%' : this.isCoverTopBig ? '100%' : '88%')
|
|
|
+ .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
+ .alt($r('app.media.alt'))
|
|
|
+ .margin({ right: 8, left: 8, top: 8 })
|
|
|
+ .aspectRatio(1)
|
|
|
+ .geometryTransition('cover') // 绑定标识符
|
|
|
+ .opacity(this.opacityValueImage)
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
+ .visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
+ .borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
+ .clip(true)
|
|
|
+ .rotate({
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ z: 1,
|
|
|
+ angle: this.rotateAngle
|
|
|
+ })
|
|
|
+ .shadow({
|
|
|
+ radius: 22,
|
|
|
+ type: ShadowType.BLUR,
|
|
|
+ color: 'on_primary'
|
|
|
+ })
|
|
|
+ .onClick(() => {
|
|
|
+ this.isMusicBGCover = !this.isMusicBGCover
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
+ // 设置左下角为缩放中心点
|
|
|
+ centerX: '0%',
|
|
|
+ centerY: '100%' })
|
|
|
+ }
|
|
|
+ @Builder
|
|
|
+ CicleCoverView() {
|
|
|
+ //圆形封面布局
|
|
|
+ Stack({alignContent:Alignment.Center}) {
|
|
|
+ Image($r('app.media.ic_music_disc'))
|
|
|
+ .width(245)
|
|
|
+ .height(245)
|
|
|
+ .margin({ right: 20, left: 20 ,top:this.isCoverRectangle||this.isLandscape?0:50 })
|
|
|
+ .aspectRatio(1)
|
|
|
+ .opacity(this.isCoverOpacity() || this.isCoverRectangle ? 0 : 1)
|
|
|
+ .visibility(this.isCoverOpacity() || this.isCoverRectangle ? Visibility.None : Visibility.Visible)
|
|
|
+ .borderRadius('100%')
|
|
|
+ .align(Alignment.Center)
|
|
|
+ .clip(true)// .rotate({ x: 0, y: 0, z: 1, angle: this.rotateAngle })
|
|
|
+ .rotate({
|
|
|
+ angle: this.rotateAngle,
|
|
|
+ centerX: "50%",
|
|
|
+ centerY: "50%",
|
|
|
+ })
|
|
|
+ .animation({
|
|
|
+ duration: 100,
|
|
|
+ curve: Curve.Linear
|
|
|
+ })
|
|
|
+ .shadow({
|
|
|
+ radius: 22,
|
|
|
+ type: ShadowType.BLUR,
|
|
|
+ color: 'on_primary'
|
|
|
+ })
|
|
|
+ Image(this.cover)
|
|
|
+ .height(this.isHiCarSmall()?(this.isHiCarKuanBianPing()?140:px2vp(this.windowHeight)*0.38):
|
|
|
+ (this.isCoverOpacity() ? (px2vp(this.windowHeight)*0.62) : this.isCoverRectangle ? 320 : 168))
|
|
|
+ .objectFit(this.isCoverRectangle ? ImageFit.Contain : ImageFit.Auto)
|
|
|
+ .alt($r('app.media.alt'))
|
|
|
+ // .geometryTransition('cover') // 绑定标识符
|
|
|
+ .margin({ right: 20, left: 20,
|
|
|
+ top:this.isCoverRectangle||this.isLandscape?0:50})
|
|
|
+ .aspectRatio(1)
|
|
|
+ .opacity(this.opacityValueImage)
|
|
|
+ .visibility(this.isPuraWP() ? Visibility.None : Visibility.Visible)
|
|
|
+ .borderRadius(this.isCoverRectangle ? 20 : '100%')
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.8 })
|
|
|
+ .align(Alignment.Center)//
|
|
|
+ .clip(true)
|
|
|
+ .shadow({
|
|
|
+ radius: 22,
|
|
|
+ type: ShadowType.BLUR,
|
|
|
+ color: 'on_primary'
|
|
|
+ })
|
|
|
+ .rotate({
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ z: 1,
|
|
|
+ angle: this.rotateAngle
|
|
|
+ })
|
|
|
+ .onClick(() => {
|
|
|
+ this.isMusicBGCover = !this.isMusicBGCover
|
|
|
+ })
|
|
|
+
|
|
|
+ // 唱针以左上角为点选择逆时针40度
|
|
|
+ Image($r('app.media.ic_music_cover_hand'))
|
|
|
+ .height(130)
|
|
|
+ .margin({ bottom: 200, top: 0 })
|
|
|
+ // .position({ x: this.windowWidth/2, y: 0 })
|
|
|
+ .align(Alignment.Top)
|
|
|
+ .rotate({ angle: this.rotateAngle2, centerX: 0, centerY: 0 })
|
|
|
+ .opacity(this.isCoverOpacity() || this.isCoverRectangle ? 0 : 1)
|
|
|
+ .visibility(this.isHiCar()||this.isCoverOpacity() || this.isCoverRectangle ? Visibility.None : Visibility.Visible)
|
|
|
+
|
|
|
+ }
|
|
|
+ .scale({ x: this.scaleValueImage, y: this.scaleValueImage,
|
|
|
+ // 设置左下角为缩放中心点
|
|
|
+ centerX: '0%',
|
|
|
+ centerY: '100%' })
|
|
|
+ }
|
|
|
|
|
|
@Builder
|
|
|
private musicNameInfo(isHidden: boolean) {
|
|
|
@@ -11146,7 +11122,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.width(this.isLandscape?'83%':'90%')
|
|
|
.scale({ x: this.scaleValueText, y: this.scaleValueText }) // 添加缩放效果
|
|
|
- .margin({ top:this.isCoverTop?10: 15 })
|
|
|
+ .margin({ top:this.isCoverRectangle?10: 0 })
|
|
|
.visibility(this.isCoverOpacity() || isHidden ? Visibility.None : Visibility.Visible)
|
|
|
}
|
|
|
|
|
|
@@ -12579,7 +12555,7 @@ export struct LocalMusic {
|
|
|
|
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
|
|
|
|
- { id : 21, image: $r('app.media.music_red'), title: '开启背景流光' },
|
|
|
+ { id : 21, image: $r('app.media.kp_music'), title: '开启背景流光' },
|
|
|
|
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
|
|