Separate animation applying logic from commitVisibility

Test: Refactoring. Pass existing tests.
Bug: 131661052

Change-Id: Ic455bcf77d405410ed8639664b643564fb089338
6 files changed