1e41f4b71Sopenharmony_ci# ArkUI Subsystem Changelog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.arkui.1 Safe Area Behavior Change for Dialog Box Avoidance
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci**Access Level**
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ciPublic API
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci**Reason for Change**
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciThe mask area cannot cover the bottom navigation bar, and in immersive mode, the content is still displayed in the navigation bar and status bar.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci**Change Impact**
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciThis change is a non-compatible change.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ciBefore change: 1. The dialog box mask area does not extend to the bottom navigation bar. 2. When **showInSubwindow** is **true** or the application is configured for immersive mode, the content is still displayed in the top status bar and bottom navigation bar.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ciAfter change: 1. The dialog box mask area extends to the bottom navigation bar by default. 2. When **showInSubwindow** is **true** or the application is configured for immersive mode, the content is not displayed in the top status bar and bottom navigation bar.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ciThe following figure shows the effect comparison before and after the change when **Alignment** is set to **Bottom**.
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci![dialog change](figures/dialog_changelog.png)
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci**API Level**
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci**AlertDialog** and **CustomDialog**: API version 7; **ActionSheet**, **DatePickerDialog**, **TimePickerDialog**, and **TextPickerDialog**: API version 8; **promptAction.showDialog**: API version 9; **promptAction.openCustomDialog**: API version 11
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci**Change Since**
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.19
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci**Key API/Component Changes**
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_cipromptAction.showDialog, promptAction.openCustomDialog, AlertDialog, ActionSheet, DatePickerDialog, TimePickerDialog, TextPickerDialog, CustomDialog
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci**Adaptation Guide**
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ciTo enable the dialog box content to display in the navigation bar, set **alignment** to **DialogAlignment.Bottom** and **offset.dy** to the height of the navigation bar. Here is a specific example code snippet:
40e41f4b71Sopenharmony_ci1. In the **EntryAbility** page, set the window to full screen and obtain the height of the top status bar and the bottom navigation bar.
41e41f4b71Sopenharmony_ci```ts
42e41f4b71Sopenharmony_ci// src/main/ets/entryability/EntryAbility.ets
43e41f4b71Sopenharmony_ciimport { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
44e41f4b71Sopenharmony_ciimport { window } from '@kit.ArkUI';
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ciexport default class EntryAbility extends UIAbility {
47e41f4b71Sopenharmony_ci  onWindowStageCreate(windowStage: window.WindowStage): void {
48e41f4b71Sopenharmony_ci    windowStage.loadContent('pages/Index', (err, data) => {
49e41f4b71Sopenharmony_ci      if (err.code) {
50e41f4b71Sopenharmony_ci        return;
51e41f4b71Sopenharmony_ci      }
52e41f4b71Sopenharmony_ci      // Obtain the main window.
53e41f4b71Sopenharmony_ci      let windowClass: window.Window = windowStage.getMainWindowSync();
54e41f4b71Sopenharmony_ci      // Set the window to full screen.
55e41f4b71Sopenharmony_ci      windowClass.setWindowLayoutFullScreen(true)
56e41f4b71Sopenharmony_ci      // Obtain the height of the status bar.
57e41f4b71Sopenharmony_ci      let statusArea = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);
58e41f4b71Sopenharmony_ci      AppStorage.setOrCreate('SafeAreaTopHeight', statusArea.topRect.height);
59e41f4b71Sopenharmony_ci      // Obtain the height of the navigation bar.
60e41f4b71Sopenharmony_ci      let navigationArea = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR);
61e41f4b71Sopenharmony_ci      AppStorage.setOrCreate('SafeAreaBottomHeight', navigationArea.bottomRect.height);
62e41f4b71Sopenharmony_ci    });
63e41f4b71Sopenharmony_ci  }
64e41f4b71Sopenharmony_ci}
65e41f4b71Sopenharmony_ci```
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci2. When calling the dialog box page, set **alignment** and **offset**.
68e41f4b71Sopenharmony_ci```ts
69e41f4b71Sopenharmony_ci// src/main/ets/pages/Index.ets
70e41f4b71Sopenharmony_cilet storage = LocalStorage.getShared();
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ci@CustomDialog
73e41f4b71Sopenharmony_cistruct CustomDialogExample {
74e41f4b71Sopenharmony_ci  controller?: CustomDialogController
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci  build() {
77e41f4b71Sopenharmony_ci    Column() {
78e41f4b71Sopenharmony_ci      Text('This is a dialog box')
79e41f4b71Sopenharmony_ci        .fontSize(30)
80e41f4b71Sopenharmony_ci        .height(100)
81e41f4b71Sopenharmony_ci      Button('Close Dialog Box')
82e41f4b71Sopenharmony_ci        .onClick(() => {
83e41f4b71Sopenharmony_ci          if (this.controller != undefined) {
84e41f4b71Sopenharmony_ci            this.controller.close()
85e41f4b71Sopenharmony_ci          }
86e41f4b71Sopenharmony_ci        })
87e41f4b71Sopenharmony_ci        .margin(20)
88e41f4b71Sopenharmony_ci    }
89e41f4b71Sopenharmony_ci  }
90e41f4b71Sopenharmony_ci}
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci@Entry(storage)
93e41f4b71Sopenharmony_ci@Component
94e41f4b71Sopenharmony_cistruct CustomDialogUser {
95e41f4b71Sopenharmony_ci  safeAreaTopHeight: string = AppStorage.get<number>('SafeAreaTopHeight') + 'px';
96e41f4b71Sopenharmony_ci  safeAreaBottomHeight: string = AppStorage.get<number>('SafeAreaBottomHeight') + 'px';
97e41f4b71Sopenharmony_ci  dialogController: CustomDialogController | null = new CustomDialogController({
98e41f4b71Sopenharmony_ci    builder: CustomDialogExample(),
99e41f4b71Sopenharmony_ci    alignment: DialogAlignment.Bottom,
100e41f4b71Sopenharmony_ci    offset: { dx: 0, dy: this.safeAreaBottomHeight }
101e41f4b71Sopenharmony_ci  })
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci  build() {
104e41f4b71Sopenharmony_ci    Column() {
105e41f4b71Sopenharmony_ci      Button('Open Dialog Box')
106e41f4b71Sopenharmony_ci        .onClick(() => {
107e41f4b71Sopenharmony_ci          if (this.dialogController != null) {
108e41f4b71Sopenharmony_ci            this.dialogController.open()
109e41f4b71Sopenharmony_ci          }
110e41f4b71Sopenharmony_ci        })
111e41f4b71Sopenharmony_ci    }
112e41f4b71Sopenharmony_ci    .width('100%')
113e41f4b71Sopenharmony_ci    .height('100%')
114e41f4b71Sopenharmony_ci    .justifyContent(FlexAlign.Center)
115e41f4b71Sopenharmony_ci  }
116e41f4b71Sopenharmony_ci}
117e41f4b71Sopenharmony_ci```
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ci## cl.arkui.2 Change in the colors Parameter Type for linearGradient, sweepGradient, radialGradient, and LinearGradient from Array\<any> to Array\<[ResourceColor, number]>
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci**Access Level**
122e41f4b71Sopenharmony_ci
123e41f4b71Sopenharmony_ciPublic API
124e41f4b71Sopenharmony_ci
125e41f4b71Sopenharmony_ci**Reason for Change**
126e41f4b71Sopenharmony_ci
127e41f4b71Sopenharmony_ciThe use of the **any** type in APIs can be too broad, as it does not provide clear guidance on what specific types are expected or allowed.
128e41f4b71Sopenharmony_ci
129e41f4b71Sopenharmony_ci**Change Impact**
130e41f4b71Sopenharmony_ci
131e41f4b71Sopenharmony_ciThis change is a non-compatible change.
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ciBefore change: The **colors** parameter for the **linearGradient**, **sweepGradient**, and **radialGradient** universal attributes and the **LinearGradient** API is allowed to be defined as an **Array\<any>** type.
134e41f4b71Sopenharmony_ci
135e41f4b71Sopenharmony_ciAfter change: If an incompatible **colors** parameter type with **Array\<[ResourceColor, number]>** is used, such as **Array\<any>**, a compilation error will occur.
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci**API Level**
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ci**linearGradient**, **sweepGradient**, and **radialGradient**: API version 7; **LinearGradient**: API version 9
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ci**Change Since**
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.19
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ci**Adaptation Guide**
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ciTo define variables used in the **linearGradient**, **sweepGradient**, and **radialGradient** APIs, the type of the **colors** parameter should be accurately defined to be compatible with **Array\<[ResourceColor, number]>**.
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ciExample:
150e41f4b71Sopenharmony_ci```ts
151e41f4b71Sopenharmony_ci@Entry
152e41f4b71Sopenharmony_ci@Component
153e41f4b71Sopenharmony_cistruct Test {
154e41f4b71Sopenharmony_ci  colors: Array<any> = [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]];
155e41f4b71Sopenharmony_ci  build() {
156e41f4b71Sopenharmony_ci    Row()
157e41f4b71Sopenharmony_ci      .width('90%')
158e41f4b71Sopenharmony_ci      .height(50)
159e41f4b71Sopenharmony_ci      .linearGradient({
160e41f4b71Sopenharmony_ci        angle: 90,
161e41f4b71Sopenharmony_ci        // colors is defined as the Array<any> type. This will result in a compilation error.
162e41f4b71Sopenharmony_ci        colors: this.colors
163e41f4b71Sopenharmony_ci      })
164e41f4b71Sopenharmony_ci  }
165e41f4b71Sopenharmony_ci}
166e41f4b71Sopenharmony_ci```
167e41f4b71Sopenharmony_ciAdjust the **colors** parameter to be compatible with the API's expected type, for example, **colors: Array&lt;[ResourceColor, number]&gt; = [[0xff0000, 0.0], [0x0000ff, 0.3], [0xffff00, 1.0]]**.
168e41f4b71Sopenharmony_ci
169