|
|
@@ -73,7 +73,6 @@ import { CommonConstants2 } from '../common/util/CommonConstants2';
|
|
|
import { hilog } from '@kit.PerformanceAnalysisKit';
|
|
|
import { LazyDataSource } from '../common/util/LazyDataSource';
|
|
|
import MediaTable from '../common/util/MediaTable';
|
|
|
-import { ImageKnifeComponent } from '@ohos/imageknife';
|
|
|
import NetAxiosUtil from '../common/util/NetAxiosUtil';
|
|
|
import ImageUtils from '../common/util/ImageUtils';
|
|
|
import { ringtone } from '@kit.RingtoneKit';
|
|
|
@@ -171,6 +170,7 @@ export struct LocalMusic {
|
|
|
@State isShowHistory:boolean = true //是否显示最近播放
|
|
|
@State isCustomizeBg: boolean = false //自定义背景界面
|
|
|
@State isGridMusic: boolean = false //是否网格布局
|
|
|
+ @State isScrollHide: boolean = false //是否滚动隐藏
|
|
|
@State customizeBgPath: string | undefined = '';
|
|
|
@State isDarkMode: boolean = false
|
|
|
@State lyricTextWeight: number = 400
|
|
|
@@ -366,6 +366,7 @@ export struct LocalMusic {
|
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
|
this.isGridMusic = PreferencesUtil.getBooleanSync(SettingPage.IS_GRID_MUSIC, false)
|
|
|
+ this.isScrollHide = PreferencesUtil.getBooleanSync(SettingPage.IS_SCROLL_HIDE, false)
|
|
|
if(this.isCustomizeBg){
|
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor(Color.Transparent)
|
|
|
this.titleBarModel.setTitleBarBackground(Color.Transparent)
|
|
|
@@ -483,6 +484,7 @@ export struct LocalMusic {
|
|
|
this.isCustomizeBg = PreferencesUtil.getBooleanSync(SettingPage.IS_CUSTOMIZE_BG, false)
|
|
|
this.customizeBgPath = PreferencesUtil.getStringSync(SettingPage.IS_CUSTOMIZE_BG_PATH, '')
|
|
|
this.isGridMusic = PreferencesUtil.getBooleanSync(SettingPage.IS_GRID_MUSIC, false)
|
|
|
+ this.isScrollHide = PreferencesUtil.getBooleanSync(SettingPage.IS_SCROLL_HIDE, false)
|
|
|
if(this.isCustomizeBg){
|
|
|
this.titleBarModel.setRightTitleStateNormalStyleColor(Color.Transparent)
|
|
|
this.titleBarModel.setTitleBarBackground(Color.Transparent)
|
|
|
@@ -1758,9 +1760,11 @@ export struct LocalMusic {
|
|
|
Column() {
|
|
|
this.tabTitle()
|
|
|
this.listViewTitle()
|
|
|
- this.getGridView()
|
|
|
- this.getListView()
|
|
|
-
|
|
|
+ if(this.isGridMusic){
|
|
|
+ this.getGridView()
|
|
|
+ }else {
|
|
|
+ this.getListView()
|
|
|
+ }
|
|
|
}
|
|
|
.layoutWeight(1)
|
|
|
.height('100%')
|
|
|
@@ -1875,7 +1879,7 @@ export struct LocalMusic {
|
|
|
}
|
|
|
.hitTestBehavior(HitTestMode.Transparent)
|
|
|
.position({ bottom: 0 }) // 将 Row 固定在底部
|
|
|
- .opacity(this.barOpacity)
|
|
|
+ .opacity(this.barBottomOpacity)
|
|
|
}
|
|
|
.width('100%')
|
|
|
.height('100%')
|
|
|
@@ -2889,7 +2893,11 @@ export struct LocalMusic {
|
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
- this.setBarHeightNormal()
|
|
|
+ if(this.isScrollHide){
|
|
|
+ this.setBarHeightHide2(offset)
|
|
|
+ }else{
|
|
|
+ this.setBarHeightNormal()
|
|
|
+ }
|
|
|
}else{
|
|
|
this.setBarHeightHide(offset)
|
|
|
}
|
|
|
@@ -3296,13 +3304,20 @@ export struct LocalMusic {
|
|
|
}).getValue(this.currentBreakpoint)
|
|
|
)
|
|
|
.onScrollFrameBegin((offset: number) => {
|
|
|
+
|
|
|
//滚动小屏幕 比如puraX外屏和手机横屏可以隐藏bottomBarHeight topBarHeight
|
|
|
if(this.isPhoneLan()){
|
|
|
this.setBarHeightHide(offset)
|
|
|
}else if (this.currentWidthBreakpoint !== WidthBreakpoint.WIDTH_SM ||
|
|
|
(this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_MD &&
|
|
|
this.currentHeightBreakpoint !== HeightBreakpoint.HEIGHT_SM)) {
|
|
|
+ if(this.isScrollHide){
|
|
|
+ this.setBarHeightHide2(offset)
|
|
|
+
|
|
|
+ }else{
|
|
|
this.setBarHeightNormal()
|
|
|
+ }
|
|
|
+
|
|
|
}else{
|
|
|
this.setBarHeightHide(offset)
|
|
|
}
|
|
|
@@ -3320,6 +3335,7 @@ export struct LocalMusic {
|
|
|
this.bottomBarHeight = 55 + 0;
|
|
|
this.topBarHeight = 50 + 0;
|
|
|
this.barOpacity = 1;
|
|
|
+ this.barBottomOpacity = 1
|
|
|
this.currentYOffset = 0;
|
|
|
this.isHiding = false;
|
|
|
});
|
|
|
@@ -3332,9 +3348,11 @@ export struct LocalMusic {
|
|
|
this.bottomBarHeight = this.bottomBarHeight * (1 - this.currentYOffset / 100);
|
|
|
this.topBarHeight = this.topBarHeight * (1 - this.currentYOffset / 100);
|
|
|
this.barOpacity = 1 - this.currentYOffset / 100;
|
|
|
+ this.barBottomOpacity = 1 - this.currentYOffset / 100;
|
|
|
} else {
|
|
|
this.topBarHeight = 0;
|
|
|
this.bottomBarHeight = 0;
|
|
|
+ this.barBottomOpacity = 0
|
|
|
this.barOpacity = 0;
|
|
|
this.hideDone = true;
|
|
|
}
|
|
|
@@ -3346,6 +3364,33 @@ export struct LocalMusic {
|
|
|
duration: 300
|
|
|
}, () => {
|
|
|
this.bottomBarHeight = 55 + 0;
|
|
|
+ this.topBarHeight = 50 + 0;
|
|
|
+ this.barOpacity = 1;
|
|
|
+ this.barBottomOpacity = 1
|
|
|
+ this.currentYOffset = 0;
|
|
|
+ this.isHiding = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //这个方法没隐藏bottomBar,只隐藏topBar
|
|
|
+ setBarHeightHide2(offset: number){
|
|
|
+ if (offset > 0 && !this.hideDone) {
|
|
|
+ this.currentYOffset += offset;
|
|
|
+ if (this.currentYOffset <= 100) {
|
|
|
+ this.topBarHeight = this.topBarHeight * (1 - this.currentYOffset / 100);
|
|
|
+ this.barOpacity = 1 - this.currentYOffset / 100;
|
|
|
+ } else {
|
|
|
+ this.topBarHeight = 0;
|
|
|
+ this.barOpacity = 0;
|
|
|
+ this.hideDone = true;
|
|
|
+ }
|
|
|
+ this.isHiding = true;
|
|
|
+ }
|
|
|
+ if (offset < 0 && this.isHiding) {
|
|
|
+ this.hideDone = false;
|
|
|
+ this.getUIContext().animateTo({
|
|
|
+ duration: 300
|
|
|
+ }, () => {
|
|
|
this.topBarHeight = 50 + 0;
|
|
|
this.barOpacity = 1;
|
|
|
this.currentYOffset = 0;
|
|
|
@@ -4589,6 +4634,7 @@ export struct LocalMusic {
|
|
|
@StorageProp('currentWidthBreakpoint') currentWidthBreakpoint: WidthBreakpoint | undefined = WidthBreakpoint.WIDTH_SM;
|
|
|
@State topBarHeight: number = 50
|
|
|
@State barOpacity: number = 1
|
|
|
+ @State barBottomOpacity: number = 1
|
|
|
private hideDone: boolean = false;
|
|
|
@State currentYOffset: number = 0;
|
|
|
@State bottomBarHeight: number = 55;
|