|
- Overview
- Implementation
- Configuring the control or the window
- Event "Refreshing by pull/release"
- Customizing the "Pull to refresh" feature
- Refresh bar
- Event "Refreshing by pull/release": managing the bar
Pull to Refresh (Android/iOS): Window, Table and Looper controls
The "Pull to refresh" feature allows the user to "pull" a Table control, a Looper control or a window in order to refresh its content. During this action, a refresh bar automatically appears in the exposed area: - The bar indicates that you must pull to refresh.
- Then, the bar indicates that you must release to refresh.
- The bar indicates that the refresh operation is in progress. A progress bar is displayed during the refresh duration.
- The control is updated.
 A simple finger movement refreshes the display Versions 23 and later New in version 23 Event "Refreshing by pull/release" The event "Refreshing by pull/release" must contain the code for refreshing data: - in the Table or Looper control.
Versions 23 and laterin the window. New in version 23in the window. in the window.
At the end of code execution, the refresh bar will be automatically hidden. Caution: The refresh bar displays a progress bar during the execution of the event "Refreshing by pull/release". This progress bar will be displayed only if the main thread can be run during the execution of "Refreshing by pull/release". To see the progress bar, you must perform the long refresh process (HTTP request or HFSQL browse for example) in a thread run from the event "Refreshing by pull/release". In this case, the bar must be managed by the following functions: Special case: Browsing Table or LooperIf "Pull to refresh" is enabled on a browsing looper or table, TableDisplay or LooperDisplay associated with the taReExecuteQuery constant will be automatically called at the end of "Refreshing by pull/release" (if it was triggered by a pull-to-refresh). To disable this behavior, you must return False in the event "Refreshing by pull/release". For more details, see Event "Refreshing by pull/release": managing the bar. Customizing the "Pull to refresh" feature Refresh bar If a refresh bar is used, this bar corresponds to a specific internal window that can be included in the project for customization. This internal window includes 3 planes displayed during the different steps of "Pull to refresh": - The first plane is displayed during the scroll, as long as the refresh bar is not entirely displayed. This plane includes an image and a caption. This caption describes the action associated with the current gesture.
- The second plane is displayed during the scroll when the refresh bar is entirely displayed and as long as the user did not release the pointer. This plane includes an image and a caption. This caption describes the action associated with the current gesture. When going from plane 1 to plane 2, the arrow changes direction and the caption becomes "Release to refresh".
- The last plane is displayed during the data refresh. This plane includes a Progress Bar control and a caption.
The proposed window contains three specific events to manage the "Pull to refresh" gesture: - "Pull to refresh: Start": This code is called when the "Pull to refresh" gesture is detected. By default, this event positions the internal window on plane 1 and modifies the caption of the action.
- "Pull to refresh: Wait for release": This event is called when a refresh can be started. By default, this event positions the internal window on plane 2 and modifies the caption of the action.
- "Pull to refresh: Refresh": This event is called when starting the refresh. By default, this event positions the internal window on plane 3 and modifies the caption of the action.
When the internal window was included in the project, you can: - customize the bar interface.
- customize the events for managing "Pull to refresh".
- access the controls of internal window via the following syntax:
<Name of Table or Looper control>.<Name of Internal Window>.<Control name>
Event "Refreshing by pull/release": managing the bar This event can manage the control (or window) refresh in a specific thread. In this case, the bar display can be managed manually by the following functions: Example: The event "Refreshing by pull/release" of TABLE_Products runs the automatic procedure named ChangeReorder, once, with a 3-second delay.
// Display the refresh bar TableRefreshVisible(TABLE_Products, True) // Automatic refresh procedure ChangeReorder()
At the end of refresh procedure, the refresh bar is erased by using TableRefreshVisible again.
PROCEDURE ChangeReorder() IF NOT gbReorderPerformed THEN FOR i = 1_TO_ TABLE_Products..Occurrence IF TABLE_Products[i].COL_ID = gnReorderProductID THEN TABLE_Products[i].COL_InStock = IMG_Stock_OK END END END // Delete the refresh bar TableRefreshVisible(TABLE_Products, False)
Remark: It takes as many calls to TableRefreshVisible(False) as it takes to TableRefreshVisible(True) to hide the blindfold.
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |