Fixed
Status Update
Comments
fr...@gmail.com <fr...@gmail.com> #2
Hi,
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
We have passed this defect on to the development team and will update this issue with more information as it becomes available.
Thanks
fr...@gmail.com <fr...@gmail.com> #3
Thought I should mention for posterity, a temporary workaround is:
mStaggeredGridLayoutManager.setItemPrefetchEnabled(false);
mStaggeredGridLayoutManager.setItemPrefetchEnabled(false);
al...@gmail.com <al...@gmail.com> #4
[Comment deleted]
sm...@gmail.com <sm...@gmail.com> #5
The bug is reproduced on physical device.
1. RecyclerView with GridLayoutManager (3 column)
2. All items has span = 3 (grid look like simple list)
3. Scrolling up and down is working fine
4. Insert items in the middle of the list (All inserted items has span 3 too)
5. call to notifyDataChanged()
6. Grid is expanded with animation
6. Scrolling up and down is failed.
Problem is found after adding android:animateLayoutChanges="true" into a parent layout.
Bug reproducing is stable.
1. RecyclerView with GridLayoutManager (3 column)
2. All items has span = 3 (grid look like simple list)
3. Scrolling up and down is working fine
4. Insert items in the middle of the list (All inserted items has span 3 too)
5. call to notifyDataChanged()
6. Grid is expanded with animation
6. Scrolling up and down is failed.
Problem is found after adding android:animateLayoutChanges="true" into a parent layout.
Bug reproducing is stable.
am...@google.com <am...@google.com> #6
Bug reproduced id add "android:animateLayoutChanges="true" to list item layout:
RecycleView
--Root Item view layout is: RelativeLayout
----LinearLayout
--------ViewPager
----------Page0: is <LinearLayout... "android:animateLayoutChanges="true".../> <-- this attr is the bug reason
RecycleView
--Root Item view layout is: RelativeLayout
----LinearLayout
--------ViewPager
----------Page0: is <LinearLayout... "android:animateLayoutChanges="true".../> <-- this attr is the bug reason
fr...@gmail.com <fr...@gmail.com> #7
You cannot use android:animateLayoutChanges with RecyclerView.
It will try to animate children of the RecyclerView and conflict with the ItemAnimator.
You can still use TransitionManager directly (which that attribute uses) but make sure to exclude RecyclerView's children.
It will try to animate children of the RecyclerView and conflict with the ItemAnimator.
You can still use TransitionManager directly (which that attribute uses) but make sure to exclude RecyclerView's children.
fr...@gmail.com <fr...@gmail.com> #8
Hi, original reporter here. I did not use animateLayoutChanges. See example project in original report.
am...@google.com <am...@google.com> #9
sorry for the confusion, i've re-opened the ticket.
sm...@gmail.com <sm...@gmail.com> #10
I face same problem , no solution till now ?
il...@google.com <il...@google.com>
al...@gmail.com <al...@gmail.com> #11
it is fixed internally, so in the next release it should be fine.
pe...@gmail.com <pe...@gmail.com> #12
public class MyStaggerLayoutManager extends StaggeredGridLayoutManager {
public MyStaggerLayoutManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
public MyStaggerLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void collectAdjacentPrefetchPositions(int dx, int dy, RecyclerView.State state, LayoutPrefetchRegistry layoutPrefetchRegistry) {
try {
super.collectAdjacentPrefetchPositions(dx, dy, state, layoutPrefetchRegistry);
} catch (IllegalArgumentException e) {
LogUtils.e("catch IllegalArgumentException");
}
}
}
i fixed it by using custom LayoutManager
public MyStaggerLayoutManager(int spanCount, int orientation) {
super(spanCount, orientation);
}
public MyStaggerLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void collectAdjacentPrefetchPositions(int dx, int dy, RecyclerView.State state, LayoutPrefetchRegistry layoutPrefetchRegistry) {
try {
super.collectAdjacentPrefetchPositions(dx, dy, state, layoutPrefetchRegistry);
} catch (IllegalArgumentException e) {
LogUtils.e("catch IllegalArgumentException");
}
}
}
i fixed it by using custom LayoutManager
dn...@google.com <dn...@google.com> #13
We have the same problem with version 25.1.0 and made the decision to go back to 25.0.1
Description
Version used: 25.1.0
Devices/Android versions reproduced on:
Nexus 4 Nougat API 25
The issues happens when the MediaControllerCompat is created with the token of the a MediaSessionCompat which has its lifecycle bind to the application.
Here is the LeakCanary log:
In br.com.me.mediacontrollercompatreprocase:1.0:1.
* br.com.me.mediacontrollercompatreprocase.AnotherActivity has leaked:
* GC ROOT android.os.ResultReceiver$MyResultReceiver.this$0
* references android.support.v4.media.session.MediaControllerCompat$MediaControllerImplApi21$1.this$0 (anonymous subclass of android.os.ResultReceiver)
* references android.support.v4.media.session.MediaControllerCompat$MediaControllerImplApi24.mControllerObj
* references android.media.session.MediaController.mContext
* leaks br.com.me.mediacontrollercompatreprocase.AnotherActivity instance
* Retaining: 48 KB.
* Reference Key: c72cb728-7e92-4fce-959a-b2a856ea7af6
* Device: unknown Android Android SDK built for x86_64 sdk_google_phone_x86_64
* Android Version: 7.1 API: 25 LeakCanary: 1.5 00f37f5
* Durations: watch=5013ms, gc=112ms, heap dump=3237ms, analysis=18682ms
For more details, you could use the following sample to reproduce it.