|
|
@@ -74,6 +74,7 @@ import { LrcParser } from '@sgaolei/lrc_parser';
|
|
|
import app from '@system.app';
|
|
|
import { TextNodeController } from './PipLyricTextBuilder';
|
|
|
import { IndexerView } from './IndexerView';
|
|
|
+import { KeyCode } from '@kit.InputKit';
|
|
|
|
|
|
const TAG = 'LocalMusic';
|
|
|
|
|
|
@@ -174,6 +175,7 @@ export struct LocalMusic {
|
|
|
@State isSameTimePlay: boolean = false //是否和其他app同时播放
|
|
|
@State isStartAutoPlay: boolean = false //启动后自动播放
|
|
|
@State isShowPlayPageBack: boolean = false //是否显示播放页返回键
|
|
|
+ @State isShowSingleLineLyric: boolean = false //是否显示播放页返回键
|
|
|
@State isMemoryLastPlay: boolean = false //是否启用应用退出记忆最后一首的播放进度
|
|
|
@State isCoverTopBig: boolean = false//顶部大封面部分手机显示会和播放控制页重叠
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@@ -573,6 +575,7 @@ export struct LocalMusic {
|
|
|
this.isCircleBtn = PreferencesUtil.getBooleanSync(SettingPage.IS_CIRCLE_BTN, false)
|
|
|
this.isShowPlayPageBack = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_PLAYPAGE_BACK, false)
|
|
|
this.isCoverTopBig = PreferencesUtil.getBooleanSync(SettingPage.IS_COVER_TOP_BIG, false)
|
|
|
+ this.isShowSingleLineLyric = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SLLYRIC, false)
|
|
|
if (this.isSavePlayMode) {
|
|
|
this.playType = PreferencesUtil.getNumberSync('musicPlayType', 0)
|
|
|
}
|
|
|
@@ -1907,6 +1910,29 @@ export struct LocalMusic {
|
|
|
this.initDelayPlay(event);
|
|
|
}
|
|
|
})
|
|
|
+ .onLoad((event?: object) => {
|
|
|
+ if (!!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) {
|
|
|
+ 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(() => {
|
|
|
})
|
|
|
.width('100%')// .width(this.videoWidth)
|
|
|
@@ -2558,8 +2584,8 @@ export struct LocalMusic {
|
|
|
});
|
|
|
}
|
|
|
.layoutWeight(1)
|
|
|
- .margin({ left: this.currentBreakpoint !== BreakpointTypeEnum.SM?50:5,
|
|
|
- right: this.currentBreakpoint !== BreakpointTypeEnum.SM?50:5, bottom: 1 });
|
|
|
+ .margin({ left: this.currentBreakpoint !== BreakpointTypeEnum.SM?40:5,
|
|
|
+ right: this.currentBreakpoint !== BreakpointTypeEnum.SM?40:5, bottom: 1 });
|
|
|
});
|
|
|
}
|
|
|
.width('100%')
|
|
|
@@ -5218,6 +5244,21 @@ export struct LocalMusic {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
+ //是不是正常的手机竖屏
|
|
|
+ isPhonePortrait() {
|
|
|
+ LogUtil.info('twocold this.currentHeightBreakpoint = '+this.currentHeightBreakpoint)
|
|
|
+ LogUtil.info('twocold this.currentWidthBreakpoint = '+this.currentWidthBreakpoint)
|
|
|
+ if(DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
+ &&this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_LG
|
|
|
+ &&this.currentWidthBreakpoint==WidthBreakpoint.WIDTH_SM){//如果是手机横屏,返回false
|
|
|
+
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@Builder
|
|
|
IjkMusicPlayerView() {
|
|
|
@@ -5373,7 +5414,7 @@ export struct LocalMusic {
|
|
|
private positionX: number = PlayConstants.POSITION_X;
|
|
|
private positionY: number = PlayConstants.POSITION_Y;
|
|
|
private windowClass: window.Window = globalThis.windowClass
|
|
|
- @State volume: number = 0.5;
|
|
|
+ @State volume: number = 0.8;
|
|
|
@State volumeShow: boolean = PlayConstants.VOLUME_SHOW;
|
|
|
@State bright: number = PlayConstants.BRIGHT;
|
|
|
@State brightShow: boolean = PlayConstants.BRIGHT_SHOW;
|
|
|
@@ -5411,6 +5452,7 @@ export struct LocalMusic {
|
|
|
// 1.初始化controller
|
|
|
private lyricController: LyricController = new LyricController()
|
|
|
private lyricControllerXF: LyricController = new LyricController()//悬浮歌词控制器
|
|
|
+ private lyricControllerSingle: LyricController = new LyricController()//播放页单行歌词控制器
|
|
|
private parser = new LyricParser()
|
|
|
@State randomColor: string = 'rgb(0,0,0)'
|
|
|
@State randomShakenX: number = 0
|
|
|
@@ -5444,21 +5486,32 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
this.initPipLyricSetting()
|
|
|
+ this.lyricControllerSingle
|
|
|
+ .setTextSize(15)
|
|
|
+ .setCacheSize(4)
|
|
|
+ .setTextColor("#FFFFFF")
|
|
|
+ .setHighlightColor("#FFFFFF")
|
|
|
+ .setHighlightScale(1.2)
|
|
|
+ .setEmptyHint("")
|
|
|
+ .setAlignMode('center')
|
|
|
+ .setAnimationDuration(500)
|
|
|
+ .setSingleLine(true)
|
|
|
+
|
|
|
this.lyricContent = ''
|
|
|
this.lyricController
|
|
|
.setTextSize(this.currentLyricSize)
|
|
|
.setCacheSize(4)
|
|
|
.setTextColor("#DDDDDD")
|
|
|
- .setHighlightColor("#FFFFFF")// .setLineSpace(18)
|
|
|
+ .setHighlightColor("#FFFFFF")
|
|
|
.setEmptyHint("")
|
|
|
.setAnimationDuration(1000)
|
|
|
this.currentLyricAlignMode = PreferencesUtil.getNumberSync('LyricAlignMode', 1)
|
|
|
- this.blurDegree = PreferencesUtil.getNumberSync('setBlurDegree', 2)
|
|
|
+ this.blurDegree = PreferencesUtil.getNumberSync('setBlurDegree', 0)
|
|
|
this.setBlurDegree(this.blurDegree,false)
|
|
|
this.setLyricAlignMode(this.currentLyricAlignMode,false)
|
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSize', 18),false)
|
|
|
this.setHighLyricTextSize(PreferencesUtil.getNumberSync('HighLyricTextSize', 1.23),false)
|
|
|
- this.lyricController.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpace', 52))
|
|
|
+ this.lyricController.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpace', 10))
|
|
|
this.changeLyricColor(PreferencesUtil.getStringSync('LyricColor', '#FFFFFF'),false)
|
|
|
this.changeLyricHightLightColor(PreferencesUtil.getStringSync('LyricHighLightColor', '#FFFFFF'),false)
|
|
|
this.isHightLightCenter = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_SIMI, true)
|
|
|
@@ -5468,6 +5521,7 @@ export struct LocalMusic {
|
|
|
this.showSingleLyric = false
|
|
|
this.timeOffset = 0
|
|
|
this.lyricController.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
let jiaMilyricPath = lyricPath.substring(0, lyricPath.lastIndexOf('.')) + '.lrcc'
|
|
|
LogUtil.debug("onecold lyricPath =" + lyricPath)
|
|
|
|
|
|
@@ -5483,6 +5537,7 @@ export struct LocalMusic {
|
|
|
// 4.设置歌词
|
|
|
this.lyricController.setLyric(lyric);
|
|
|
this.lyricControllerXF.setLyric(lyric)
|
|
|
+ this.lyricControllerSingle.setLyric(lyric)
|
|
|
return
|
|
|
|
|
|
}
|
|
|
@@ -5526,6 +5581,7 @@ export struct LocalMusic {
|
|
|
// 4.设置歌词
|
|
|
this.lyricController.setLyric(lyric);
|
|
|
this.lyricControllerXF.setLyric(lyric)
|
|
|
+ this.lyricControllerSingle.setLyric(lyric)
|
|
|
this.showSingleLyric = true
|
|
|
// 4.保存歌词文件lyric到本地
|
|
|
|
|
|
@@ -5535,6 +5591,7 @@ export struct LocalMusic {
|
|
|
} else {
|
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
if (isToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
|
@@ -5544,6 +5601,7 @@ export struct LocalMusic {
|
|
|
} else {
|
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
if (isToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
|
@@ -5554,6 +5612,7 @@ export struct LocalMusic {
|
|
|
} else {
|
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
if (isToast) {
|
|
|
ToastUtil.showShort('未获取到歌词!')
|
|
|
}
|
|
|
@@ -5612,6 +5671,7 @@ export struct LocalMusic {
|
|
|
// 4.设置歌词
|
|
|
this.lyricController.setLyric(lyric);
|
|
|
this.lyricControllerXF.setLyric(lyric)
|
|
|
+ this.lyricControllerSingle.setLyric(lyric)
|
|
|
|
|
|
this.showSingleLyric = true
|
|
|
console.info(`The content of file: ${fileContent}`);
|
|
|
@@ -5619,16 +5679,19 @@ export struct LocalMusic {
|
|
|
console.error("chardet.detect failed with error: " + chardetError.message);
|
|
|
this.lyricController.setLyric(null);
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
}
|
|
|
})
|
|
|
.catch((err: BusinessError) => {
|
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
console.error("read file data failed with error message: " + err.message + ", error code: " + err.code);
|
|
|
})
|
|
|
.catch((err: Error) => {
|
|
|
this.lyricController.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
console.error("read file 2 data failed with error message: " + err.message);
|
|
|
})
|
|
|
.finally(() => {
|
|
|
@@ -5637,6 +5700,7 @@ export struct LocalMusic {
|
|
|
|
|
|
} catch (error) {
|
|
|
this.lyricController.setLyric(null)
|
|
|
+ this.lyricControllerSingle.setLyric(null)
|
|
|
this.lyricControllerXF.setLyric(null)
|
|
|
Logger.error(TAG, 'init Lyric failed with err: ' + JSON.stringify(error));
|
|
|
}
|
|
|
@@ -5658,7 +5722,7 @@ export struct LocalMusic {
|
|
|
this.setLyricAlignMode(this.currentLyricAlignModePip,true)
|
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSizePip', 18),true)
|
|
|
this.setHighLyricTextSize(PreferencesUtil.getNumberSync('HighLyricTextSizePip', 1.23),true)
|
|
|
- this.lyricControllerXF.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpacePip', 52))
|
|
|
+ this.lyricControllerXF.setLineSpace(PreferencesUtil.getNumberSync('LyricLineSpacePip', 10))
|
|
|
this.changeLyricColor(PreferencesUtil.getStringSync('LyricColorPip', '#FFFFFF'),true)
|
|
|
this.changeLyricHightLightColor(PreferencesUtil.getStringSync('LyricHighLightColorPip', '#FFFFFF'),true)
|
|
|
this.lyricControllerXF.setHightLightCenter(true)
|
|
|
@@ -6020,6 +6084,13 @@ export struct LocalMusic {
|
|
|
.layoutWeight(1)
|
|
|
.margin({ left: this.currentLyricAlignMode === 0 ? 0 : 50, top: 2, bottom: this.isPhoneLan() ? 40 :10 })
|
|
|
|
|
|
+
|
|
|
+ if(this.isPhoneLan()){
|
|
|
+ Column() {
|
|
|
+ this.playCenterView()
|
|
|
+ }
|
|
|
+ .margin({bottom:20,right:this.currentLyricAlignMode == 0?0:80})
|
|
|
+ }
|
|
|
}
|
|
|
.position({
|
|
|
top: this.currentBreakpoint !== BreakpointTypeEnum.SM ? (this.isPhoneLan() ? 0 : 45) :
|
|
|
@@ -6027,6 +6098,24 @@ export struct LocalMusic {
|
|
|
})
|
|
|
.justifyContent(FlexAlign.Center)
|
|
|
.height(this.isCoverOpacity() ? '95%' : '80%')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ SingleLyricView() {
|
|
|
+ Column() {
|
|
|
+ Column() {
|
|
|
+ LyricView2({ controller: this.lyricControllerSingle,
|
|
|
+ enableSeek: false,
|
|
|
+ seekUIColor: "#ff0000",// 滑动定位的按钮和文本颜色
|
|
|
+ seekLineColor: "#80ffffff",// 滑动定位线颜色
|
|
|
+ seekUIStyle: "listItem",// 滑动定位样式(seekLine传统样式,listItem类似抖音汽水音乐样式)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .height(48)
|
|
|
+ .margin({bottom:20})
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -6036,111 +6125,119 @@ export struct LocalMusic {
|
|
|
BottomControl() {
|
|
|
Column() {
|
|
|
//播放 暂停,下一首,上一首
|
|
|
+ this.playCenterView()
|
|
|
|
|
|
- Row() {
|
|
|
- Row({ space: 33 }) {
|
|
|
|
|
|
+ //播放进度条
|
|
|
+ this.playProgressView()
|
|
|
|
|
|
- Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
- //更多功能
|
|
|
- Image($r('app.media.menu'))
|
|
|
- .width(24)
|
|
|
- .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
- .bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
|
|
|
- height: this.isCoverOpacity() ? '95%' : '93%',
|
|
|
- preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
|
|
|
- dragBar: true,
|
|
|
- showClose: true,
|
|
|
- blurStyle: BlurStyle.Thin,
|
|
|
- backgroundColor: Color.Transparent,
|
|
|
- })
|
|
|
- }
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
- .onClick(() => {
|
|
|
- this.isShowMoreView = !this.isShowMoreView;
|
|
|
- })
|
|
|
|
|
|
- Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
- Image($r('app.media.ic_previous'))
|
|
|
- .width(33)
|
|
|
- .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
- .onClick(async () => {
|
|
|
- this.playPrevious()
|
|
|
- })
|
|
|
- }
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
+ }
|
|
|
+ .position({ bottom:this.isCoverOpacity()?55: 100 }) // 将 固定在底部
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ //播放控制上一首 下一首 暂停和播放
|
|
|
+ @Builder
|
|
|
+ playCenterView(){
|
|
|
+ Row() {
|
|
|
+ Row({ space: 33 }) {
|
|
|
+
|
|
|
+
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ //更多功能
|
|
|
+ Image($r('app.media.menu'))
|
|
|
+ .width(24)
|
|
|
+ .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
+ .bindSheet($$this.isShowMoreView, this.PlayMoreSheet(), {
|
|
|
+ height: this.isCoverOpacity() ? '95%' : '93%',
|
|
|
+ preferType: this.currentBreakpoint!==BreakpointTypeEnum.SM?SheetType.CENTER:SheetType.BOTTOM,
|
|
|
+ dragBar: true,
|
|
|
+ showClose: true,
|
|
|
+ blurStyle: BlurStyle.Thin,
|
|
|
+ backgroundColor: Color.Transparent,
|
|
|
+ })
|
|
|
}
|
|
|
- .margin({ left: 33 })
|
|
|
+
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .onClick(() => {
|
|
|
+ this.isShowMoreView = !this.isShowMoreView;
|
|
|
+ })
|
|
|
|
|
|
Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
- Column() {
|
|
|
- Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
|
|
|
- (this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
|
|
|
- : (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
|
|
|
- .width(this.isPhoneLan()?48:60)
|
|
|
- .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
- .fillColor(Color.White)
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
- .onClick(async () => {
|
|
|
- this.playOrPause()
|
|
|
+ Image($r('app.media.ic_previous'))
|
|
|
+ .width(33)
|
|
|
+ .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ .onClick(async () => {
|
|
|
+ this.playPrevious()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
|
|
|
+ }
|
|
|
+ // .margin({ left: 20 })
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ Column() {
|
|
|
+ Image(this.CONTROL_PlayStatus === PlayStatus.PLAY ?
|
|
|
+ (this.isCircleBtn?$r('app.media.hm_pause'):$r('app.media.ic_public_play'))
|
|
|
+ : (this.isCircleBtn?$r('app.media.hm_play2'):$r('app.media.ic_public_pause')))
|
|
|
+ .width(this.isPhoneLan()?48:60)
|
|
|
+ .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
+ .fillColor(Color.White)
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ .onClick(async () => {
|
|
|
+ this.playOrPause()
|
|
|
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
- .layoutWeight(1)
|
|
|
- .margin({ left: 33, right: 33 })
|
|
|
|
|
|
+ }
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .layoutWeight(1)
|
|
|
+ .margin({ left: 33, right: 33 })
|
|
|
|
|
|
- Row({ space: 33 }) {
|
|
|
- Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
- Image($r('app.media.ic_next'))
|
|
|
- .width(33)
|
|
|
- .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
- .onClick(() => {
|
|
|
|
|
|
- this.playNext();
|
|
|
+ Row({ space: 33 }) {
|
|
|
+ Button({ type: ButtonType.Capsule, stateEffect: true }) {
|
|
|
+ Image($r('app.media.ic_next'))
|
|
|
+ .width(33)
|
|
|
+ .clickEffect({level:ClickEffectLevel.HEAVY})
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ .onClick(() => {
|
|
|
|
|
|
- })
|
|
|
- }
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
- .width(33)
|
|
|
+ this.playNext();
|
|
|
|
|
|
- Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
- //添加或取消收藏
|
|
|
- Image(Utility.getIsFav(this.favList,this.currentSong)?
|
|
|
- $r('app.media.add_fac_light'):$r('app.media.add_fac'))
|
|
|
- .width(24)
|
|
|
- .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
- .onClick(async () => {
|
|
|
- if(this.currentSong){
|
|
|
- this.doFav(this.currentSong)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
- .width(24)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .width(33)
|
|
|
|
|
|
+ Button({type:ButtonType.Circle,stateEffect:true}){
|
|
|
+ //添加或取消收藏
|
|
|
+ Image(Utility.getIsFav(this.favList,this.currentSong)?
|
|
|
+ $r('app.media.add_fac_light'):$r('app.media.add_fac'))
|
|
|
+ .width(24)
|
|
|
+ .clickEffect({level:ClickEffectLevel.MIDDLE})
|
|
|
+ .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
+ .onClick(async () => {
|
|
|
+ if(this.currentSong){
|
|
|
+ this.doFav(this.currentSong)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- .margin({ right: 33 })
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
+ .width(24)
|
|
|
|
|
|
}
|
|
|
- .width('100%')
|
|
|
- .margin({ left:10,right:10,bottom:this.isCoverOpacity()?0:20 })
|
|
|
- .justifyContent(FlexAlign.Center)
|
|
|
- //播放进度条
|
|
|
- this.playProgressView()
|
|
|
-
|
|
|
+ // .margin({ right: 33 })
|
|
|
|
|
|
}
|
|
|
- .position({ bottom:this.isCoverOpacity()?55: 100 }) // 将 固定在底部
|
|
|
-
|
|
|
+ .width('100%')
|
|
|
+ .margin({ left:10,right:10,bottom:this.isCoverOpacity()?0:20 })
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
}
|
|
|
|
|
|
//播放进度条
|
|
|
@@ -6250,7 +6347,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.width(PlayConstants.PROGRESS_ROW_WIDTH)
|
|
|
.height(this.isPhoneLan()?25:33)
|
|
|
- .visibility(this.isPhoneLan()&&this.isAutoHide?Visibility.None:Visibility.Visible)
|
|
|
+ // .visibility(this.isPhoneLan()&&this.isAutoHide?Visibility.None:Visibility.Visible)
|
|
|
.animation({
|
|
|
duration: 666,
|
|
|
curve: 'ease-in-out' // 可选动画曲线
|
|
|
@@ -6403,11 +6500,39 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
.margin({
|
|
|
- bottom: this.isCoverOpacity() || this.isCoverRectangle ? 55 : 0,
|
|
|
+ bottom: this.isCoverOpacity() || this.isCoverRectangle ?
|
|
|
+ (this.isPhonePortrait()&&this.isShowSingleLineLyric?20:55) : 0,
|
|
|
top: this.isCoverOpacity() ? 0 : 20
|
|
|
})
|
|
|
+ if(this.isPhonePortrait()&&this.isShowSingleLineLyric){
|
|
|
+ this.SingleLyricView()
|
|
|
+ }
|
|
|
+ if(this.isPhoneLan()){
|
|
|
+ Column(){
|
|
|
+ Text(this.name)
|
|
|
+ .fontSize(18)
|
|
|
+ .fontWeight(FontWeight.Bold)
|
|
|
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
+ .maxLines(1)
|
|
|
+ .width('99%')
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .fontColor(Color.White)
|
|
|
+ Text(this.artist + ' ' + this.currentSong?.album)
|
|
|
+ .fontSize(15)
|
|
|
+ .visibility(Visibility.Hidden)
|
|
|
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
+ .fontColor(Color.White)
|
|
|
+ .textAlign(TextAlign.Center)
|
|
|
+ .width('99%')
|
|
|
+ .maxLines(1)
|
|
|
+ this.playProgressView()
|
|
|
+ }
|
|
|
+ .position({bottom:45})
|
|
|
+
|
|
|
+ }else{
|
|
|
+ this.BottomControl()
|
|
|
+ }
|
|
|
|
|
|
- this.BottomControl()
|
|
|
}
|
|
|
|
|
|
.width(CommonConstants.FULL_PERCENT)
|
|
|
@@ -6533,8 +6658,8 @@ export struct LocalMusic {
|
|
|
// 高亮歌词放大倍数
|
|
|
@State currentHightLyricSize: number = 1.2
|
|
|
@State currentHightLyricSizePip: number = 1.2
|
|
|
- @State currentLyricLineSpace: number = 52
|
|
|
- @State currentLyricLineSpacePip: number = 52
|
|
|
+ @State currentLyricLineSpace: number = 10
|
|
|
+ @State currentLyricLineSpacePip: number = 10
|
|
|
@State currentLyricAlignMode: number = 1
|
|
|
@State currentLyricAlignModePip: number = 1
|
|
|
@State blurDegree: number = 2
|
|
|
@@ -6993,9 +7118,9 @@ export struct LocalMusic {
|
|
|
.fontColor(Color.White)
|
|
|
Slider({
|
|
|
value: isPip?this.currentLyricLineSpacePip:this.currentLyricLineSpace,
|
|
|
- min: 8,
|
|
|
+ min: 2,
|
|
|
max: 120,
|
|
|
- step: 0.1,
|
|
|
+ step: 1,
|
|
|
style: SliderStyle.OutSet
|
|
|
})
|
|
|
.blockColor(this.themeColor)
|
|
|
@@ -7578,7 +7703,7 @@ export struct LocalMusic {
|
|
|
sessionType: 'video'
|
|
|
})
|
|
|
.id('AVCastPicker')
|
|
|
- .width(46)
|
|
|
+
|
|
|
} else {
|
|
|
Image(more.image)
|
|
|
.width(24)
|
|
|
@@ -7754,6 +7879,10 @@ export struct LocalMusic {
|
|
|
.fontSize(16)
|
|
|
.fontColor(Color.White)
|
|
|
}
|
|
|
+ .width('100%')
|
|
|
+ .layoutWeight(1)
|
|
|
+ .alignItems(VerticalAlign.Center)
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
}
|
|
|
|
|
|
private moreItems: MoreItem[] = [
|
|
|
@@ -8404,6 +8533,7 @@ export struct LocalMusic {
|
|
|
this.isCurrentTime = true;
|
|
|
this.lyricController.updatePosition(position + this.timeOffset * 1000)
|
|
|
this.lyricControllerXF.updatePosition(position + this.timeOffset * 1000)
|
|
|
+ this.lyricControllerSingle.updatePosition(position + this.timeOffset * 1000)
|
|
|
|
|
|
this.currentTime = this.stringForTime(position);
|
|
|
this.isCurrentTime = false
|