material-components / material-components/material-components-android
[AppBarLayout] appBarLayout cause coordinatorLayout swipe stucks while swipeRefreshLayout is the parent.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:**
For some reason I have to put `coordinatorLayout` inside `swipeRefreshLayout`, it scrolls well if there is no `appBarLayout` inside `coordinatorLayout`, but if I put `appBarLayout` inside `coordinatorLayout`, the swipe down gesture not works as expected.

**Expected behavior:**
When appBarLayout removed.

**Source code:**
```
swipeRefreshLayout {
onRefresh { isRefreshing = false } // just for test
coordinatorLayout {
// appbar start
appBarLayout {
button("appBarLayout") {
padding = dip(32)
}.lparams(matchParent, wrapContent) {
scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
}
}.lparams(matchParent, wrapContent) {
behavior = AppBarLayout.Behavior()
}
//appbar end
recyclerView {
backgroundColor = 0xff66ff66.toInt()
layoutManager = LinearLayoutManager(context)
// adapter = //todo set adapter.
}.lparams(matchParent, wrapContent) {
behavior = AppBarLayout.ScrollingViewBehavior()
}
}
}
```
**Android API version:** Android 11
**Material Library version:** 1.3.0-alpha03
**Device:** Pixel 3a AVD
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided nested SwipeRefreshLayout, CoordinatorLayout, AppBarLayout, and RecyclerView example on Android 11 with Material Library 1.3.0-alpha03. Compare the swipe-down gesture with and without AppBarLayout, and verify that refresh behavior works as expected while the app bar remains present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100