* commit '511452cf4d3cd2669a89abd98658a844b852b5e3': Fix NPE when rejected snapshots are null.
This commit is contained in:
@@ -322,6 +322,7 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
|
||||
if (mListener != null) {
|
||||
mListener.onRejectSharedElements(rejectedSnapshots);
|
||||
}
|
||||
removeNullViews(rejectedSnapshots);
|
||||
startRejectedAnimations(rejectedSnapshots);
|
||||
|
||||
// Now start shared element transition
|
||||
@@ -370,6 +371,16 @@ class EnterTransitionCoordinator extends ActivityTransitionCoordinator {
|
||||
}
|
||||
}
|
||||
|
||||
private static void removeNullViews(ArrayList<View> views) {
|
||||
if (views != null) {
|
||||
for (int i = views.size() - 1; i >= 0; i--) {
|
||||
if (views.get(i) == null) {
|
||||
views.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onTakeSharedElements() {
|
||||
if (!mIsReadyForTransition || mSharedElementsBundle == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user