DetailsFragment: support switchToVideo in onCreate

Allows DetailsFragment to be put in intial video mode
and skip entrance transition and enter transition.

The DetailsFragment's state model is fairly complicated
including entrance transition, enter transition and
switchToVideo call. So reworked StateMachine and based
DetailsFragment on StateMachine, remove the PF_ flags used
before.

When switchToVideo is called in DetailsFragment.onCreate,
there is no video fragment yet, but we still fade out
cover drawable and create a pending flag once the video
fragment view is created will focus on to it.

Added support in GridLayoutManager to allow slideOut() when
there is no child, and layout the first pass out of
window.

switchToVideo is not allowed with entrance transition.
once prepareEntranceTransition is called, switchToVideo will
be ignored until entrance transition is finished. On the other
hand, calling prepareEntranceTransition after switchToVideo
will be ignored.

switchToVideo will clear activity enter transitions. Once
it is called in onCreate, we do not want the activity enter
transition to run.

Test: bunch of new tests in DetailsFragmentTest for all kinds
of scenarios
Bug: 36126851

Change-Id: Ic0279331b12b1e285507dffda3ad351245c01a1b
19 files changed