Fixed
Status Update
Comments
dn...@google.com <dn...@google.com>
dn...@google.com <dn...@google.com> #2
since these are in public API (:/) we need to do this in 1.2
ox...@gmail.com <ox...@gmail.com> #3
since it is already marked as deprecated, we can probably do it by now.
we...@gmail.com <we...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/61 .
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
https://android-review.googlesource.com/1396827
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request from
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
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)