- Overview
- Create an iOS widget window
- Characteristics of an iOS widget window
- Size of a Widget window
- Update the content
- Redisplaying the Widget window
- Widget image and description
- Programming an iOS widget window
- Opening a Widget window
- Closing a Widget window
An iOS application with an iOS widget configuration can contain one or more iOS 14 widget windows. These windows can be displayed on a tablet or phone's home screen. The information displayed in these windows is updated on a regular basis. Create an iOS widget window To create an iOS widget window in an iOS widget configuration: - Click
in the quick access buttons: - The creation window appears: click "Window" then "Window".
- The window creation wizard starts.
- In the "Standard" tab, in the "Other platform" area, select "Blank for widget" and validate.
- A new window is created in the editor. Only two types of controls are available in iOS 14 widget windows: Static controls and Image controls.
Remark: You can also change the type of an existing window: - Open the window description (select "Description" in the context menu).
- In the "UI" tab, select "Widget (Android/iOS14+)".
- Validate.
Characteristics of an iOS widget window Size of a Widget window The size of a Widget window is defined in number of vertical and horizontal cells. This size can be configured in the "UI" tab of the description window: There are 3 standard sizes in iOS: You can choose other sizes. Remark: Widgets created with WINDEV Mobile cannot be resized. Widgets can have one or more sizes (e.g. "Small" and "Medium"). To create the same widget in different sizes in WINDEV Mobile, you must: - Create an "iOS 14 widget" window for each desired size. Each window has a different name.
- Set the same title for each window. This title will be used to group the different sizes of the widget.
Update the content Widget windows include a specific event: Refreshing the widget. This event is used to update the widget content. This event starts at regular time intervals. The refresh frequency is defined in the "UI" tab of the description window. Remarks: - This refresh frequency cannot be less than 30 minutes.
- WidgetDisplay redisplays the widget and runs the event "Refresh widget".
Redisplaying the Widget window A widget window is displayed by the process that manages the device's home screen. This display is not always performed. It is updated in the following cases: - Adding a new instance of the widget on the home screen.
- Once a widget button or image was clicked.
- After updating the content of the widget.
Remark: WidgetDisplay redisplays the widget and runs the event "Refresh widget". Widget image and description When installing a widget on the desktop, the user can see the list of widgets found on his computer. For each widget, the list shows: - the name of the widget,
- its description,
- the preview image (for each available size).
The name of the widget corresponds to the title of the window. If several windows of different sizes have the same title, they will be proposed for the different sizes of the widget. The widget can be described in the "UI" tab of the window description. This description can be in multiple languages. If there are multiple windows for one widget, the description of the smallest window is used. The widget preview image is generated automatically. Remark: If an image is specified in the "UI" tab of the description window, it will not be taken into account. Programming an iOS widget window Opening a Widget window You cannot explicitly request the opening of a Widget window. The opening functions ( OpenSister, OpenChild, Use) will trigger a fatal error if they are used in widget mode. The Widget windows are automatically opened in the following cases : - Adding on the home screen the first instance of the Widget corresponding to the window.
- Once the device is started if at least one instance of the Widget is found on the home screen.
- When updating the widget or when the user interacts with the widget (click on a button for example).
- If the process was stopped by the system (if it needs resources for example).
The events run when a Widget window is open are : - "Global declarations" of the window.
- "Initializing" window controls.
- "Initializing" the window.
- "End of initialization" of the window.
- "Refresh widget".
The "Initializing" event associated with the project will only be run before the first Widget window of the application is opened. To differentiate the widget-specific code from the application-specific code in this event, use InWidgetMode. Closing a Widget window You cannot explicitly request the closing of a Widget window. Close will trigger a fatal error if it is used in widget mode. The Widget windows are automatically closed when the last instance of the Widget is removed from the home screen. The "Closing" event (associated with the window) is run when a Widget window is closed. The "Closing" event associated with the project will be executed when the last instance of an application widget is removed from the Home screen and there are no more instances of other widgets displayed.
|
|
|
|