XiqingLiu / Custombehavior
自定义Behavior,实现QQ联系人tab和header动画
Stars: ✭ 188
Programming Languages
java
68154 projects - #9 most used programming language
CustomBehavior
自定义CoordinatorLayout的Behavior,实现QQ联系人tab和header动画
效果
大概思路
- 布局
主要分三部分,header TabLayout ViewPager,由于CoordinatorLayout继承自ViewGroup,类似FrameLayout,所以需要将子View定位,定位思路重写onLayoutChild,细节查看HeaderTabViewBehavior和HeaderViewPagerBehavior
- Tab依赖于Header
- ViewPager依赖于Tab
- 滑动 在onNestedPreScroll内处理header的垂直平移
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].