Obsolete
Status Update
Comments
au...@google.com <au...@google.com>
rv...@google.com <rv...@google.com> #2
one more workaround is
fun RecyclerView.executeAfterAllAnimationsAreFinished(
callback: (RecyclerView) -> Unit
) = post(
object : Runnable {
override fun run() {
if (isAnimating) {
//if isAnimating() returned true itemAnimator will be non-null
itemAnimator!!.isRunning {
post(this)
}
} else {
callback(this@executeAfterAllAnimationsAreFinished)
}
}
}
)
fun RecyclerView.executeAfterAllAnimationsAreFinished(
callback: (RecyclerView) -> Unit
) = post(
object : Runnable {
override fun run() {
if (isAnimating) {
//if isAnimating() returned true itemAnimator will be non-null
itemAnimator!!.isRunning {
post(this)
}
} else {
callback(this@executeAfterAllAnimationsAreFinished)
}
}
}
)
au...@google.com <au...@google.com> #3
To fix it:
- set horizontal constraints in recycler view
- set recycler view
layout_width
to 0dp
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical"
android:overScrollMode="ifContentScrolls"
android:scrollbars="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/headerTextView"
tools:listitem="@layout/list_item" />
ap...@google.com <ap...@google.com> #4
@3 Why should there be a difference between horizontal constraints with size 0, and just match_parent?
They are supposed to be the same.
The workaround helped, but this doesn't mean there is no bug.
In fact you show there is another bug: there is a difference between those 2 cases.
They are supposed to be the same.
The workaround helped, but this doesn't mean there is no bug.
In fact you show there is another bug: there is a difference between those 2 cases.
pr...@google.com <pr...@google.com> #6
#3 worked for me
Description
(sorry if this is a duplicate or if it isn't happening often or otherwise not worth keeping open)
I noticed an error athttps://ci.android.com/builds/submitted/12210773/androidx_host_tests/latest/view/logs%2Fbuild_error.log saying
It reminds me of https://issuetracker.google.com/issues/176979872#comment4 where Ian resolved what looks to me like a similar message - maybe he knows more about how to figure this out