|
|
@@ -473,6 +473,7 @@ export struct LocalMusic {
|
|
|
|
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
|
+ this.sonTwoFingerType = PreferencesUtil.getNumberSync('sonTwoFingerType', 3);
|
|
|
let lastCount = AppStorage.get<number>('columnsCount');
|
|
|
if (typeof lastCount != 'undefined') {
|
|
|
this.columns = lastCount;
|
|
|
@@ -6725,7 +6726,7 @@ export struct LocalMusic {
|
|
|
.scale({ x: this.scaleValue, y: this.scaleValue, z: 1 })
|
|
|
.gesture(PinchGesture({ fingers: 2 })
|
|
|
.onActionEnd((event: GestureEvent) => {
|
|
|
- this.setlistTwoFingers()
|
|
|
+ this.setSonListTwoFingers()
|
|
|
})
|
|
|
.onActionUpdate(e => {
|
|
|
this.scaleValue = this.pinchValue * e.scale
|
|
|
@@ -6739,6 +6740,29 @@ export struct LocalMusic {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ setSonListTwoFingers() {
|
|
|
+ this.pinchValue = this.scaleValue;
|
|
|
+ Logger.info('this.pinchValue = ' + this.pinchValue);
|
|
|
+ if (this.pinchValue >= 1) {
|
|
|
+ this.sonTwoFingerType++
|
|
|
+ Logger.info('this.twoFingerType1 = ' + this.sonTwoFingerType);
|
|
|
+ if (this.sonTwoFingerType > 3) {
|
|
|
+ this.sonTwoFingerType = 1
|
|
|
+ PreferencesUtil.put(SettingPage.IS_GRID_MUSIC, this.isGridMusic)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.sonTwoFingerType--
|
|
|
+ Logger.info('this.twoFingerType2 = ' + this.sonTwoFingerType);
|
|
|
+ if (this.sonTwoFingerType < 1) {
|
|
|
+ this.sonTwoFingerType = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PreferencesUtil.put('sonTwoFingerType', this.sonTwoFingerType)
|
|
|
+ this.pinchValue = 1;
|
|
|
+ this.scaleValue = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ @State sonTwoFingerType:number = 3
|
|
|
@Builder
|
|
|
private MusicItemSon(item: VideoItem, index?: number) {
|
|
|
Button({ type: ButtonType.Normal, stateEffect: true }) {
|
|
|
@@ -6746,8 +6770,8 @@ export struct LocalMusic {
|
|
|
Stack() {
|
|
|
|
|
|
Image(StrUtil.isEmpty(item.pixelMapPath) ? $r('app.media.music_red') : item.pixelMapPath)
|
|
|
- .height(this.twoFingerType == 3||this.twoFingerType==4 ? 55 : this.twoFingerType == 2 ? 45 : 38)
|
|
|
- .width(this.twoFingerType == 3||this.twoFingerType==4 ? 55 : this.twoFingerType == 2 ? 35 : 38)
|
|
|
+ .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'))
|
|
|
.fillColor(this.themeColor)
|
|
|
.borderRadius('100%')
|
|
|
@@ -6760,34 +6784,34 @@ export struct LocalMusic {
|
|
|
Column() {
|
|
|
|
|
|
Text(item.name)
|
|
|
- .fontSize(this.twoFingerType == 1 ? 12 : this.twoFingerType == 2 ? 15 : 18)
|
|
|
+ .fontSize(this.sonTwoFingerType == 1 ? 12 : this.sonTwoFingerType == 2 ? 15 : 18)
|
|
|
.fontColor(this.curIndex === index ? this.themeColor :
|
|
|
this.isFrontWhite ? Color.White : $r('app.color.text_color'))
|
|
|
.maxLines(1)
|
|
|
- .margin({ left: this.twoFingerType == 3 ? 18 : 10 })
|
|
|
+ .margin({ left: this.sonTwoFingerType == 3 ? 18 : 10 })
|
|
|
Row() {
|
|
|
Column(){
|
|
|
Text(item.md5Str?.includes('Lossless')?
|
|
|
Utility.resourceToString(this.context,$r('app.string.lossless')):item.md5Str)//音质
|
|
|
- .fontSize(this.twoFingerType == 1 ? 8 : this.twoFingerType == 2 ? 9 : 11)
|
|
|
+ .fontSize(this.sonTwoFingerType == 1 ? 8 : this.sonTwoFingerType == 2 ? 9 : 11)
|
|
|
.padding({ top: 3,right:6,left:6,bottom:3 })
|
|
|
.fontColor(this.currentSong?.filePath === item.filePath ? this.themeColor :
|
|
|
$r('app.color.text_color'))
|
|
|
.fontWeight(500)
|
|
|
.borderRadius(12)
|
|
|
- .margin({ left: this.twoFingerType == 3 ? 12 : 10 })
|
|
|
+ .margin({ left: this.sonTwoFingerType == 3 ? 12 : 10 })
|
|
|
.backgroundColor('#FFC107')
|
|
|
}
|
|
|
.padding({ top: 8 })
|
|
|
Text(StrUtil.isEmpty(item.artist) ? item.cTime : item.artist + ' ' + item?.album)
|
|
|
- .fontSize(this.twoFingerType == 1 ? 11 : this.twoFingerType == 2 ? 12 : 14)
|
|
|
+ .fontSize(this.sonTwoFingerType == 1 ? 11 : this.sonTwoFingerType == 2 ? 12 : 14)
|
|
|
.padding({ top: 8 })
|
|
|
.fontColor(this.curIndex === index ? this.themeColor :
|
|
|
this.isFrontWhite ? $r('app.color.playlistText_color') : $r('app.color.text_color'))
|
|
|
- .margin({ left: this.twoFingerType == 3 ? 5 : 3 })
|
|
|
+ .margin({ left: this.sonTwoFingerType == 3 ? 5 : 3 })
|
|
|
Blank()
|
|
|
Text(item.size)
|
|
|
- .fontSize(this.twoFingerType == 1 ? 11 : this.twoFingerType == 2 ? 12 : 14)
|
|
|
+ .fontSize(this.sonTwoFingerType == 1 ? 11 : this.sonTwoFingerType == 2 ? 12 : 14)
|
|
|
.padding({ top: 8 })
|
|
|
.visibility(StrUtil.isEmpty(item.artist) ? Visibility.Visible : Visibility.None)
|
|
|
.fontColor(this.curIndex === index ? $r('app.color.title_bar_bg_text') :
|
|
|
@@ -6824,7 +6848,7 @@ export struct LocalMusic {
|
|
|
.backgroundColor(Color.Transparent)
|
|
|
.width('100%')
|
|
|
.reuseId('son_item')
|
|
|
- .height(this.twoFingerType == 3 ? ITEM_HEIGHT_BIG : this.twoFingerType == 2 ? ITEM_HEIGHT : ITEM_HEIGHT_SMALL)
|
|
|
+ .height(this.sonTwoFingerType == 3 ? ITEM_HEIGHT_BIG : this.sonTwoFingerType == 2 ? ITEM_HEIGHT+10 : ITEM_HEIGHT_SMALL+10)
|
|
|
.shadow(this.scaleItem === index ? {
|
|
|
radius: 70,
|
|
|
color: '#15000000',
|