History log of /frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b86a6c2c71514e0cb693597a955e224811b90f96 27-Sep-2017 Dake Gu <dake@google.com> leanback: prefer support lib fragment

Historically leanback implemented framework fragment class first,
and generates support lib fragment code from framework fragment code.
Now we are going to give priority to support lib fragment.
Rewrite python script to convert in the opposite direction.
This implies when we later add new feature, the support fragment will
be tried first before framework fragment.
Still not decided if we want to deprecate the framework fragment
classes.

Test: leanback tests
Bug: 66707813

Change-Id: Ie4e8ebedd5a7ce42d91361b34edcafa98e26f091
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
76c53f6a2152d31a255a36276ada145be5ec474a 21-Apr-2017 Dake Gu <dake@google.com> leanback: fix new errorprone warnings

Bug: none
Test: ./gradlew :support-leanback-v17:assmebleErrorProne
Change-Id: I519b67edae6e0f15cd1e97d79fc5478939a0940a
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
3bcad88cbf4488e747d84893c35f2351b8f84afe 21-Mar-2017 Dake Gu <dake@google.com> leanback: new transport controls

PlaybackTransportRowPresenter is the new UX.

PlaybackTransportControlGlue extends from PlaybackGlue.
PlaybackTransportControlGlue is backed by PlayerWrapper.
PlaybackWrapper wraps underlying media player,
concrete example: MediaPlayerWrapper.

PlaybackSeekDataProvider defines the data interface that app
provides to leanback.
PlaybackUI defines seeking interaction between
PlaybackTransportControlGlue, PlaybackGlueHost and the presenter.

more:
- added progress bar support for media loading.
- fixed vertical video proportion and support video size change.

Test: PlaybackTransportControlGlueTest
PlaybackTransportRowPresenterTest.
Updated SampleVideoFragment.

Bug: 33751556

Change-Id: I1d39c6f65d04121f8cb9c25fb7ce103e32355190
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
c65ceae1251b35fbf4aa72df7b5d20e764bed9d2 12-Apr-2017 Wei-Hsin <wwwllllfrank@google.com> Reuse PlayBackGlueHost when switching PlayBackGlue

Bug: 37222175
Test: sharedGlueHost() in DetailsFragmentTest
Change-Id: Icdbbfe28c11ef456743cbd2290892e2136862c6a
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
89097f67f988ebba714a95e10369665280db0c27 25-Mar-2017 Dake Gu <dake@google.com> 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
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
f87eb1d84dfee2f1be9ea326754829b1eff4967f 22-Mar-2017 Dake Gu <dake@google.com> leanback: make Details embedded video more useful

The current implementation has assumption that
the PlaybackGlue is setup during onCreate() and there
is only one PlaybackGlue allowed. The restriction
makes some use cases impossible. This CL address this
by adding more flexibility of when a PlaybackGlue can
be assigned to DetailsFragmentBackgroundController.

1. allow setupVideoPlayback() later, this allows
app add a purchase flow before playing.

2. allow setupVideoPlayback() multiple times, so
a real video can replace trailer video after
purchase flow is done.

3. Fix bug of RecyclerViewParallax not running
parallax effect when there is no item, added
a onLayoutChangeListener so that DetailsParallaxDrawable
will set correct bounds when RecyclerView is assigned
a initial size (verified by test noInitialItem)

4. new API canNavigateToVideoFragment(), this allows
app to control when DPAD_UP can navigate to videos.

5. new API switchToVideo() so that app can switch to video
UI programmatically after a purchase flow finishes.

Bug: 36126851
Test: DetailsFragmentTest DetailsSupportFragmentTest

Change-Id: I7cd4084e71b85d8fd739d30a421746312bdb086c
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
f37579e64940bfdd642cc315f6347d60b5addd69 15-Feb-2017 Dake Gu <dake@google.com> cleanup life cycle issue of PlaybackGlue in PlaybackFragment.

onDetachedFromHost should be called in onDestroy. A PlaybackGlue
should survive onDestroyView for the case setRetainInstance(true).
When configuration change, we should not need recreate PlaybackGlue.
Add a VideoFragmentTest.

Refactoring Tests to use SingleFragmentTestBase and remove
lots of redundant test Activity classes and layout files.

