added in version 25.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

PlaybackGlueHost

public abstract class PlaybackGlueHost
extends Object

java.lang.Object
   ↳ android.support.v17.leanback.media.PlaybackGlueHost
Known Direct Subclasses
Known Indirect Subclasses


This class represents the UI (e.g. Fragment/Activity) hosting playback controls and defines the interaction between PlaybackGlue and the host. PlaybackGlueHost provides the following functions:

  • Render UI of PlaybackGlue: setPlaybackRow(Row), setPlaybackRowPresenter(PlaybackRowPresenter).
  • Client for fragment/activity onStart/onStop: setHostCallback(HostCallback).
  • Auto fade out controls after a short period: setFadingEnabled(boolean).
  • Key listener and ActionListener. setOnKeyInterceptListener(View.OnKeyListener), setOnActionClickedListener(OnActionClickedListener).
  • Subclass of PlaybackGlueHost may implement optional interfaces:
  • SurfaceHolderGlueHost to provide SurfaceView for video playback.
  • PlaybackSeekUi to provide seek UI to glue
  • These optional interfaces should be accessed by glue in onAttachedToHost(PlaybackGlueHost).

    Summary

    Nested classes

    class PlaybackGlueHost.HostCallback

    Callbacks triggered by the host(e.g. 

    class PlaybackGlueHost.PlayerCallback

    Optional Client that implemented by PlaybackGlueHost to respond to player event. 

    Public constructors

    PlaybackGlueHost()

    Public methods

    void fadeOut()

    This method was deprecated in API level 26.1.0. Call hideControlsOverlay(boolean)

    PlaybackGlueHost.PlayerCallback getPlayerCallback()

    Implemented by PlaybackGlueHost for responding to player events.

    void hideControlsOverlay(boolean runAnimation)

    Hide controls overlay.

    boolean isControlsOverlayAutoHideEnabled()

    Returns true if auto hides controls overlay.

    boolean isControlsOverlayVisible()

    Returns true if controls overlay is visible, false otherwise.

    void notifyPlaybackRowChanged()

    Notifies host about a change so it can update the view.

    void setControlsOverlayAutoHideEnabled(boolean enabled)

    Enables or disables controls overlay auto hidden.

    void setFadingEnabled(boolean enable)

    This method was deprecated in API level 26.1.0. Use setControlsOverlayAuto