I am adding content transitions to a pretty large app and in most cases I do not have any shared elements but still want to use the transition animations. I have tracked the problem down to this line of code:
ActivityOptionsCompat.makeSceneTransitionAnimation(activity, ????);
I have tried setting Pair array to null or an empty array and I have tried just leaving it out. Everything results in the following error:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewRootImpl.setPausedForTransition(boolean)' on a null object reference
However, I only get this error on Android 6.0+, it works fine on any version of Android 5. Am I trying to do this the wrong way?
Thus, by setting transition-duration to 0s, you are most closely matching how the browser defines an element without a transition. Setting the transition-duration to the default 0s renders the transition-property irrelevant.
The reason for this is, display:none property is used for removing block and display:block property is used for displaying block. A block cannot be partly displayed. Either it is available or unavailable. That is why the transition property does not work.
You can't use animations or transitions with font-family . This means, you actually can do this, but it would change the font-family immediately instead of morphing from one font-family to another. But I found a good workaround for this (here):
The values none , inherit , and initial cannot be used as part of a comma-separated list of property names; any list that uses them is syntactically invalid, and will therefore be ignored.
I did a bunch of digging in the source code and it looks like this is caused by a missed null pointer check that got fixed for Nougat.
I've got no clue how to work around it on 6.x though, unfortunately. I suppose you could add a 6.x try
/catch
if it's really killing you in terms of crashes, but that may also catch a bunch of other stuff you may not want it to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With