|
@@ -137,6 +137,7 @@ const ITEM_HEIGHT_BIG: number = 78; // 列表项大高度
|
|
|
@Preview
|
|
@Preview
|
|
|
@Component
|
|
@Component
|
|
|
export struct LocalMusic {
|
|
export struct LocalMusic {
|
|
|
|
|
+ @State tipPopup:boolean = false
|
|
|
@Consume mType: number;
|
|
@Consume mType: number;
|
|
|
@StorageProp('themeColor') themeColor: string =
|
|
@StorageProp('themeColor') themeColor: string =
|
|
|
PreferencesUtil.getStringSync('THEME_COLOR', CommonConstants.DEFAULT_THEME_COLOR);
|
|
PreferencesUtil.getStringSync('THEME_COLOR', CommonConstants.DEFAULT_THEME_COLOR);
|
|
@@ -448,6 +449,10 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
// 组件生命周期
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
aboutToAppear() {
|
|
|
|
|
+ if(PreferencesUtil.getBooleanSync('isFirstTiped',true)){
|
|
|
|
|
+ this.tipPopup = !this.tipPopup
|
|
|
|
|
+ PreferencesUtil.putSync('isFirstTiped',false)
|
|
|
|
|
+ }
|
|
|
this.initSetting()
|
|
this.initSetting()
|
|
|
this.UNKONWN = Utility.resourceToString(this.context, $r('app.string.unknown'));
|
|
this.UNKONWN = Utility.resourceToString(this.context, $r('app.string.unknown'));
|
|
|
this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
@@ -537,7 +542,7 @@ export struct LocalMusic {
|
|
|
this.themeColor = themeColor;
|
|
this.themeColor = themeColor;
|
|
|
this.doChangeSetting()
|
|
this.doChangeSetting()
|
|
|
this.windowClass.on('windowSizeChange', (size) => {
|
|
this.windowClass.on('windowSizeChange', (size) => {
|
|
|
- // LogUtil.info('onecold windowSizeChange')
|
|
|
|
|
|
|
+ LogUtil.info('onecold windowSizeChange')
|
|
|
this.doChangeBarHeight()
|
|
this.doChangeBarHeight()
|
|
|
let viewWidth = px2vp(size.width);
|
|
let viewWidth = px2vp(size.width);
|
|
|
let viewHeight = px2vp(size.height);
|
|
let viewHeight = px2vp(size.height);
|
|
@@ -562,6 +567,7 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
startAutoHide() {
|
|
startAutoHide() {
|
|
|
if(PreferencesUtil.getBooleanSync(SettingPage.IS_AUTO_HIDE_PROGRESS,false)){
|
|
if(PreferencesUtil.getBooleanSync(SettingPage.IS_AUTO_HIDE_PROGRESS,false)){
|
|
|
|
|
+ console.info('onecold startAutoHide')
|
|
|
this.is_auto_hide_progress = false
|
|
this.is_auto_hide_progress = false
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.is_auto_hide_progress = true
|
|
this.is_auto_hide_progress = true
|
|
@@ -3182,6 +3188,17 @@ export struct LocalMusic {
|
|
|
})
|
|
})
|
|
|
.fillColor(this.themeColor)
|
|
.fillColor(this.themeColor)
|
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
|
|
.clickEffect({ level: ClickEffectLevel.MIDDLE, scale: 0.6 })
|
|
|
|
|
+ .bindPopup($$this.tipPopup, {
|
|
|
|
|
+ builder: this.popupBuilder,
|
|
|
|
|
+ placement: Placement.Bottom,
|
|
|
|
|
+ maskColor: 0x33000000,
|
|
|
|
|
+ enableArrow: true,
|
|
|
|
|
+ onStateChange: (e) => {
|
|
|
|
|
+ if (!e.isVisible) {
|
|
|
|
|
+ this.tipPopup = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
.onClick(() => {
|
|
.onClick(() => {
|
|
|
this.isGridMusic = !this.isGridMusic
|
|
this.isGridMusic = !this.isGridMusic
|
|
|
})
|
|
})
|
|
@@ -3200,6 +3217,21 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 第二步:popup构造器定义弹框内容
|
|
|
|
|
+ @Builder popupBuilder() {
|
|
|
|
|
+ Column({ space: 2 }) {
|
|
|
|
|
+ Text('友情提示:双指缩放可以放大缩小列表')
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .fontWeight(FontWeight.Regular)
|
|
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
|
|
+ }
|
|
|
|
|
+ .justifyContent(FlexAlign.SpaceAround)
|
|
|
|
|
+ .width(220)
|
|
|
|
|
+ .height(55)
|
|
|
|
|
+ .padding(15)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//搜索功能的实现
|
|
//搜索功能的实现
|
|
|
@State searchText: string = ''; // 用户输入内容
|
|
@State searchText: string = ''; // 用户输入内容
|
|
|
@State filteredList: Array<VideoItem> = []; // 过滤后的结果
|
|
@State filteredList: Array<VideoItem> = []; // 过滤后的结果
|
|
@@ -5893,17 +5925,11 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
&& this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_SM
|
|
&& this.currentHeightBreakpoint == HeightBreakpoint.HEIGHT_SM
|
|
|
- && this.currentWidthBreakpoint == WidthBreakpoint.WIDTH_MD) { //如果是手机横屏,返回true
|
|
|
|
|
|
|
+ && this.currentWidthBreakpoint == WidthBreakpoint.WIDTH_MD&&this.isLandscape) { //如果是手机横屏,返回true
|
|
|
|
|
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
|
|
- && this.currentBreakpoint !== BreakpointTypeEnum.SM) {
|
|
|
|
|
- if (DisplayUtil.getFoldStatus() === 0) {
|
|
|
|
|
- return true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -6308,7 +6334,7 @@ export struct LocalMusic {
|
|
|
.setEmptyHint("")
|
|
.setEmptyHint("")
|
|
|
.setAnimationDuration(1000)
|
|
.setAnimationDuration(1000)
|
|
|
this.currentLyricAlignMode = PreferencesUtil.getNumberSync('LyricAlignMode', 1)
|
|
this.currentLyricAlignMode = PreferencesUtil.getNumberSync('LyricAlignMode', 1)
|
|
|
- this.blurDegree = PreferencesUtil.getNumberSync('setBlurDegree', 0)
|
|
|
|
|
|
|
+ this.blurDegree = PreferencesUtil.getNumberSync('setBlurDegree', 3)
|
|
|
this.setBlurDegree(this.blurDegree, false)
|
|
this.setBlurDegree(this.blurDegree, false)
|
|
|
this.setLyricAlignMode(this.currentLyricAlignMode, false)
|
|
this.setLyricAlignMode(this.currentLyricAlignMode, false)
|
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSize', 18), false)
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSize', 18), false)
|
|
@@ -6541,7 +6567,7 @@ export struct LocalMusic {
|
|
|
.setEmptyHint("")
|
|
.setEmptyHint("")
|
|
|
.setAnimationDuration(1000)
|
|
.setAnimationDuration(1000)
|
|
|
this.currentLyricAlignModePip = PreferencesUtil.getNumberSync('LyricAlignModePip', 0)
|
|
this.currentLyricAlignModePip = PreferencesUtil.getNumberSync('LyricAlignModePip', 0)
|
|
|
- this.blurDegreePip = PreferencesUtil.getNumberSync('setBlurDegreePip', 2)
|
|
|
|
|
|
|
+ this.blurDegreePip = PreferencesUtil.getNumberSync('setBlurDegreePip', 3)
|
|
|
this.setBlurDegree(this.blurDegreePip, true)
|
|
this.setBlurDegree(this.blurDegreePip, true)
|
|
|
this.setLyricAlignMode(this.currentLyricAlignModePip, true)
|
|
this.setLyricAlignMode(this.currentLyricAlignModePip, true)
|
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSizePip', 18), true)
|
|
this.setLyricTextSize(PreferencesUtil.getNumberSync('LyricTextSizePip', 18), true)
|