这是我的布局:
CoordinatorLayout
AppBarLayout
...
AnimatableTabs
SwipeRefreshLayout
现在没有问题。
现在,Down Gesture的行为是:
1.首先扩展AppBarLayout。
2.show pullDownRefresh SwipeRefreshLayout第二圈。
但是,在我为AnimatableTabs添加动画之后。
```kotlin appbar.addOnOffsetChangedListener {appBarLayout,verticalOffset - > ...
// FIXME: 2018/3/5
//This code make behavior incorrectly.
ll_tabs.apply {
ll_tabs_left.apply widthProvider@ {
layoutParams = (layoutParams as LinearLayout.LayoutParams).apply {
leftMargin = ([email protected] * collapsedHotPercent).toInt()
}
}
ll_tabs_right.apply widthProvider@ {
layoutParams = (layoutParams as LinearLayout.LayoutParams).apply {
rightMargin = ([email protected] * collapsedHotPercent).toInt()
}
}
//It seems requestLayout() make behavior incorrectly.
}
}
发生了一个问题:
羽绒手势的行为是:
展开AppBarLayout并同时显示pullDownRefresh Circle。
这是代码:
无论如何要解决它?似乎requestLayout()使行为不正确。
解决了。通过改变xml结构:
CoordinatorLayout
AppBarLayout
...
Tabs
AnimatableElements
SwipeRefreshLayout
现在我可以使用自定义行为了。