Fixed
Status Update
Comments
dn...@google.com <dn...@google.com>
dn...@google.com <dn...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ox...@gmail.com <ox...@gmail.com> #3
dn...@google.com <dn...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically ( b/140759491 ).
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
https://android-review.googlesource.com/1288456
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
we...@gmail.com <we...@gmail.com> #5
I'm getting the same crash when using TransitionManager to animate the RecyclerView's bounds (changing the constraintSet with ConstraintLayout) if the user is interacting with the list. The problem doesn't occur if the user is not interacting with the list during the transition.
pa...@raizlabs.com <pa...@raizlabs.com> #6
[Comment deleted]
pa...@raizlabs.com <pa...@raizlabs.com> #7
[Comment deleted]
pa...@raizlabs.com <pa...@raizlabs.com> #8
[Comment deleted]
pa...@raizlabs.com <pa...@raizlabs.com> #9
[Comment deleted]
pa...@raizlabs.com <pa...@raizlabs.com> #10
I got a similar issue will expanding/collapsing items in a recyclerView. I posted earlier but I removed my post when I thought it was fixed and related to something else than the TransitionManager.
But I got the crash again so I investigated further.
The Issue is happening when you are not specifying a transition to the TransitionManager and that you let Android defining it for you, like :
TransitionManager.beginDelayedTransition(hiddenSection);
If you specify an animation it should solve your issue. Try something like that :
chevron.setOnClickListener(v -> {
ChangeBounds changeBounds = new ChangeBounds();
changeBounds.setDuration(hiddenSection.getMeasuredHeight());
TransitionManager.beginDelayedTransition(hiddenSection, changeBounds);
chevron.setRotation(hiddenSection.getVisibility() == View.GONE ? 0 : 180);
hiddenSection.setVisibility(hiddenSection.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
});
Hope it help :)
Also don't notify the adapter that the item changed. Otherwise the items might overlaps each others.
But I got the crash again so I investigated further.
The Issue is happening when you are not specifying a transition to the TransitionManager and that you let Android defining it for you, like :
TransitionManager.beginDelayedTransition(hiddenSection);
If you specify an animation it should solve your issue. Try something like that :
chevron.setOnClickListener(v -> {
ChangeBounds changeBounds = new ChangeBounds();
changeBounds.setDuration(hiddenSection.getMeasuredHeight());
TransitionManager.beginDelayedTransition(hiddenSection, changeBounds);
chevron.setRotation(hiddenSection.getVisibility() == View.GONE ? 0 : 180);
hiddenSection.setVisibility(hiddenSection.getVisibility() == View.GONE ? View.VISIBLE : View.GONE);
});
Hope it help :)
Also don't notify the adapter that the item changed. Otherwise the items might overlaps each others.
so...@gmail.com <so...@gmail.com> #11
Any update on this? I'm having the same problem. It's not happening all the time but I can confirm:
- It's just happening when the transition it's not passed as an argument.
-- TransitionManager.beginDelayedTransition(mRecyclerView); <------ This crashes
-- TransitionManager.beginDelayedTransition(mRecyclerView, new ChangeBounds()); <------ This does not crash
- It's happening when the RecyclerView VH that is gonna perform the animation is taller than the screen itself.
- It's just happening when the transition it's not passed as an argument.
-- TransitionManager.beginDelayedTransition(mRecyclerView); <------ This crashes
-- TransitionManager.beginDelayedTransition(mRecyclerView, new ChangeBounds()); <------ This does not crash
- It's happening when the RecyclerView VH that is gonna perform the animation is taller than the screen itself.
so...@gmail.com <so...@gmail.com> #12
At the moment I'm not sure about my last point (...taller than the screen...).
so...@gmail.com <so...@gmail.com> #13
As well:
- new TransitionSet().addTransition(new Fade()).addTransition(new ChangeBounds())); <-------- This crashes
- new TransitionSet().addTransition(new ChangeBounds())); <-------- This doesn't crash
- new TransitionSet().addTransition(new Fade()).addTransition(new ChangeBounds())); <-------- This crashes
- new TransitionSet().addTransition(new ChangeBounds())); <-------- This doesn't crash
so...@gmail.com <so...@gmail.com> #14
Okay, I have something.
Looks like DiffTool is on my way. RecyclerView DiffTool is doing what I was trying to achieve with TransitionManager.beginDelayedTransition(hiddenSection), so when I removed that line the random crash disappeared. I added DiffUtil afterwards so I didn't realize that DiffTool was performing such animations.
Looks like DiffTool is on my way. RecyclerView DiffTool is doing what I was trying to achieve with TransitionManager.beginDelayedTransition(hiddenSection), so when I removed that line the random crash disappeared. I added DiffUtil afterwards so I didn't realize that DiffTool was performing such animations.
ma...@gmail.com <ma...@gmail.com> #15
Hey Googlers, I know how to fix it.
I already found this issue and fixed it in my transitions backporthttps://github.com/andkulikov/Transitions-Everywhere
The issue is Visibility transition has to detach an animating view from an overlay in onPause as the transition could be canceled at this moment and the view could be reused somewhere else(recyclerview)
The Commit with the fix:
https://github.com/andkulikov/Transitions-Everywhere/commit/0d977dd7dddee12bdb02f78b1d4c10d649190b26
Also I believe it should be fixed in framework's transitions.
Everyone from this topic who wants to use fixed version of transitions can usehttps://github.com/andkulikov/Transitions-Everywhere for now
I already found this issue and fixed it in my transitions backport
The issue is Visibility transition has to detach an animating view from an overlay in onPause as the transition could be canceled at this moment and the view could be reused somewhere else(recyclerview)
The Commit with the fix:
Also I believe it should be fixed in framework's transitions.
Everyone from this topic who wants to use fixed version of transitions can use
ma...@gmail.com <ma...@gmail.com> #16
More details about this issue and how to fix it in Transitions framework - https://issuetracker.google.com/issues/67856407
is...@google.com <is...@google.com>
an...@google.com <an...@google.com> #17
Fixed in both androidx transitions and recyclerview and will be released as
androidx.transition:transition:1.1.0-alpha1
androidx.recyclerview:recyclerview:1.1.0-alpha01
androidx.transition:transition:1.1.0-alpha1
androidx.recyclerview:recyclerview:1.1.0-alpha01
be...@gmail.com <be...@gmail.com> #18
The fix is not perfect. If I am scrolling, and the transition happens, I loose the touch, need to lift the finger and put again on the screen.
On my apps, I usually do:
TransitionManager.beginDelayedTransition(parentLayout, transition)
filterRecycler.isVisible = !filterRecycler.isVisible
filterItem.isEnabled = false
defaultRecycler.setOnTouchListener { _, _ -> true }
launch(Dispatchers.Main) {
delay(transitionDelay + 50)
filterItem.isEnabled = true
defaultRecycler.setOnTouchListener { _, _ -> false }
}
Video sample of the bug:
https://photos.app.goo.gl/WCSCangdyVeHbVoe9
On my apps, I usually do:
TransitionManager.beginDelayedTransition(parentLayout, transition)
filterRecycler.isVisible = !filterRecycler.isVisible
filterItem.isEnabled = false
defaultRecycler.setOnTouchListener { _, _ -> true }
launch(Dispatchers.Main) {
delay(transitionDelay + 50)
filterItem.isEnabled = true
defaultRecycler.setOnTouchListener { _, _ -> false }
}
Video sample of the bug:
Description
Version used: 25.0.0 and 25.0.1. Haven't tried earlier versions.
Devices/Android versions reproduced on: N6p 7.1.1, 6.0 emulator
Here's a video showing the issue occurring in plaid:
Using a TransitionManager to expand/collapse an item in RecyclerView causes the following exception when clicking the same item multiple times without letting the animation complete. The problem occurs in our app and can be reproduced in plaid as well and the below exception is from plaid.
To reproduce on plaid go to the page with comments and position the RecyclerView so that an expansion will cause the bottom item to go off the bottom of the screen. Now keep clicking the item without letting the expansion animation complete and it will crash after a few seconds.
12-11 11:30:27.508 31668-31668/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.plaidapp, PID: 31668
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4417)
at android.view.ViewGroup.addView(ViewGroup.java:4258)
at android.view.ViewGroup.addView(ViewGroup.java:4198)
at android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:676)
at android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107)
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:7399)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7357)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7345)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1459)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1408)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:580)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3325)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3181)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3627)
at android.view.View.layout(View.java:17637)
at android.view.ViewGroup.layout(ViewGroup.java:5575)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17637)
at android.view.ViewGroup.layout(ViewGroup.java:5575)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17637)
at android.view.ViewGroup.layout(ViewGroup.java:5575)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17637)
at android.view.ViewGroup.layout(ViewGroup.java:5575)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:726)
at android.view.View.layout(View.java:17637)
at android.view.ViewGroup.layout(ViewGroup.java:5575)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2346)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2068)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)