[WEEX-86][doc] Update refresh component's document. #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch. Firstly, squash your commits into one and only one commit, then enrich your commit log to indicate what you've done in this patch, the more precisely the better.
|
||
* loading-indicator is a child component implemented with default animation effect for the refresh component. | ||
- `<loading-indicator>`: There is a special Component named loading-indicator used only inside the `<refresh>` or the `<loading>` Components, which implemented with default animation effect for the refresh component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loading-indicator: this is a dedicated component which provides a default refresh animation effect, can only be used inside the <refresh>
or <loading>
components.
|
||
* onloading triggered when loading | ||
- `show`:If a `<loading-indicator>` Component is included in the `<refresh>` Component, it will display and start the animation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loading animation will be started if a loading-indicator is included in the refresh component.
|
||
- `hide`:Collapse the refresh view. If a `<loading-indicator>` Component is included in the `<refresh>` Component, it will hide and stop the animation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse the refresh view. It also hides the loading-indicator and stops the loading animation if there's a loading-indicator included in the refresh component.
* refresh/loading does not support remove action, Weex 0.9 will fix it. | ||
* refresh/loading despite setting with display='hide', the refresh/loading view will still appear when scrolling due to known issues. it can be fixed with a another display='hide' when the refresh/loading should be hidden. | ||
* refresh/loading can only be hidden or displayed with an attribute display with value of show or hide. And there should be a statement of display='hide' when display='show' shows up in an event function, or your scroller may not response to user inputs. | ||
> **Note:** The display and hide of `<refresh>` Components can only be controlled by an attribute named `display` which has the value of show and hide. A `display="show"` statement is always paired with a `display="hide"` statement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The visibility of refresh component can be controlled by display attribute with the value show
and hide
. A display="show"
should always be paired with a display="hide"
statement.
|
||
#### Example | ||
- Simple example : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
|
||
To be rendered properly, the refresh/loading Components must appear inside the Scroller Component or the List Component. | ||
- Support all common styles, check out [common styles](../common/common-style) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check out the common styles
|
||
* loading-indicator is a child component implemented with default animation effect for the refresh component. | ||
- Triggered when the scroller or list has been pulled down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is pulled down.
|
||
Other attributes please check out the [common attributes](../common-attrs.html). | ||
- Triggered when the scroller or list has been pulled down. you can get `dy`, `pullingDistance`, `viewHeight` and `type` from onpullingdown `event` object : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is pulled down.
The attributes dy
... are accessible from the event
object:
### Events | ||
* `onrefresh`: triggered when the scroller has been pulled down | ||
* `onpullingdown`: triggered when the scroller has been pulled down. you can get `dy, pullingDistance, viewHeight, type` from onpullingdown event object. | ||
- Simple example : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
|
||
## Usage Notes | ||
|
||
- On the Android platform, it is not allowed for the refresh view to be pushed back when it is been pulling down or its onrefresh event is tiggered, while it is allow as for iOS platform and HTML5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a restriction on Android platform that the refresh view cannot be pushed back during the pulling down process or theonrefresh
event is triggered, while it is allowed both on iOS and HTML5.
|
||
### Attributes | ||
* display has value of show or hide, default value is show. | ||
### `onpullingdown` <span class="weex-version">v0.6.1+</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event name is 'pullingdown', not 'onpullingdown'
No description provided.