张善主

feat(查看图片):沉浸式

@@ -3,6 +3,7 @@ import { display, router } from '@kit.ArkUI'; @@ -3,6 +3,7 @@ import { display, router } from '@kit.ArkUI';
3 import { ImageItemView } from '../components/view/ImageItemView'; 3 import { ImageItemView } from '../components/view/ImageItemView';
4 import { ImageDownloadComponent } from '../components/ImageDownloadComponent'; 4 import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
5 import { Action } from 'wdBean'; 5 import { Action } from 'wdBean';
  6 +import { WindowModel } from 'wdKit/Index';
6 7
7 const TAG = 'MultiPictureListPage'; 8 const TAG = 'MultiPictureListPage';
8 9
@@ -23,6 +24,7 @@ export struct MultiPictureListPage { @@ -23,6 +24,7 @@ export struct MultiPictureListPage {
23 // @Provide bgc: Color = Color.White; 24 // @Provide bgc: Color = Color.White;
24 25
25 aboutToAppear(): void { 26 aboutToAppear(): void {
  27 + this.openFullScreen()
26 //获取宽高尺寸 28 //获取宽高尺寸
27 this.screenWidth = this.displayTool.width 29 this.screenWidth = this.displayTool.width
28 // this.picWidth = this.screenWidth - vp2px(52) 30 // this.picWidth = this.screenWidth - vp2px(52)
@@ -130,10 +132,36 @@ export struct MultiPictureListPage { @@ -130,10 +132,36 @@ export struct MultiPictureListPage {
130 } 132 }
131 .width('100%') 133 .width('100%')
132 .height('100%') 134 .height('100%')
  135 + .padding({top:$r('app.float.margin_44')})
133 .backgroundColor(Color.Black) 136 .backgroundColor(Color.Black)
134 .id('e_picture_container') 137 .id('e_picture_container')
135 // 设置顶部绘制延伸到状态栏 138 // 设置顶部绘制延伸到状态栏
136 // 设置底部绘制延伸到导航条 139 // 设置底部绘制延伸到导航条
137 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) 140 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
138 } 141 }
  142 +
  143 + /**
  144 + * 开启沉浸式
  145 + * TODO:颜色待根据业务接口修改
  146 + */
  147 + openFullScreen() {
  148 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
  149 + WindowModel.shared.setWindowLayoutFullScreen(true)
  150 + // WindowModel.shared.setWindowSystemBarEnable([])
  151 + }
  152 +
  153 + aboutToDisappear(): void {
  154 + console.log(TAG, 'aboutToDisappear')
  155 + this.closeFullScreen()
  156 + }
  157 +
  158 + /**
  159 + * 关闭沉浸式
  160 + * TODO:颜色待根据业务接口修改
  161 + */
  162 + closeFullScreen() {
  163 + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
  164 + WindowModel.shared.setWindowLayoutFullScreen(false)
  165 + // WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
  166 + }
139 } 167 }
@@ -221,6 +221,10 @@ @@ -221,6 +221,10 @@
221 "value": "36vp" 221 "value": "36vp"
222 }, 222 },
223 { 223 {
  224 + "name": "margin_44",
  225 + "value": "44vp"
  226 + },
  227 + {
224 "name": "vp_3", 228 "name": "vp_3",
225 "value": "3vp" 229 "value": "3vp"
226 }, 230 },