Skip to content

Commit

Permalink
readMe修改
Browse files Browse the repository at this point in the history
  • Loading branch information
luhaoaimama1 committed Nov 21, 2016
1 parent e8496f5 commit 6f0281d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

遵守约定:就是google写了一套约定规范 这样大家都照规定写就可以兼容了;

dispatchNestedPreScroll (child消耗前传递给 parent)
dispatchNestedScroll (child消耗后传递给 parent)
fling和 scorll 类似 就不说了


>方法对应:子view会 触发 父view方法。一般是子view发起调用,父view接受回调。
| 子view | 父view |
| :------------: |:---------------:|
| startNestedScroll | onStartNestedScroll、onNestedScrollAccepted |
| dispatchNestedPreScroll | onNestedPreScroll(子view消耗前) |
| dispatchNestedScroll | onNestedScroll(子view消耗后) |
| stopNestedScroll | onStopNestedScroll |


[child流程接入](http://fromwiz.com/share/s/3Hsjaq1-lQ9Q2SChN02Hkyvk0hpNyB0-1QGL2Fj4sK1tPrPG)
方法的使用时机:
startNestedScroll,stopNestedScroll;使用时机
![](./demo/NestedScroll_start.png)
dispatchNestedPreScroll使用时机 此例为RecyclerView的内容;
(因为是子view消耗钱 父消耗 ) 所以 用if判断 父亲是否消耗;
![](./demo/Nested_PreScroll.png)
dispatchNestedScroll 则和上边不同;是child先消耗了;在吧剩下的给NestedParent;看他消耗不;
![](./demo/Nested_dispatchScroll.png)

[parent流程接入](http://fromwiz.com/share/s/3Hsjaq1-lQ9Q2SChN02Hkyvk2vEyiC22IktY2lqqNl1d1jF9)

Binary file added demo/NestedScroll_start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/Nested_PreScroll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/Nested_dispatchScroll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6f0281d

Please sign in to comment.