Google 致力于为黑人社区推动种族平等。查看具体举措

PlaybackGlueHost

abstract class PlaybackGlueHost
kotlin.Any
   ↳ androidx.leanback.media.PlaybackGlueHost

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 PlaybackGlue#onAttachedToHost(PlaybackGlueHost).

    Summary

    Nested classes
    abstract

    Callbacks triggered by the host(e.g. fragment) hosting the video controls/surface.

    open

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

    Public constructors

    This class represents the UI (e.g. Fragment/Activity) hosting playback controls and defines the interaction between

    Public methods
    open Unit

    Fades out the playback overlay immediately.

    open PlaybackGlueHost.PlayerCallback!

    Implemented by PlaybackGlueHost for responding to player events.

    open Unit

    Hide controls overlay.

    open Boolean

    Returns true if auto hides controls overlay.

    open Boolean

    Returns true if controls overlay is visible, false otherwise.

    open Unit

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

    open Unit

    Enables or disables controls overlay auto hidden.

    open Unit

    Enables or disables view fading.

    open Unit

    Sets the host HostCallback callback on the host.

    open Unit

    Sets the View.OnClickListener on this fragment.

    open Unit

    Sets the android.view.View.OnKeyListener on the host.

    open Unit

    Sets the Row that represents the information on control items that needs to be rendered.

    open Unit

    Sets PlaybackRowPresenter for rendering the playback controls.

    open Unit

    Show controls overlay.

    Public constructors

    <init>

    PlaybackGlueHost()

    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.