Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Steps to reproduce
To reproduce the bug, you need a
SwipeRefreshLayout
which contains aRecyclerView
, and some of theRecyclerView
items have nestedRecyclerView
.SwipeRefreshLayout
by settingsetEnabled(true)
RecyclerView
SwipeRefreshLayout
by settingsetEnabled(false)
Expected behavior
SwipeRefreshLayout
become disabled, pull-to-refresh gesture is ignored, circle spinner view does not appearActual behavior
SwipeRefreshLayout
become disabled (asisEnabled()
returnsfalse
), but it still handles pull-to-refresh gesture, circle spinner view appear (moreover, it will not disappear unless explicitly calledsetRefreshing(false)
).Only the first pull-to-refresh gesture is handled, the following are ignored as expected.
Additional information
Artifact used:
androidx.swiperefreshlayout:swiperefreshlayout:1.1.0
withandroidx.recyclerview:recyclerview:1.2.1
(sample project)androidx.swiperefreshlayout:swiperefreshlayout:1.1.0
withandroidx.recyclerview:recyclerview:1.2.0
(production project where the bug was noticed)Devices/Android versions reproduced on:
References
Some research
Looks like there are some problems with nested scroll, as
SwipeRefreshLayout#onTouchEvent
is not called, andSwipeRefreshLayout#onNestedScroll
is called when the first pull-to-refresh gesture is performed. The following gestures does not triggerSwipeRefreshLayout#onNestedScroll
.