1# ArkUI Subsystem Changelog
2
3## cl.arkui.1 Display Effect Change of the alignment Parameter in the \<DatePickerDialog>, \<TimePickerDialog>, and \<TextPickerDialog> Components
4
5**Access Level**
6
7Public
8
9**Reason for Change**
10
11Specification optimization.
12
13**Change Impact**
14
15This change is a compatible change.
16
17In **\<DatePickerDialog>**, **\<TimePickerDialog>**, and **\<TextPickerDialog>** components, the **alignment** parameter to adjust the position of the picker dialog box relative to the window. The affected scenarios are as follows:
18
19(a) **alignment** is set to **Top**, **TopStart**, or **TopEnd**
20
21Before change: There is a default spacing of 40 vp between the picker dialog box and the top of the window.
22
23After change: The spacing between the picker dialog box and the top of the window is 0.
24
25(b) **alignment** is set to **Bottom**
26
27Before change: There is a default spacing of 16 vp between the picker dialog box and the bottom of the window.
28
29After change: The spacing between the picker dialog box and the bottom of the window is 0.
30
31(c) **alignment** is set to **Center**
32
33Before change: There is an upward offset of 16 vp relative to the center of the window.
34
35After change: The picker dialog box is in the center of the window
36
37**API Level**
38
3911
40
41**Change Since**
42
43OpenHarmony SDK 4.1.5.3
44
45**Key API/Component Changes**
46
47DatePickerDialog, TimePickerDialog, TextPickerDialog
48
49**Adaptation Guide**
50
51If you want to set the spacing between the picker dialog box and window edges, use **offset** together with **alignment**.
52
53## cl.arkui.2 Renaming of the buttonMargin and textMargin APIs for the \<SegmentButton> Component
54
55**Access Level**
56
57Public
58
59**Reason for Change**
60
61The original API names do not convey the actual functionality of the APIs.
62
63**Change Impact**
64
65This change is a non-compatible change. The APIs for setting the button and text paddings in the **\<SegmentButton>** component are renamed as follows:
66
67(a) API for setting the button padding
68
69Before change: **buttonMargin**
70
71After change: **buttonPadding**
72
73(b) API for setting the text padding
74
75Before change: **textMargin**
76
77After change: **textPadding**
78
79**Change Since**
80
81OpenHarmony SDK 4.1.5.3
82
83**Key API/Component Changes**
84
85SegmentButton
86
87**Adaptation Guide**
88
89Before change:
90
91The APIs for setting the button and text paddings in the **\<SegmentButton>** component are **buttonMargin** and **textMargin**, respectively.
92
93After change:
94
95The APIs for setting the button and text paddings in the **\<SegmentButton>** component are **buttonPadding** and **textPadding**, respectively.
96
97## cl.arkui.3 Default Value Change for IconOptions.size of cancelButton in the \<TextInput> Component
98
99**Access Level**
100
101Public
102
103**Reason for Change**
104
105If the **IconOptions.size** parameter is not set in the **cancelButton** API, the image size obtained is different from the actual one.
106
107**Change Impact**
108
109This change is a non-compatible change. If the **IconOptions.size** parameter is not set in the **cancelButton** API, the image size obtained is as follows:
110
111Before change: 0.00 px
112
113After change: 24.00 vp
114
115**Change Since**
116
117OpenHarmony SDK 4.1.5.3
118
119**Key API/Component Changes**
120
121TextInput
122
123**Adaptation Guide**
124
125N/A
126
127## cl.arkui.4 Change in the @Prop and @BuilderParam Initialization Validation Specification
128
129**Access Level**
130
131Public
132
133**Reason for Change**
134
135The initialization validation spefication for @Prop and @BuilderParam is changed to cover the case where they are used with @Require.
136
137**Change Impact**
138
139This change is a non-compatible change. Specifically, when the @Require decorator is used together with the @Prop or @BuilderParam decorator, the @Prop or @BuilderParam decorated variable must have its initial value passed from the parent component. If the parent component does not pass in any value, a compilation error occurs. This check for initialization from the parent component is not conducted if the @Prop or @BuilderParam decorator is not used with @Require.
140
141**API Level**
142
14311
144
145**Change Since**
146
147OpenHarmony SDK 4.1.5.3
148
149**Example**
150
151```
152@Entry
153@Component
154struct Index {
155  build() {
156    Row() {
157      Child()
158    }
159  }
160}
161
162@Component
163struct Child {
164  // ERROR: Property buildText must be initialized through the component constructor.
165  @Require @BuilderParam buildText: () => void;
166  // ERROR: Property initBuildText must be initialized through the component constructor.
167  @Require @BuilderParam initBuildText: () => void = buildFuction;
168  // ERROR: Property message must be initialized through the component constructor.
169  @Require @Prop message: string = 'Hello';
170  // ERROR: Property initMessage must be initialized through the component constructor.
171  @Require @Prop initMessage: string;
172  // Remove the error message: ERROR: Property 'chindProp' in the custom component 'Child' is missing assignment or initialization.
173  @Prop chindProp: string;
174  // Remove the error message: ERROR: Property 'chindBuildParam' in the custom component 'Child' is missing assignment or initialization.
175  @BuilderParam chindBuildParam: () => void;
176
177  build() {
178  }
179}
180
181@Builder
182function buildFuction() {
183}
184```
185
186**Key API/Component Changes**
187
188N/A
189
190**Adaptation Guide**
191
192When the \@Require decorator is used together with the \@Prop or \@BuilderParam decorator, the \@Prop and \@BuilderParam decorated variable must have a value passed from the parent component during construction of the owning component.
193
194
195
196## cl.arkui.5 Change in the Popup Style and Avoidance Logic Specifications
197
198**Access Level**
199
200Public
201
202**Reason for Change**
203
204The UX capability is enhanced.
205
206**Change Impact**
207
208This change is a compatible change.
209
2101. If the popup background color is not set, the default background color is used with a blur effect applied. To remove the blur effect, call **backgroundBlurStyle** and set **BlurStyle.NONE** (**backgroundBlurStyle: BlurStyle.NONE**).
211
212   ```ts
213   // xxx.ets
214   @Entry
215   @Component
216   struct PopupExample {
217     @State handlePopup: boolean = false
218
219     build() {
220       Column() {
221         // PopupOptions for setting the popup
222         Button('PopupOptions')
223           .onClick(() => {
224             this.handlePopup = !this.handlePopup;
225           })
226           .bindPopup(this.handlePopup, {
227             message: 'This is a popup with PopupOptions',
228             backgroundBlurStyle: BlurStyle.NONE,
229           })
230           .position({ x: 100, y: 150 })
231       }
232     }
233   }
234   ```
235
2362. The following 12 alignment modes are added:
237
238   - Top: TopLeft/Top/TopRight
239   - Bottom: BottomLeft/Bottom/BottomRight
240   - Left: LeftTop/Left/LeftBottom
241   - Right: RightTop/Right/RightBottom
242
243   ![popup_placement.png](figures/popup_placement.png)
244
245   ```ts
246   // xxx.ets
247   @Entry
248   @Component
249   struct PopupExample {
250     @State handlePopup: boolean = false;
251
252     build() {
253       Column() {
254         // PopupOptions for setting the popup
255         Button ('Button Name')
256           .onClick(() => {
257             this.handlePopup = !this.handlePopup;
258           })
259           .bindPopup(this.handlePopup, {
260             message: 'Test',
261             placement: Placement.Bottom
262           })
263           .position({ x: 100, y: 150 })
264       }
265     }
266   }
267   ```
268
2693. When a popup of the PopupOptions type has a button, the popup does not disappear when anywhere outside of the popup area is clicked.
270
271   - Before change: When a popup of the PopupOptions type has a button, the popup disappears when anywhere outside of the popup area is clicked.
272
273   - After change: When a popup of the PopupOptions type has a button, the popup does not disappear when anywhere outside of the popup area is clicked.
274
275   > **NOTE**
276   >
277   > A popup of the PopupOptions type has a button when either **primaryButton** or **secondaryButton** or both are set in **PopupOptions** through **bindPopup**.
278
2794. A popup of the PopupOptions type allows scrolling when text overflow occurs.
280
281   - Before change: In a popup of the PopupOptions type, extra-long text is clipped.
282
283   - After change: In a popup of the PopupOptions type, a scroll API can be added to allow for scrolling when text overflow occurs.
284
2855. The font color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary** in the layered parameters.
286
287   - Before change: The font color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary_contrary** in the layered parameters.
288
289   - After change: The font color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary** in the layered parameters.
290
2916. The button color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary_activated** in the layered parameters.
292
293   - Before change: The button color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary_contrary** in the layered parameters.
294
295   - After change: The button color of the popup of the PopupOptions type is the value of **ohos_id_color_text_primary_activated** in the layered parameters.
296
2977. In the popup of the PopupOptions type, buttons can be displayed in the flex layout so that a line break is inserted in cases of text overflowing.
298
299   - Before change: If the button in a popup of the PopupOptions type contains ultra-long text, the text is clipped.
300
301   - After change: If the button in a popup of the PopupOptions type contains ultra-long text, the extra text is wrapped onto a new line in flex layout.
302
3038. A popup of the CustomPopupOptions type can be configured to be focusable, by setting the **focusable** parameter in **CustomPopupOptions** to **true**.
304
305   ```ts
306   // xxx.ets
307   @Entry
308   @Component
309   struct PopupExample {
310     @State customPopup: boolean = false
311
312     // Define the popup content in the popup builder.
313     @Builder
314     popupBuilder() {
315       Row({ space: 2 }) {
316         Button("button1")
317         Button("button2")
318       }
319     }
320
321     build() {
322       Column() {
323         // CustomPopupOptions for setting the popup
324         Button('CustomPopupOptions')
325           .position({ x: 80, y: 300 })
326           .onClick(() => {
327             this.customPopup = !this.customPopup
328           })
329           .bindPopup(this.customPopup, {
330             builder: this.popupBuilder,
331             focusable: true
332           })
333       }
334     }
335   }
336   ```
337
3389. If **showInSubWindow** is set to **true**, the maximum height of the popup is the device screen height. If **showInSubWindow** is set to **false**, the maximum height of the popup is the application window height.
339
340   - Before change: There is no maximum height limit. If the text is too long, it will be clipped.
341
342   - After change: The maximum height is specified, and if the text is too long, a scroll bar is added to display the text.
343
344   If **showInSubWindow** is set to **true**, the maximum height is the device screen height. Allowable height = Maximum height – Status bar height (0 if there is no status bar) – Dock height (0 if there is no dock) – 40 vp – 40 vp.
345
346   If **showInSubWindow** is set to **false**, the maximum height is the height of the application window. Allowable height = Maximum height – Status bar height (0 if there is no status bar) – Dock height (0 if there is no dock) – 40 vp – 40 vp.
347
348The following figures show the styles of items 1, 5, and 6 before and after the change.
349
350- Before change
351  ![before](figures/popup_before.png)
352- After change
353  ![after](figures/popup_after.png)
354
355> **NOTE**
356>
357> - The popup of the PopupOptions type is a popup where the **PopupOptions** data structure is passed in by **bindPopup**.
358>
359> - The popup of the CustomPopupOptions type is a popup where the **CustomPopupOptions** data structure is passed in by **bindPopup**.
360
361**API Level**
362
36311
364
365**Change Since**
366
367OpenHarmony SDK 4.1.5.2
368
369**Key API/Component Changes**
370
371bindPopup
372
373**Adaptation Guide**
374
3751. Customize the popup background color based on user requirements. For details, see item 1.
376
3772. Set whether the popup obtains focus when displayed. For details, see item 8.
378
379## cl.Arkui.6 Added Support for Displaying a Dialog Box in a Subwindow
380
381**Access Level**
382
383Public
384
385**Reason for Change**
386
387The UX capability is enhanced.
388
389**Change Impact**
390
391This change is a compatible change. The **showInSubWindow** attribute, which is already supported in the **\<CustomDialog>** component, is added to the **\<AlertDialog>** and **\<ActionSheet>** components and the **showDialog** and **showActionMenu** APIs in the **promptAction** module. If this attribute is manually set to **true**, the dialog box is created in a subwindow and can be displayed outside of the application window.
392
393**API Level**
394
39511
396
397**Change Since**
398
399OpenHarmony SDK 4.1.5.5
400
401**Key API/Component Changes**
402
403Before change: The **showInSubWindow** attribute is available for the **CustomDialogControllerOptions** API of the **\<CustomDialog>** component.
404
405After change: The **showInSubWindow** attribute is available for the **\<AlertDialog>**, **\<CustomDialog>**, and **\<ActionSheet>** components and the **showDialog** and **showActionMenu** APIs in the **promptAction** module.
406
407**Adaptation Guide**
408
409N/A
410
411## cl.Arkui.7 Change in the Mask Scope of the \<CustomDialog> Component
412
413**Access Level**
414
415Public
416
417**Reason for Change**
418
419The change is made to maintain consistency with UX specifications.
420
421**Change Impact**
422
423This change is a non-compatible change.
424
425Before change: When **showInSubWindow** is set to **true**, the mask of the **\<CustomDialog>** component covers the subwindow; when **showInSubWindow** is set to **false**, the mask covers the entire application window.
426
427![en-us_image_alert](figures/en-us_image_alert.gif)
428
429After change: The mask of the **\<CustomDialog>** component covers the entire application window regardless of whether **showInSubWindow** is **true** or **false**.
430
431![en-us_image_alert_showinsubwindow](figures/en-us_image_alert_showinsubwindow.jpg)
432
433**API Level**
434
43511
436
437**Change Since**
438
439OpenHarmony SDK 4.1.5.5
440
441**Key API/Component Changes**
442
443CustomDialog
444
445**Adaptation Guide**
446
447You can customize the mask scope when **showInSubWindow** is set to **true** by controlling the application window scope.
448
449## cl.Arkui.8 Adding of the isModal Attribute for Dialog Boxes
450
451**Access Level**
452
453Public
454
455**Reason for Change**
456
457The UX capability is enhanced.
458
459**Change Impact**
460
461This change is a compatible change. The **isModal** attribute is added to the **\<AlterDialog>**, **\<CustomDialog>**, and **\<ActionSheet>** components and the **showDialog** and **showActionMenu** APIs in the **promptAction** module. The value **true** (default) means that the dialog box has a mask, and **false** means the opposite.
462
463**API Level**
464
46511
466
467**Change Since**
468
469OpenHarmony SDK 4.1.5.5
470
471**Key API/Component Changes**
472
473isModal
474
475**Adaptation Guide**
476
477N/A
478
479## cl.Arkui.9 API Change of the Advanced Popup Component
480
481**Access Level**
482
483Public
484
485**Reason for Change**
486
487The UX capability is enhanced.
488
489**Change Impact**
490
491In the **PopupIconOptions** data structure of @ohos.arkui.advanced.Popup (popup component), the **image** variable does not accept the PixelMap or DrawableDescriptor data type.
492
493**API Level**
494
49511
496
497**Change Since**
498
499OpenHarmony SDK 4.1.5.2
500
501**Key API/Component Changes**
502
503@ohos.arkui.advanced.Popup
504
505**Adaptation Guide**
506
507Regarding the **image** variable in the **PopupIconOptions** data structure of @ohos.arkui.advanced.Popup (popup component), only values of the ResourceStr type are allowed.
508