Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

PlaybackSupportFragment

open class PlaybackSupportFragment : Fragment
kotlin.Any
   ↳ androidx.fragment.app.Fragment
   ↳ androidx.leanback.app.PlaybackSupportFragment

A fragment for displaying playback controls and related content.

A PlaybackSupportFragment renders the elements of its ObjectAdapter as a set of rows in a vertical list. The Adapter's PresenterSelector must maintain subclasses of RowPresenter.

A playback row is a row rendered by PlaybackRowPresenter. App can call setPlaybackRow(Row) to set playback row for the first element of adapter. App can call setPlaybackRowPresenter(PlaybackRowPresenter) to set presenter for it. setPlaybackRow(Row) and setPlaybackRowPresenter(PlaybackRowPresenter) are optional, app can pass playback row and PlaybackRowPresenter in the adapter using setAdapter(ObjectAdapter).

Hiding and showing controls: the controls are initially visible and automatically show/hide when play/pause or user interacts with fragment.

  • App may manually call showControlsOverlay(boolean) or hideControlsOverlay(boolean) to show or hide the controls.
  • The controls are visible by default upon onViewCreated(). To make it initially invisible, call hideControlsOverlay(false) in overridden onViewCreated().
  • Upon play or pause, PlaybackControlGlue or PlaybackTransportControlGlue will fade-in the controls and automatically fade out after a delay customized by R.attr#playbackControlsAutoHideTimeout. To disable the fade in and fade out behavior: call #setControlsOverlayAutoHideEnabled(boolean) with false.
  • Upon user interaction event, fragment will fade-in the controls and automatically fade out after a delay customized by R.attr#playbackControlsAutoHideTickleTimeout. To disable the fade in and fade out behavior, call with false.

Summary

Constants
static Int

A dark translucent background.

static Int

A light translucent background.

static Int

No background.

Public constructors

Public methods
open Unit

Fades out the playback overlay immediately.

open ObjectAdapter!

open Int

Returns the background type.

open ProgressBarManager!

Returns the ProgressBarManager that will show or hide progress bar in onBufferingStateChanged(boolean).

open Unit

Hide controls overlay.

open Boolean

Returns true if controls will be auto hidden after a delay when fragment is resumed.

open Boolean

Returns true if controls overlay is visible, false otherwise.

open Boolean

open Boolean

Returns true if showing and auto-hiding controls when user interacts; false otherwise.

open Unit

Updates the ui when the row data changes.

open Unit
onCreate(savedInstanceState: Bundle?)

open View?
onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?)

open Unit

open Unit

open Unit

open Unit

open Unit

open Unit

open Unit
onViewCreated(@NonNull view: View, @Nullable savedInstanceState: Bundle?)

open Unit

Sets the list of rows for the fragment.

open Unit

Sets the background type.

open Unit

Enables or disables auto hiding controls overlay after a short delay fragment is resumed.

open Unit

open Unit

Sets the PlaybackGlueHost.HostCallback.

open Unit

This listener is called every time there is a click in RowsSupportFragment.

open Unit

This listener is called every time there is a selection in RowsSupportFragment.

Unit

Sets the input event handler.

open Unit

Sets the BaseOnItemViewClickedListener that would be invoked for clicks only on androidx.leanback.widget.PlaybackRowPresenter.ViewHolder.

open Unit

Sets the playback row for the playback controls.

open Unit

Sets the presenter for rendering the playback row set by setPlaybackRow(Row).

open Unit

Interface to be implemented by UI widget to support PlaybackSeekUi.

open Unit

Sets the selected row position with smooth animation.

open Unit
setSelectedPosition(position: Int, smooth: Boolean)

Sets the selected row position.

open Unit
setShowOrHideControlsOverlayOnUserInteraction(showOrHideControlsOverlayOnUserInteraction: Boolean)

Enables or disables showing and auto-hiding controls when user interacts.

open Unit

Show controls overlay.

open Unit

Tickles the playback controls.

Protected methods
open Unit

Called when media has start or stop buffering.

open Unit
onError(errorCode: Int, errorMessage: CharSequence!)

Called when media has error.

open Unit
onVideoSizeChanged(videoWidth: Int, videoHeight: Int)

Called when size of the video changes.

Inherited functions