|
|
@@ -188,6 +188,8 @@ export struct LocalMusic {
|
|
|
@State bgBrightness: number = 0 //背景亮度
|
|
|
private listScroller: ListScroller = new ListScroller()
|
|
|
private playListScroller: Scroller = new Scroller()
|
|
|
+ @StorageProp('isLandscape') isLandscape: boolean = false;
|
|
|
+ @StorageProp('topRectHeight') topRectHeight: number = px2vp(AppUtil.getStatusBarHeight());
|
|
|
private listArea: Area = {
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
@@ -399,7 +401,7 @@ export struct LocalMusic {
|
|
|
// 组件生命周期
|
|
|
aboutToAppear() {
|
|
|
this.initSetting()
|
|
|
-
|
|
|
+ this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
|
|
|
Utility.getAppName(getContext(this)).then((appName: string) => {
|
|
|
this.appName = appName
|
|
|
})
|
|
|
@@ -453,10 +455,6 @@ export struct LocalMusic {
|
|
|
|
|
|
this.makeWorker()
|
|
|
|
|
|
- this.windowClass.on('windowSizeChange', (size) => {
|
|
|
- this.doChangeBarHeight()
|
|
|
-
|
|
|
- });
|
|
|
|
|
|
//折叠屏的屏幕显示模式变化
|
|
|
display.on('foldDisplayModeChange', (data) => {
|
|
|
@@ -478,13 +476,18 @@ export struct LocalMusic {
|
|
|
this.themeColor = themeColor;
|
|
|
this.doChangeSetting()
|
|
|
this.windowClass.on('windowSizeChange', (size) => {
|
|
|
- LogUtil.info('onecold windowSizeChange')
|
|
|
- if(!this.isPhoneLan()){
|
|
|
- LogUtil.info('onecold windowSizeChange11')
|
|
|
+ // LogUtil.info('onecold windowSizeChange')
|
|
|
+ this.doChangeBarHeight()
|
|
|
+ let viewWidth = px2vp(size.width);
|
|
|
+ let viewHeight = px2vp(size.height);
|
|
|
+ if (viewWidth > viewHeight) {
|
|
|
+ // this.isLandscape = true;
|
|
|
this.startAutoHide()
|
|
|
+ // Logger.info('onecold 横屏 windowSizeChange isLandscape = ' + this.isLandscape)
|
|
|
}else{
|
|
|
- LogUtil.info('onecold windowSizeChange13')
|
|
|
+ // this.isLandscape = false;
|
|
|
this.isAutoHide = false
|
|
|
+ // Logger.info('onecold 竖屏 windowSizeChange isLandscape = ' + this.isLandscape)
|
|
|
}
|
|
|
|
|
|
});
|
|
|
@@ -1833,7 +1836,7 @@ export struct LocalMusic {
|
|
|
Column(){
|
|
|
Line().width('100%').height('100%')
|
|
|
}
|
|
|
- .height(this.isPhoneLan()?0:px2vp(AppUtil.getStatusBarHeight()))
|
|
|
+ .height(this.topRectHeight)
|
|
|
.backgroundColor(this.isCustomizeBg?Color.Transparent:(this.isDarkMode?$r('app.color.title_bar_bg'):this.themeColor))
|
|
|
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
|
|
|
TitleBar({ model: $titleBarModel })
|
|
|
@@ -4924,20 +4927,19 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
//是不是手机横屏
|
|
|
+
|
|
|
isPhoneLan() {
|
|
|
- LogUtil.info(' isPhoneLan this.currentBreakpoint = '+ this.currentBreakpoint )
|
|
|
- LogUtil.info(' isPhoneLan DisplayUtil.getFoldStatus() = '+ DisplayUtil.getFoldStatus() )
|
|
|
if (DeviceUtil.getDeviceType() === resourceManager.DeviceType.DEVICE_TYPE_PHONE
|
|
|
&& this.currentBreakpoint !== BreakpointTypeEnum.SM) {
|
|
|
if (DisplayUtil.getFoldStatus() === 0 ) {
|
|
|
- LogUtil.info(' isPhoneLan 是横屏' )
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
- LogUtil.info(' isPhoneLan 不是横屏' )
|
|
|
+
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Builder
|
|
|
IjkMusicPlayerView() {
|
|
|
|
|
|
@@ -5079,7 +5081,6 @@ export struct LocalMusic {
|
|
|
@State name: string = '';
|
|
|
// @State loop: boolean = false;
|
|
|
@State playType: number = 0; //0:连续播放 1:单片重复播放 2:正常播放 3:随机播放
|
|
|
- @State isLandscape: boolean = false;
|
|
|
@State multiple: string = '1.0X';
|
|
|
xcomponentController: XComponentController = new XComponentController()
|
|
|
private panOptionBright: PanGestureOptions =
|