Allow item animations to be disabled mid-layout

Some layout changes may necessitate disabling item animations. dispatchLayout()
currently assumes that the state of item animations remains constant throughout
the method, which can result in assumptions about the non-null state of itemAnimator.

This change re-checks the state of itemAnimator after the call to onLayoutChildren(),
which can safeuly abandon attempting to animate changes if the animator has been set
to null in the meantime.

Issue #15570240 NPE when set ItemAnimator to null temporarily

Change-Id: I9c921c50612a619d6fc35c8429ac45a2d9bfcd80
1 file changed