Changed test mp4 to be h264 Baseline profile so it can play
on API 19.

Bug: 35364233
Test: added VideoFragmentTest VideoSupportFragmentTest

Change-Id: I93bd8cbf449ac0fea4b6b76d10dc611c538283e8
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
3961cea270f51c29433a7eb21ec5f8c9ca7bd7d7 13-Feb-2017 Dake Gu <dake@google.com> MeidaPlayerGlue: Fix unable to play music, ...

... Playback state loss problem in Activity.onStop, and
leaking in enableProgressUpdate.

1. MediaPlayerGlue enableProgressUpdate() does not remove
previous Runnable, causing a leak.

2. MediaPlayerGlue.setMediaSource() does not call
prepareMediaForPlaying() and the prepare is relying on
SurfaceCreated being called. So it fails to play music.

3. onSurfaceDestroy/onSurfaceCreate should not reset player
which causing state loss in activity onStop().

Test: MediaPlayerGlueTest
Bug: 35318285 35246768 35319588

Change-Id: I254630c47199b813c13904787795ee8d4d896bd4
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
01f4dd4a9bc3b80d3ddecc0264facbf6abfc1cc3 07-Feb-2017 Dake Gu <dake@google.com> DetailsFragment: coordinate transition and PlaybackGlue

1. Exclude SurfaceView from transition because
it's quite a big hit on performance and unknown consequence
if we force the color format to be RGBA8888.
Disabled setTransitionVisibility() which causes
visual flickering even view is not running
transition. We will see the SurfaceView disappears
immediately after activity return transition is finished.

2. DetailsFragment will postpone setHost on PlaybackGlue until
all three conditions satisfied:
- onStart() is called
- activity enter transition is finished
- entrance transition is finished
It is tricky to query if enter transition will run. We did
this by checking if there is enter transition started after
200ms of data loading.

3. When DetailsFragment execute return transition:
- call DetailsBackgroundVideoHelper.disableParallax()
to avoid auto-play video when detailsFrame is
running a slide transition to bottom.
- if video is not playing: immediately remove VideoFragment
so we wont see a dark SurfaceView during return transition.
- if video is playing: Let the Video continue playing when
running return transition. (Because it's much better to
pops out VideoFragment at end than in the middle of running
transition).

4. removed 1 sec CROSSFADE_DELAY between play() and fade out
background drawable, this seems unnecessary after we have
the onPlaybackReady() callback.

Bug: 32987665
Test: leanback tests (and there is no way to test activity transition
in ActivityTestRule)

Change-Id: I2ecee0276aa6ffc7963b92cd2104bb1ca62b01cd
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java
e1cde4d4ac42a6e9e16aad2b4df970c7c7d0771c 21-Dec-2016 Dake Gu <dake@google.com> Leanback: parallax and details video API refactoring

There are too many new concpets introduced when we create
multiple building blocks around parallax. This CL tries to
get rid of some classes.

1. Remove class ParallaxSource, integrated into Parallax.
So there is no more setSource()/getSource().

2. Replace DetailsParallaxManager with DetailsParallax. It is no
longer a manager pattern but DetailsParallax is a direct
subclass of Parallax.

3. Replace DetailsBackgroundParallaxHelper with
DetailsParallaxDrawable which is a direct subclass of
CompositeDrawble. No more helper concept.

4. remove the glue creation API from DetailsFragment, those
are not necessary and app can do it on the side.

The summary of new classes:
1. Parallax, tracks multiple UI events and perform multiple
ParallaxEffects on ParallaxTargets. RecyclerViewParallax is a
subclass of Parallax that monitors RecyclerView child positions.

2. DetailsParallax is a subclass of RecyclerViewParallax,
DetailsFragment holds the DetailsParallax object and is responsible
to attach it to VerticalGridView and sync with Transition animation.
DetailsParallax is shared by both background bitmap and video.

3. Created a DetailsFragmentBackgroundController class responsible
for parallax background and embedded video playing.

Bug: 33750080
Bug: 33751156
Test: all existing leanback tests

Change-Id: Iec81a444d5d4fbeb675f16222b09b407acf007a2
/frameworks/support/v17/leanback/src/android/support/v17/leanback/app/DetailsSupportFragmentBackgroundController.java