|
@@ -299,6 +299,7 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Preview
|
|
@Preview
|
|
|
@Component
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
export struct LocalMusic {
|
|
|
|
|
+ @State showSimple: boolean = true//开启沉浸模式
|
|
|
@State isPaging: boolean = true;//是否分页加载机制
|
|
@State isPaging: boolean = true;//是否分页加载机制
|
|
|
@State isCoverRectangle: boolean = true;
|
|
@State isCoverRectangle: boolean = true;
|
|
|
@State showZMIndex: boolean = false //是否右侧显示字母索引
|
|
@State showZMIndex: boolean = false //是否右侧显示字母索引
|
|
@@ -1070,6 +1071,7 @@ export struct LocalMusic {
|
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
|
}
|
|
}
|
|
|
initSetting() {
|
|
initSetting() {
|
|
|
|
|
+ this.showSimple = PreferencesUtil.getBooleanSync('showSimple', true)
|
|
|
this.showZMIndex = PreferencesUtil.getBooleanSync('showZMIndex', false)
|
|
this.showZMIndex = PreferencesUtil.getBooleanSync('showZMIndex', false)
|
|
|
this.autoHideTitle = PreferencesUtil.getBooleanSync('autoHideTitle', true)
|
|
this.autoHideTitle = PreferencesUtil.getBooleanSync('autoHideTitle', true)
|
|
|
this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
|
|
this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
|
|
@@ -6431,7 +6433,7 @@ export struct LocalMusic {
|
|
|
this.hideAlphabetIndexAfterDelay(1500)
|
|
this.hideAlphabetIndexAfterDelay(1500)
|
|
|
})
|
|
})
|
|
|
.onReachEnd(() => {
|
|
.onReachEnd(() => {
|
|
|
- if(this.modeType === 4 )
|
|
|
|
|
|
|
+ if(this.modeType === 4 )//歌单不能加载下一页
|
|
|
return;
|
|
return;
|
|
|
// 触底加载下一页
|
|
// 触底加载下一页
|
|
|
Logger.info('heanup LocalMusic', `onReachEnd: hasMore=${this.hasMoreData}, isLoading=${this.isLoadingPage}`);
|
|
Logger.info('heanup LocalMusic', `onReachEnd: hasMore=${this.hasMoreData}, isLoading=${this.isLoadingPage}`);
|
|
@@ -10622,11 +10624,9 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
- if(this.curDisplayIsHiCar){
|
|
|
|
|
- this.playModeButton()
|
|
|
|
|
- }else{
|
|
|
|
|
- this.fullButton()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.playModeButton()
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -10780,7 +10780,7 @@ export struct LocalMusic {
|
|
|
BottomView(){
|
|
BottomView(){
|
|
|
Row() {
|
|
Row() {
|
|
|
|
|
|
|
|
- this.playModeButton()
|
|
|
|
|
|
|
+ this.fullButton()
|
|
|
|
|
|
|
|
if(this.currentSong){
|
|
if(this.currentSong){
|
|
|
Button({type:ButtonType.Circle,stateEffect:true}){
|
|
Button({type:ButtonType.Circle,stateEffect:true}){
|
|
@@ -10870,6 +10870,7 @@ export struct LocalMusic {
|
|
|
}
|
|
}
|
|
|
.width(this.isLandscape?'88%':'95%')
|
|
.width(this.isLandscape?'88%':'95%')
|
|
|
.justifyContent(FlexAlign.SpaceAround)
|
|
.justifyContent(FlexAlign.SpaceAround)
|
|
|
|
|
+ .visibility(this.showSimple?Visibility.None:Visibility.Visible)
|
|
|
.height(30)
|
|
.height(30)
|
|
|
.animation({
|
|
.animation({
|
|
|
duration: 666,
|
|
duration: 666,
|
|
@@ -10905,40 +10906,8 @@ export struct LocalMusic {
|
|
|
@Builder
|
|
@Builder
|
|
|
playProgressView() {
|
|
playProgressView() {
|
|
|
Row() {
|
|
Row() {
|
|
|
- Button({ type: ButtonType.Circle, stateEffect: true }) {
|
|
|
|
|
- Column() {
|
|
|
|
|
- if (this.playType === 0) {
|
|
|
|
|
- Image($r('app.media.loop'))
|
|
|
|
|
- .width($r('app.float.control_image_width'))
|
|
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
|
|
- } else if (this.playType === 1) {
|
|
|
|
|
- Image($r('app.media.single'))
|
|
|
|
|
- .width($r('app.float.control_image_width'))
|
|
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
|
|
- } else if (this.playType === 2) {
|
|
|
|
|
- Image($r('app.media.normal_play'))
|
|
|
|
|
- .width($r('app.float.control_image_width'))
|
|
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
|
|
- } else if (this.playType === 3) {
|
|
|
|
|
- Image($r('app.media.random'))
|
|
|
|
|
- .width($r('app.float.control_image_width'))
|
|
|
|
|
- .aspectRatio(CommonConstants.ASPECT_RATIO)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- .visibility(this.is_auto_hide_progress ? Visibility.None : Visibility.Visible)
|
|
|
|
|
- .animation({
|
|
|
|
|
- duration: 666,
|
|
|
|
|
- curve: 'ease-in-out' // 可选动画曲线
|
|
|
|
|
- })
|
|
|
|
|
- .backgroundColor(Color.Transparent)
|
|
|
|
|
- .margin({ right: 10 })
|
|
|
|
|
- .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
|
|
- .onClick(async () => {
|
|
|
|
|
- this.setLoopMode()
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
|
|
+ this.fullButton()
|
|
|
|
|
|
|
|
Text(this.currentTime)
|
|
Text(this.currentTime)
|
|
|
.fontSize($r('app.float.slider_font_size'))
|
|
.fontSize($r('app.float.slider_font_size'))
|
|
@@ -12613,6 +12582,22 @@ export struct LocalMusic {
|
|
|
.width(48)
|
|
.width(48)
|
|
|
.height(24);
|
|
.height(24);
|
|
|
|
|
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.showSimple })
|
|
|
|
|
+ .selectedColor(this.themeColor)
|
|
|
|
|
+ .switchPointColor(Color.White)
|
|
|
|
|
+ .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
|
|
+ .margin({ right: 15 })
|
|
|
|
|
+ .visibility(more.id == 22 ? Visibility.Visible : Visibility.None)
|
|
|
|
|
+ .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
|
|
+ if (more.id == 22) {
|
|
|
|
|
+ this.showSimple = checked;
|
|
|
|
|
+ PreferencesUtil.put('showSimple', this.showSimple)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ .width(48)
|
|
|
|
|
+ .height(24);
|
|
|
|
|
+
|
|
|
Toggle({ type: ToggleType.Switch, isOn: this.isShowBgLiuGUANG })
|
|
Toggle({ type: ToggleType.Switch, isOn: this.isShowBgLiuGUANG })
|
|
|
.selectedColor(this.themeColor)
|
|
.selectedColor(this.themeColor)
|
|
|
.switchPointColor(Color.White)
|
|
.switchPointColor(Color.White)
|
|
@@ -12706,7 +12691,9 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
{ id: 13, image: $r('app.media.rectangle'), title: '封面方形' },
|
|
|
|
|
|
|
|
- { id : 21, image: $r('app.media.kp_music'), title: '开启背景流光' },
|
|
|
|
|
|
|
+ {id : 22, image: $r('app.media.skip'), title: '沉浸式' },
|
|
|
|
|
+
|
|
|
|
|
+ { id : 21, image: $r('app.media.kp_music'), title: '背景双边流光' },
|
|
|
|
|
|
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
|
|
|
|