Android TV apps can be built using the Leanback library which provides UI components for TV. Key elements include BrowseFragments to display browsable content, PlaybackActivities for media playback, and custom card views. Interaction uses focus-based navigation via the D-pad. Testing involves performing clicks and other actions on view IDs. Features like picture-in-picture and recording are supported. Open source resources are provided to learn more about developing for Android TV.
103. @Override
public void onPictureInPictureChanged(boolean inPictureInPicture) {
if (inPictureInPicture) {
// Hide the controls in picture-in-picture mode.
} else {
// Restore the playback UI based on the playback status.
}
}
104. @Override
public void onPause() {
if (mInPictureInPicture) {
// Continue playback
}
// If paused but not in PIP, pause playback if necessary
}
117. Resources
Official Android TV Documentation
github.com/hitherejoe/vineyard
Google Plus Android TV Community
github.com/hitherejoe/AndroidTvBoilerplate
github.com/hitherejoe/leanbackcards
medium.com/@hitherejoe