Package-level declarations

Types

Link copied to clipboard
data class EmbeddedUiConfig(val systemBarInLightMode: Boolean, val brightness: Float, val screenOrientation: Int) : Parcelable

This helps to restore properties of the UI/SystemUI when returning from fullscreen mode. NewPlayerViewModelImpl uses this to store the properties when switching to a fullscreen mode. When returning from a fullscreen mode NewPlayerViewModelImpl will store the current EmbeddedUiConfig in the NewPlayerUIState. When returning from fullscreen mode NewPlayerUI will then restore that configuration.

Link copied to clipboard
data class NewPlayerUIState(val uiMode: UIModeState, val playing: Boolean, val contentRatio: Float, val embeddedUiRatio: Float, val contentFitMode: ContentScale, val seekerPosition: Float, val bufferedPercentage: Float, val isLoading: Boolean, val durationInMs: Long, val playbackPositionInMs: Long, val playbackPositionInPlaylistMs: Long, val fastSeekSeconds: Int, val soundVolume: Float, val brightness: Float?, val embeddedUiConfig: EmbeddedUiConfig?, val playList: List<MediaItem>, val chapters: List<Chapter>, val shuffleEnabled: Boolean, val repeatMode: RepeatMode, val playListDurationInS: Int, val currentlyPlaying: MediaItem?, val currentPlaylistItemIndex: Int, val currentlyAvailableTracks: List<StreamTrack>, val currentlyPlayingTracks: List<StreamTrack>, val enteringPip: Boolean, val currentSeekPreviewThumbnail: ImageBitmap?, val seekPreviewVisible: Boolean)

Shows the state the UI is rendering. In the manner of MVVM, NewPlayerViewModel sends this state over to NewPlayerUI, to tell it what should be rendered.

Link copied to clipboard

The NewPlayerViewModel must live and be owned by an Activity context.

Link copied to clipboard
open class NewPlayerViewModelDummy : InternalNewPlayerViewModel

A dummy/placeholder implementation of the NewPlayerViewModel

Link copied to clipboard
class NewPlayerViewModelImpl @Inject constructor(application: Application) : AndroidViewModel, InternalNewPlayerViewModel
Link copied to clipboard

This depicts the UI mode. In layman's terms you could say it depicts which of NewPlayer's many UI screens should be visible. The UIModeState can be derived from the PlayMode. However, while PlayMode depicts in which mode to play a certain item in, UIModeState is more detailed and depicts the actually visible UI. Because of this multiple UIModeStates can be mapped to the same PlayMode.

Properties

Link copied to clipboard