BottomSheetBehavior源码部分浅析

BottomSheetBehavior

有几个概念需要特别注意:

a descendant of the CoordinatorLayout:子视图(包括直接子视图及其后代视图)
the child view of the CoordinatorLayout:直接子视图
the descendant view of the CoordinatorLayout:子视图(后代视图),并不一定是直接子视图

/**
Called when a descendant of the CoordinatorLayout attempts to initiate a nested scroll.
当CoordinatorLayout的子节点(包括所有子节点并不止直接子节点)尝试开始一个内嵌滚动时调用。(内嵌滚动如:NestedScrollView, RecyclerView, or ListView/ScrollView on API 21+).
Any Behavior associated with any direct child of the CoordinatorLayout may respond to this event and return true to indicate that the CoordinatorLayout should act as a nested scrolling parent for this scroll. Only Behaviors that return true from this method will receive subsequent nested scroll events.
与CoordinatorLayout“直接”子节点相关的任何Behavior都可以响应这个事件,并且如果返回true则代表这个CoordinatorLayout应该作为这个内嵌滚动的父视图。只有这个方法返回true的Behaviors才会接收到随后的内嵌滚动事件。
Parameters:
coordinatorLayout - the CoordinatorLayout parent of the view this Behavior is associated with 
与这个behavior相关的视图的父视图即CoordinatorLayout 
child - the child view of the CoordinatorLayout this Behavior is associated with 
与这个Behavior相关的CoordinatorLayout视图的“直接”子视图,其实就是标有BottomSheetBehavior的那个视图
directTargetChild - the child view of the CoordinatorLayout that either is or contains the target of the nested scroll operation 
是或者包含正在滑动的那个内嵌视图的视图,而且这个视图是CoordinatorLayout的“直接”子视图
target - the descendant view of the CoordinatorLayout initiating the nested scroll 
指正在开始滑动的内嵌视图,当然这个视图必须是CoordinatorLayout的子视图(并不一定是直接子视图)
nestedScrollAxes - the axes
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值