Class “RefreshComposite”
Object > NativeObject > Widget > Composite > RefreshComposite
A composite allowing to use a pull-to-refresh gesture to trigger and visualize a long running operation.
Type: | RefreshComposite extends Composite |
Constructor: | public |
Singleton: | No |
Namespace: | tabris |
Direct subclasses: | None |
JSX Support: | Element: <RefreshComposite/> Parent Elements: <Canvas/> , <Composite/> , <Page/> , <RefreshComposite/> , <ScrollView/> , <Stack/> , <Tab/> Child Elements: Any standalone widget element Text Content: Not supported |
Examples
JavaScript
import {RefreshComposite, contentView} from 'tabris';
new RefreshComposite({layoutData: 'stretch'})
.onRefresh(() => console.log('Refreshing...'))
.appendTo(contentView);
See also:
JSX Creating a simple RefreshComposite
Constructor
new RefreshComposite(properties?)
Parameter | Type | Description |
---|---|---|
properties | Properties<RefreshComposite> |
Sets all key-value pairs in the properties object as widget properties. Optional. |
Properties
refreshEnabled
Whether the pull-to-refresh gesture can be performed by the user. When disabled, the RefreshComposite
behaves like a regular Composite
.
Type: | boolean |
Default: | true |
Settable: | Yes |
Change Event: | refreshEnabledChanged |
refreshIndicator
Whether to visualize a long running operation. After the user has triggered a manual refresh, this property is true
and should be set to false
when the operation ended.
Type: | boolean |
Default: | false |
Settable: | Yes |
Change Event: | refreshIndicatorChanged |
refreshMessage
iOS
A message to show to the user during the refresh operation.
Type: | string |
Default: | (empty string) |
Settable: | Yes |
Change Event: | refreshMessageChanged |
Events
refresh
Fired when a refresh is triggered by the user.
EventObject Type: EventObject<RefreshComposite>
This event has no additional parameter.
Change Events
refreshEnabledChanged
Fired when the refreshEnabled property has changed.
EventObject Type: PropertyChangedEvent<RefreshComposite, boolean>
Property | Type | Description |
---|---|---|
value | boolean |
The new value of refreshEnabled. |
refreshIndicatorChanged
Fired when the refreshIndicator property has changed.
EventObject Type: PropertyChangedEvent<RefreshComposite, boolean>
Property | Type | Description |
---|---|---|
value | boolean |
The new value of refreshIndicator. |
refreshMessageChanged
Fired when the refreshMessage property has changed.
EventObject Type: PropertyChangedEvent<RefreshComposite, string>
Property | Type | Description |
---|---|---|
value | string |
The new value of refreshMessage. |