|
|
@@ -343,6 +343,7 @@ export enum SortMode {
|
|
|
@Preview
|
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
|
+ @State isGeKongPlayNext: boolean = true//是否开启隔空手势播放下一首
|
|
|
@State bluetoothDisconnectPause: boolean = false // 蓝牙设备断开暂停
|
|
|
@State isBluetoothConnected: boolean = false // 蓝牙连接状态
|
|
|
@State bluetoothLyricEnabled: boolean = false // 蓝牙歌词开关
|
|
|
@@ -1236,6 +1237,7 @@ export struct LocalMusic {
|
|
|
context.getApplicationContext().setColorMode(colorMode)
|
|
|
}
|
|
|
initSetting() {
|
|
|
+ this.isGeKongPlayNext = PreferencesUtil.getBooleanSync('isGeKongPlayNext', false)
|
|
|
this.bluetoothDisconnectPause = PreferencesUtil.getBooleanSync(SettingPage.BLUETOOTH_DISCONNECT_PAUSE, false)
|
|
|
this.bluetoothLyricEnabled = PreferencesUtil.getBooleanSync(SettingPage.BLUETOOTH_LYRIC_ENABLED, false)
|
|
|
this.bluetoothLyricMode = PreferencesUtil.getNumberSync(SettingPage.BLUETOOTH_LYRIC_MODE, 0)
|
|
|
@@ -5856,8 +5858,8 @@ export struct LocalMusic {
|
|
|
preview: MenuPreviewMode.IMAGE,
|
|
|
previewAnimationOptions: { scale: [0.8, 1.0] },
|
|
|
})
|
|
|
- .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.9, y: 0.9 }).animation({ duration: 300 }),
|
|
|
- TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
+ // .transition(TransitionEffect.asymmetric(TransitionEffect.scale({ x: 0.9, y: 0.9 }).animation({ duration: 300 }),
|
|
|
+ // TransitionEffect.scale({ x: 0, y: 0 })))
|
|
|
.clickEffect({ level: ClickEffectLevel.LIGHT })
|
|
|
.scale({ x: this.scaleItem === index ? 1.02 : 1, y: this.scaleItem === index ? 1.02 : 1 })
|
|
|
.zIndex(this.dragItem === index ? 1 : 0)
|
|
|
@@ -9692,6 +9694,9 @@ export struct LocalMusic {
|
|
|
// 向上滑动:不应用位移动画,保持 translateY = 0
|
|
|
this.translateY = 0;
|
|
|
} else {
|
|
|
+ if(this.isGeKongPlayNext){
|
|
|
+ return
|
|
|
+ }
|
|
|
// 向下滑动:应用位移动画
|
|
|
this.translateY = offsetY;
|
|
|
|
|
|
@@ -9726,6 +9731,11 @@ export struct LocalMusic {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
+ //这里加个变量,是否开启隔空手势播放下一首
|
|
|
+ if(this.isGeKongPlayNext){
|
|
|
+ this.playNext()
|
|
|
+ return
|
|
|
+ }
|
|
|
// 向下滑动:关闭播放页
|
|
|
const shouldClose = this.translateY > minDistance || velocity > minVelocity;
|
|
|
|
|
|
@@ -13083,6 +13093,22 @@ export struct LocalMusic {
|
|
|
.width(48)
|
|
|
.height(24);
|
|
|
|
|
|
+ Toggle({ type: ToggleType.Switch, isOn: this.isGeKongPlayNext })
|
|
|
+ .selectedColor(this.themeColor)
|
|
|
+ .switchPointColor(Color.White)
|
|
|
+ .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
|
|
|
+ .margin({ right: 15 })
|
|
|
+ .visibility(more.id == 27 ? Visibility.Visible : Visibility.None)
|
|
|
+ .onChange((checked: boolean) => { // 选择开关状态变化时触发事件
|
|
|
+ if (more.id == 27) {
|
|
|
+ this.isGeKongPlayNext = checked;
|
|
|
+ PreferencesUtil.put('isGeKongPlayNext', this.isGeKongPlayNext)
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .width(48)
|
|
|
+ .height(24);
|
|
|
+
|
|
|
Toggle({ type: ToggleType.Switch, isOn: this.isShowBgLiuGUANG })
|
|
|
.selectedColor(this.themeColor)
|
|
|
.switchPointColor(Color.White)
|
|
|
@@ -13187,6 +13213,8 @@ export struct LocalMusic {
|
|
|
|
|
|
{ id : 21, image: $r('app.media.kp_music'), title: '背景双边流光' },
|
|
|
|
|
|
+ { id : 27, image: $r('sys.symbol.hand'), title: '隔空手势切歌' },
|
|
|
+
|
|
|
{ id: 8, image: $r('app.media.cut_current'), title: '保存播放模式' },
|
|
|
|
|
|
{ id: 7, image: $r('app.media.playlist2'), title: '播放背景随音乐封面' },
|