├── .gitignore
├── LICENSE
├── README.md
├── build.gradle
├── episode_1
└── TVDemoApp
│ ├── .gitignore
│ ├── TVDemoApp.iml
│ ├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ ├── CardPresenter.java
│ │ │ ├── DetailsDescriptionPresenter.java
│ │ │ ├── Movie.java
│ │ │ ├── MovieList.java
│ │ │ ├── PicassoBackgroundManagerTarget.java
│ │ │ ├── PlayerActivity.java
│ │ │ ├── TVDemoActivity.java
│ │ │ ├── TVDemoFragment.java
│ │ │ ├── TVDetailsActivity.java
│ │ │ ├── TVGridActivity.java
│ │ │ ├── TVGridFragment.java
│ │ │ ├── TVSearchActivity.java
│ │ │ ├── TVSearchFragment.java
│ │ │ ├── TVVideoDetailsFragment.java
│ │ │ └── Utils.java
│ │ └── res
│ │ ├── drawable-hdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── card_background_default.9.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── movie.png
│ │ ├── scrubber_disabled.png
│ │ ├── scrubber_focussed.png
│ │ ├── scrubber_normal.png
│ │ ├── scrubber_pressed.png
│ │ ├── shadow7.9.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-mdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── ic_pause_playcontrol_focussed.png
│ │ ├── ic_pause_playcontrol_normal.png
│ │ ├── ic_pause_playcontrol_pressed.png
│ │ ├── ic_play_action_focussed.png
│ │ ├── ic_play_action_normal.png
│ │ ├── ic_play_action_pressed.png
│ │ ├── ic_play_playcontrol_focussed.png
│ │ ├── ic_play_playcontrol_normal.png
│ │ ├── ic_play_playcontrol_pressed.png
│ │ ├── movie.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xxhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── details_img.png
│ │ ├── ic_action_a.png
│ │ ├── ic_title.png
│ │ ├── movie.png
│ │ ├── player_bg_gradient_dark.xml
│ │ ├── shadow7.9.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── layout
│ │ ├── activity_grid.xml
│ │ ├── activity_player.xml
│ │ ├── activity_search.xml
│ │ ├── activity_tvdemo.xml
│ │ └── activity_tvdetails.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── episode_2
└── TVDemoApp
│ ├── .gitignore
│ ├── TVDemoApp.iml
│ ├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ ├── CardPresenter.java
│ │ │ ├── CustomHeadersFragment.java
│ │ │ ├── CustomRowsFragment.java
│ │ │ ├── DetailsDescriptionPresenter.java
│ │ │ ├── Movie.java
│ │ │ ├── MovieList.java
│ │ │ ├── PicassoBackgroundManagerTarget.java
│ │ │ ├── PlayerActivity.java
│ │ │ ├── TVDemoActivity.java
│ │ │ ├── TVDemoFragment.java
│ │ │ ├── TVDetailsActivity.java
│ │ │ ├── TVGridActivity.java
│ │ │ ├── TVGridFragment.java
│ │ │ ├── TVSearchActivity.java
│ │ │ ├── TVSearchFragment.java
│ │ │ ├── TVVideoDetailsFragment.java
│ │ │ └── Utils.java
│ │ └── res
│ │ ├── drawable-hdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── card_background_default.9.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── movie.png
│ │ ├── scrubber_disabled.png
│ │ ├── scrubber_focussed.png
│ │ ├── scrubber_normal.png
│ │ ├── scrubber_pressed.png
│ │ ├── shadow7.9.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-mdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── ic_pause_playcontrol_focussed.png
│ │ ├── ic_pause_playcontrol_normal.png
│ │ ├── ic_pause_playcontrol_pressed.png
│ │ ├── ic_play_action_focussed.png
│ │ ├── ic_play_action_normal.png
│ │ ├── ic_play_action_pressed.png
│ │ ├── ic_play_playcontrol_focussed.png
│ │ ├── ic_play_playcontrol_normal.png
│ │ ├── ic_play_playcontrol_pressed.png
│ │ ├── movie.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xxhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── details_img.png
│ │ ├── ic_action_a.png
│ │ ├── ic_title.png
│ │ ├── movie.png
│ │ ├── player_bg_gradient_dark.xml
│ │ ├── shadow7.9.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── layout
│ │ ├── activity_custom.xml
│ │ ├── activity_grid.xml
│ │ ├── activity_player.xml
│ │ ├── activity_search.xml
│ │ ├── activity_tvdemo.xml
│ │ └── activity_tvdetails.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── episode_3
└── TVDemoApp
│ ├── .gitignore
│ ├── TVDemoApp.iml
│ ├── app
│ ├── .gitignore
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ └── ApplicationTest.java
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ ├── CardPresenter.java
│ │ │ ├── CustomFrameLayout.java
│ │ │ ├── CustomHeadersFragment.java
│ │ │ ├── CustomRowsFragment.java
│ │ │ ├── DetailsDescriptionPresenter.java
│ │ │ ├── Movie.java
│ │ │ ├── MovieList.java
│ │ │ ├── PicassoBackgroundManagerTarget.java
│ │ │ ├── PlayerActivity.java
│ │ │ ├── TVDemoActivity.java
│ │ │ ├── TVDemoFragment.java
│ │ │ ├── TVDetailsActivity.java
│ │ │ ├── TVGridActivity.java
│ │ │ ├── TVGridFragment.java
│ │ │ ├── TVSearchActivity.java
│ │ │ ├── TVSearchFragment.java
│ │ │ ├── TVVideoDetailsFragment.java
│ │ │ └── Utils.java
│ │ └── res
│ │ ├── drawable-hdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── card_background_default.9.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── movie.png
│ │ ├── scrubber_disabled.png
│ │ ├── scrubber_focussed.png
│ │ ├── scrubber_normal.png
│ │ ├── scrubber_pressed.png
│ │ ├── shadow7.9.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-mdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── default_background.xml
│ │ ├── grid_bg.png
│ │ ├── ic_launcher.png
│ │ ├── ic_pause_playcontrol_focussed.png
│ │ ├── ic_pause_playcontrol_normal.png
│ │ ├── ic_pause_playcontrol_pressed.png
│ │ ├── ic_play_action_focussed.png
│ │ ├── ic_play_action_normal.png
│ │ ├── ic_play_action_pressed.png
│ │ ├── ic_play_playcontrol_focussed.png
│ │ ├── ic_play_playcontrol_normal.png
│ │ ├── ic_play_playcontrol_pressed.png
│ │ ├── movie.png
│ │ ├── star_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xxhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_launcher.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── details_img.png
│ │ ├── ic_action_a.png
│ │ ├── ic_title.png
│ │ ├── movie.png
│ │ ├── player_bg_gradient_dark.xml
│ │ ├── shadow7.9.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── layout
│ │ ├── activity_custom.xml
│ │ ├── activity_grid.xml
│ │ ├── activity_player.xml
│ │ ├── activity_search.xml
│ │ ├── activity_tvdemo.xml
│ │ └── activity_tvdetails.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── episode_4
└── TVDemoApp
│ ├── .gitignore
│ ├── TVDemoApp.iml
│ ├── app
│ ├── app.iml
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── androidtv-leanback-sample.png
│ │ ├── java
│ │ └── com
│ │ │ └── sgottard
│ │ │ └── tvdemoapp
│ │ │ ├── Utils.java
│ │ │ ├── data
│ │ │ ├── PaginatedCursor.java
│ │ │ ├── VideoContentProvider.java
│ │ │ ├── VideoDatabase.java
│ │ │ ├── VideoItemLoader.java
│ │ │ └── VideoProvider.java
│ │ │ ├── model
│ │ │ └── Movie.java
│ │ │ ├── presenter
│ │ │ ├── CardPresenter.java
│ │ │ ├── DetailsDescriptionPresenter.java
│ │ │ ├── GridItemPresenter.java
│ │ │ └── IconHeaderItemPresenter.java
│ │ │ ├── recommendation
│ │ │ ├── BootupActivity.java
│ │ │ ├── RecommendationBuilder.java
│ │ │ └── UpdateRecommendationsService.java
│ │ │ └── ui
│ │ │ ├── BrowseErrorActivity.java
│ │ │ ├── CustomFrameLayout.java
│ │ │ ├── CustomHeadersFragment.java
│ │ │ ├── CustomRowsFragment.java
│ │ │ ├── ErrorFragment.java
│ │ │ ├── GuidedStepActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MainFragment.java
│ │ │ ├── MoreSamplesFragment.java
│ │ │ ├── MovieDetailsActivity.java
│ │ │ ├── MovieDetailsFragment.java
│ │ │ ├── PlaybackActivity.java
│ │ │ ├── PlaybackOverlayFragment.java
│ │ │ ├── SearchActivity.java
│ │ │ ├── SearchFragment.java
│ │ │ ├── SettingsActivity.java
│ │ │ ├── SettingsFragment.java
│ │ │ ├── VerticalGridActivity.java
│ │ │ └── VerticalGridFragment.java
│ │ └── res
│ │ ├── drawable-hdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_av_play_dark.png
│ │ ├── ic_launcher.png
│ │ ├── ic_main_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── ic_av_pause_dark.png
│ │ ├── ic_launcher.png
│ │ ├── ic_main_icon.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── bg.png
│ │ ├── card_background_default.9.png
│ │ ├── default_background.xml
│ │ ├── dragon2.jpg
│ │ ├── grid_bg.png
│ │ ├── ic_guidedstep_option_a.png
│ │ ├── ic_guidedstep_option_b.png
│ │ ├── ic_guidedstep_option_c.png
│ │ ├── ic_launcher.png
│ │ ├── ic_main_icon.png
│ │ ├── ic_pause_playcontrol_focussed.png
│ │ ├── ic_pause_playcontrol_normal.png
│ │ ├── ic_pause_playcontrol_pressed.png
│ │ ├── ic_play_action_focussed.png
│ │ ├── ic_play_action_normal.png
│ │ ├── ic_play_action_pressed.png
│ │ ├── ic_play_playcontrol_focussed.png
│ │ ├── ic_play_playcontrol_normal.png
│ │ ├── ic_play_playcontrol_pressed.png
│ │ ├── maleficent.jpg
│ │ ├── noah.jpg
│ │ ├── scrubber_disabled.png
│ │ ├── scrubber_focussed.png
│ │ ├── scrubber_normal.png
│ │ ├── scrubber_pressed.png
│ │ ├── shadow7.9.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable-xxhdpi
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── drawable
│ │ ├── android_header.png
│ │ ├── app_icon_quantum.png
│ │ ├── app_icon_quantum_card.png
│ │ ├── details_img.png
│ │ ├── ic_action_a.png
│ │ ├── ic_title.png
│ │ ├── movie.png
│ │ ├── player_bg_gradient_dark.xml
│ │ ├── shadow7.9.png
│ │ ├── text_bg.xml
│ │ ├── videos_by_google_banner.png
│ │ └── videos_by_google_icon.png
│ │ ├── layout
│ │ ├── custom.xml
│ │ ├── details.xml
│ │ ├── guidedstep_second_guidance.xml
│ │ ├── icon_header_item.xml
│ │ ├── main.xml
│ │ ├── movie_card.xml
│ │ ├── playback_controls.xml
│ │ ├── search.xml
│ │ ├── settings.xml
│ │ └── vertical_grid.xml
│ │ ├── values
│ │ ├── colors.xml
│ │ ├── ids.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ │ └── xml
│ │ └── searchable.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Log Files
26 | *.log
27 |
28 | # Android Studio
29 | .idea
30 | #.idea/workspace.xml
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Sebastiano Gottardo
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | BuildingForAndroidTV
2 | ====================
3 |
4 | This repository contains the code related to my series of articles "Building for Android TV"
5 |
6 | https://medium.com/building-for-android-tv/
7 |
8 | I've taken the sample TV application that is provided with Android's SDK and modified it, in order to showcase different components and to explain how to customize the standard UI components.
9 |
10 | Update 29/07/2015
11 | =================
12 |
13 | The library is now complete and available here: https://github.com/dextorer/Sofa
14 |
15 | Be sure to try it and let me know your feedbacks!
16 |
17 | Update 07/09/15
18 | ===============
19 |
20 | I'm writing an Android TV library, based upon Leanback, that offers you a custom BrowseFragment capable of loading any type of fragment, including support for multiple-rows-per-each-header. If you want to keep up to date on this, feel free to follow me / ping me:
21 |
22 | [Twitter @ rotxed](https://twitter.com/@rotxed)
23 |
24 | [G+ @ SebastianoGottardo](https://plus.google.com/+SebastianoGottardo/posts)
25 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | }
5 |
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.0.+'
8 | classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | /*
22 | subprojects {
23 | buildscript {
24 | repositories {
25 | jcenter()
26 | }
27 | dependencies {
28 | classpath 'com.android.tools.build:gradle:1.0.+'
29 | classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
30 | }
31 | }
32 |
33 | repositories {
34 | jcenter()
35 | }
36 | }
37 | */
38 |
39 | task wrapper(type: Wrapper) {
40 | gradleVersion = '2.2'
41 | }
42 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/TVDemoApp.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-sdk-manager'
2 | apply plugin: 'com.android.application'
3 |
4 |
5 | android {
6 | compileSdkVersion 21
7 | buildToolsVersion "21.1.1"
8 |
9 | defaultConfig {
10 | applicationId "com.sgottard.tvdemoapp"
11 | minSdkVersion 21
12 | targetSdkVersion 21
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | compile 'com.android.support:recyclerview-v7:+'
27 | compile 'com.android.support:leanback-v17:+'
28 | compile 'com.android.support:appcompat-v7:+'
29 | compile 'com.squareup.picasso:picasso:2.3.2'
30 | }
31 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/dextor/Development/Android/android-sdk_1471867_mac-x86/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/androidTest/java/com/sgottard/tvdemoapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/DetailsDescriptionPresenter.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
4 |
5 | public class DetailsDescriptionPresenter extends AbstractDetailsDescriptionPresenter {
6 | @Override
7 | protected void onBindDescription(ViewHolder viewHolder, Object item) {
8 | Movie movie = (Movie) item;
9 |
10 | if (movie != null) {
11 | viewHolder.getTitle().setText(movie.getTitle());
12 | viewHolder.getSubtitle().setText(movie.getStudio());
13 | viewHolder.getBody().setText(movie.getDescription());
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/PicassoBackgroundManagerTarget.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.drawable.Drawable;
5 | import android.support.v17.leanback.app.BackgroundManager;
6 | import com.squareup.picasso.Picasso;
7 | import com.squareup.picasso.Target;
8 |
9 | /**
10 | * Picasso target for updating default_background images
11 | */
12 | public class PicassoBackgroundManagerTarget implements Target {
13 | BackgroundManager mBackgroundManager;
14 |
15 | public PicassoBackgroundManagerTarget(BackgroundManager backgroundManager) {
16 | this.mBackgroundManager = backgroundManager;
17 | }
18 |
19 | @Override
20 | public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
21 | this.mBackgroundManager.setBitmap(bitmap);
22 | }
23 |
24 | @Override
25 | public void onBitmapFailed(Drawable drawable) {
26 | this.mBackgroundManager.setDrawable(drawable);
27 | }
28 |
29 | @Override
30 | public void onPrepareLoad(Drawable drawable) {
31 | // Do nothing, default_background manager has its own transitions
32 | }
33 |
34 | @Override
35 | public boolean equals(Object o) {
36 | if (this == o)
37 | return true;
38 | if (o == null || getClass() != o.getClass())
39 | return false;
40 |
41 | PicassoBackgroundManagerTarget that = (PicassoBackgroundManagerTarget) o;
42 |
43 | if (!mBackgroundManager.equals(that.mBackgroundManager))
44 | return false;
45 |
46 | return true;
47 | }
48 |
49 | @Override
50 | public int hashCode() {
51 | return mBackgroundManager.hashCode();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class TVDemoActivity extends Activity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_tvdemo);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVDetailsActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class TVDetailsActivity extends Activity
7 | {
8 | /** Called when the activity is first created. */
9 | @Override
10 | public void onCreate(Bundle savedInstanceState)
11 | {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_tvdetails);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVGridActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by Sebastiano Gottardo on 19/10/14.
8 | */
9 | public class TVGridActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_grid);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVSearchActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by dextor on 19/10/14.
8 | */
9 | public class TVSearchActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_search);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/details_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/details_img.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/ic_action_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/ic_action_a.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/ic_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/ic_title.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/movie.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/player_bg_gradient_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/shadow7.9.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/layout/activity_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/layout/activity_tvdemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/layout/activity_tvdetails.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #000000
3 | #DDDDDD
4 | #0096a6
5 | #ffaa3f
6 | #0096a6
7 | #30000000
8 | #30FF0000
9 | #00000000
10 | #AA000000
11 | #59000000
12 | #FFFFFF
13 | #AAFADCA7
14 | #FADCA7
15 | #EEFF41
16 | #3d3d3d
17 |
18 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TVDemoApp
5 |
6 | Related Videos
7 |
8 | Error
9 | OK
10 | Pause
11 | Play
12 | Stop
13 | 00:00
14 | Play Pause Button
15 | Loading…
16 | No video was found
17 | About DemoCast Player
18 | Version: %1$s
19 | Popular Videos
20 | PREFERENCES
21 | Grid View
22 | Send Feedback
23 | Personal Settings
24 | Watch trailer
25 | FREE
26 | Rent By Day
27 | From $1.99
28 | Buy and Own
29 | AT $9.99
30 | Movie
31 | shouldStart
32 | startPosition
33 | Search Results
34 | Media loading timed out
35 | Media server was not reachable
36 | Failed to load video
37 | Oops
38 |
39 |
40 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.0.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_1/TVDemoApp/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
7 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/episode_1/TVDemoApp/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/TVDemoApp.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-sdk-manager'
2 | apply plugin: 'com.android.application'
3 |
4 |
5 | android {
6 | compileSdkVersion 21
7 | buildToolsVersion "21.0.0"
8 |
9 | defaultConfig {
10 | applicationId "com.sgottard.tvdemoapp"
11 | minSdkVersion 21
12 | targetSdkVersion 21
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | compile 'com.android.support:recyclerview-v7:+'
27 | compile 'com.android.support:leanback-v17:+'
28 | compile 'com.android.support:appcompat-v7:+'
29 | compile 'com.squareup.picasso:picasso:2.3.2'
30 | }
31 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/dextor/Development/Android/android-sdk_1471867_mac-x86/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/androidTest/java/com/sgottard/tvdemoapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/CustomHeadersFragment.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Fragment;
4 | import android.os.Bundle;
5 | import android.support.v17.leanback.app.HeadersFragment;
6 | import android.support.v17.leanback.widget.ArrayObjectAdapter;
7 | import android.support.v17.leanback.widget.HeaderItem;
8 | import android.support.v17.leanback.widget.ListRow;
9 | import android.support.v17.leanback.widget.OnItemSelectedListener;
10 | import android.support.v17.leanback.widget.Row;
11 |
12 | import java.lang.reflect.InvocationTargetException;
13 | import java.lang.reflect.Method;
14 | import java.util.LinkedHashMap;
15 |
16 | /**
17 | * Created by Sebastiano Gottardo on 08/11/14.
18 | */
19 | public class CustomHeadersFragment extends HeadersFragment {
20 |
21 | private ArrayObjectAdapter adapter;
22 |
23 | @Override
24 | public void onActivityCreated(Bundle savedInstanceState) {
25 | super.onActivityCreated(savedInstanceState);
26 |
27 | customSetBackground(R.color.fastlane_background);
28 | setOnItemSelectedListener(getDefaultItemSelectedListener());
29 | setHeaderAdapter();
30 | }
31 |
32 | private void setHeaderAdapter() {
33 | adapter = new ArrayObjectAdapter();
34 |
35 | LinkedHashMap fragments = ((TVDemoActivity) getActivity()).getFragments();
36 |
37 | int id = 0;
38 | for (int i = 0; i < fragments.size(); i++) {
39 | HeaderItem header = new HeaderItem(id, "Category " + i, null);
40 | ArrayObjectAdapter innerAdapter = new ArrayObjectAdapter();
41 | innerAdapter.add(fragments.get(i));
42 | adapter.add(id, new ListRow(header, innerAdapter));
43 | id++;
44 | }
45 |
46 | setAdapter(adapter);
47 | }
48 |
49 | private OnItemSelectedListener getDefaultItemSelectedListener() {
50 | return new OnItemSelectedListener() {
51 | @Override
52 | public void onItemSelected(Object o, Row row) {
53 | Object obj = ((ListRow) row).getAdapter().get(0);
54 | getFragmentManager().beginTransaction().replace(R.id.rows_container, (Fragment) obj).commit();
55 | }
56 | };
57 | }
58 |
59 | /**
60 | * Since the original setBackgroundColor is private, we need to
61 | * access it via reflection
62 | *
63 | * @param colorResource The colour resource
64 | */
65 | private void customSetBackground(int colorResource) {
66 | try {
67 | Class clazz = HeadersFragment.class;
68 | Method m = clazz.getDeclaredMethod("setBackgroundColor", Integer.TYPE);
69 | m.setAccessible(true);
70 | m.invoke(this, getResources().getColor(colorResource));
71 | } catch (NoSuchMethodException e) {
72 | e.printStackTrace();
73 | } catch (InvocationTargetException e) {
74 | e.printStackTrace();
75 | } catch (IllegalAccessException e) {
76 | e.printStackTrace();
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/CustomRowsFragment.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.graphics.Color;
4 | import android.os.Bundle;
5 | import android.support.v17.leanback.app.RowsFragment;
6 | import android.support.v17.leanback.widget.ArrayObjectAdapter;
7 | import android.support.v17.leanback.widget.HeaderItem;
8 | import android.support.v17.leanback.widget.ListRow;
9 | import android.support.v17.leanback.widget.ListRowPresenter;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 |
14 | import java.util.Collections;
15 | import java.util.List;
16 | import java.util.Random;
17 |
18 | /**
19 | * Created by Sebastiano Gottardo on 08/11/14.
20 | */
21 | public class CustomRowsFragment extends RowsFragment {
22 |
23 | private final int NUM_ROWS = 5;
24 | private final int NUM_COLS = 15;
25 |
26 | private ArrayObjectAdapter rowsAdapter;
27 | private CardPresenter cardPresenter;
28 |
29 | @Override
30 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
31 | View v = super.onCreateView(inflater, container, savedInstanceState);
32 | v.setBackgroundColor(getRandomColor());
33 | return v;
34 | }
35 |
36 | @Override
37 | public void onActivityCreated(Bundle savedInstanceState) {
38 | super.onActivityCreated(savedInstanceState);
39 |
40 | loadRows();
41 | }
42 |
43 | private void loadRows() {
44 | rowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
45 | cardPresenter = new CardPresenter();
46 |
47 | List list = MovieList.setupMovies();
48 |
49 | int i;
50 | for (i = 0; i < NUM_ROWS; i++) {
51 | if (i != 0) {
52 | Collections.shuffle(list);
53 | }
54 | ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
55 | for (int j = 0; j < NUM_COLS; j++) {
56 | listRowAdapter.add(list.get(j % 5));
57 | }
58 | HeaderItem header = new HeaderItem(i, MovieList.MOVIE_CATEGORY[i], null);
59 | rowsAdapter.add(new ListRow(header, listRowAdapter));
60 | }
61 |
62 | setAdapter(rowsAdapter);
63 | }
64 |
65 | private int getRandomColor() {
66 | Random rnd = new Random();
67 | return Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/DetailsDescriptionPresenter.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
4 |
5 | public class DetailsDescriptionPresenter extends AbstractDetailsDescriptionPresenter {
6 | @Override
7 | protected void onBindDescription(ViewHolder viewHolder, Object item) {
8 | Movie movie = (Movie) item;
9 |
10 | if (movie != null) {
11 | viewHolder.getTitle().setText(movie.getTitle());
12 | viewHolder.getSubtitle().setText(movie.getStudio());
13 | viewHolder.getBody().setText(movie.getDescription());
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/PicassoBackgroundManagerTarget.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.drawable.Drawable;
5 | import android.support.v17.leanback.app.BackgroundManager;
6 | import com.squareup.picasso.Picasso;
7 | import com.squareup.picasso.Target;
8 |
9 | /**
10 | * Picasso target for updating default_background images
11 | */
12 | public class PicassoBackgroundManagerTarget implements Target {
13 | BackgroundManager mBackgroundManager;
14 |
15 | public PicassoBackgroundManagerTarget(BackgroundManager backgroundManager) {
16 | this.mBackgroundManager = backgroundManager;
17 | }
18 |
19 | @Override
20 | public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
21 | this.mBackgroundManager.setBitmap(bitmap);
22 | }
23 |
24 | @Override
25 | public void onBitmapFailed(Drawable drawable) {
26 | this.mBackgroundManager.setDrawable(drawable);
27 | }
28 |
29 | @Override
30 | public void onPrepareLoad(Drawable drawable) {
31 | // Do nothing, default_background manager has its own transitions
32 | }
33 |
34 | @Override
35 | public boolean equals(Object o) {
36 | if (this == o)
37 | return true;
38 | if (o == null || getClass() != o.getClass())
39 | return false;
40 |
41 | PicassoBackgroundManagerTarget that = (PicassoBackgroundManagerTarget) o;
42 |
43 | if (!mBackgroundManager.equals(that.mBackgroundManager))
44 | return false;
45 |
46 | return true;
47 | }
48 |
49 | @Override
50 | public int hashCode() {
51 | return mBackgroundManager.hashCode();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.app.FragmentManager;
5 | import android.app.FragmentTransaction;
6 | import android.os.Bundle;
7 |
8 | import java.util.LinkedHashMap;
9 |
10 | public class TVDemoActivity extends Activity {
11 |
12 | private CustomHeadersFragment headersFragment;
13 | private CustomRowsFragment rowsFragment;
14 |
15 | private final int CATEGORIES_NUMBER = 5;
16 | private LinkedHashMap fragments;
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_custom);
22 |
23 | headersFragment = new CustomHeadersFragment();
24 | rowsFragment = new CustomRowsFragment();
25 |
26 | FragmentManager fragmentManager = getFragmentManager();
27 | FragmentTransaction transaction = fragmentManager.beginTransaction();
28 | transaction
29 | .replace(R.id.header_container, headersFragment, "CustomHeadersFragment")
30 | .replace(R.id.rows_container, rowsFragment, "CustomRowsFragment");
31 | transaction.commit();
32 |
33 | fragments = new LinkedHashMap();
34 |
35 | for (int i = 0; i < CATEGORIES_NUMBER; i++) {
36 | CustomRowsFragment fragment = new CustomRowsFragment();
37 | fragments.put(i, fragment);
38 | }
39 | }
40 |
41 | public LinkedHashMap getFragments() {
42 | return fragments;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVDetailsActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class TVDetailsActivity extends Activity
7 | {
8 | /** Called when the activity is first created. */
9 | @Override
10 | public void onCreate(Bundle savedInstanceState)
11 | {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_tvdetails);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVGridActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by Sebastiano Gottardo on 19/10/14.
8 | */
9 | public class TVGridActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_grid);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVSearchActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by dextor on 19/10/14.
8 | */
9 | public class TVSearchActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_search);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/details_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/details_img.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/ic_action_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/ic_action_a.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/ic_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/ic_title.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/movie.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/player_bg_gradient_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/shadow7.9.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/layout/activity_custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/layout/activity_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/layout/activity_tvdemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/layout/activity_tvdetails.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #000000
3 | #DDDDDD
4 | #0096a6
5 | #ffaa3f
6 | #0096a6
7 | #30000000
8 | #30FF0000
9 | #00000000
10 | #AA000000
11 | #59000000
12 | #FFFFFF
13 | #AAFADCA7
14 | #FADCA7
15 | #EEFF41
16 | #3d3d3d
17 |
18 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TVDemoApp
5 |
6 | Related Videos
7 |
8 | Error
9 | OK
10 | Pause
11 | Play
12 | Stop
13 | 00:00
14 | Play Pause Button
15 | Loading…
16 | No video was found
17 | About DemoCast Player
18 | Version: %1$s
19 | Popular Videos
20 | PREFERENCES
21 | Grid View
22 | Send Feedback
23 | Personal Settings
24 | Watch trailer
25 | FREE
26 | Rent By Day
27 | From $1.99
28 | Buy and Own
29 | AT $9.99
30 | Movie
31 | shouldStart
32 | startPosition
33 | Search Results
34 | Media loading timed out
35 | Media server was not reachable
36 | Failed to load video
37 | Oops
38 |
39 |
40 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.0.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_2/TVDemoApp/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
7 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/episode_2/TVDemoApp/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/TVDemoApp.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-sdk-manager'
2 | apply plugin: 'com.android.application'
3 |
4 |
5 | android {
6 | compileSdkVersion 21
7 | buildToolsVersion "21.1.1"
8 |
9 | defaultConfig {
10 | applicationId "com.sgottard.tvdemoapp"
11 | minSdkVersion 21
12 | targetSdkVersion 21
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | compile 'com.android.support:recyclerview-v7:+'
27 | compile 'com.android.support:leanback-v17:+'
28 | compile 'com.android.support:appcompat-v7:+'
29 | compile 'com.squareup.picasso:picasso:2.3.2'
30 | }
31 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/dextor/Development/Android/android-sdk_1471867_mac-x86/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/androidTest/java/com/sgottard/tvdemoapp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/CustomFrameLayout.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.content.Context;
4 | import android.graphics.Rect;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.FrameLayout;
8 |
9 | public class CustomFrameLayout extends FrameLayout {
10 |
11 | public interface OnFocusSearchListener {
12 | public View onFocusSearch(View focused, int direction);
13 | }
14 |
15 | public interface OnChildFocusListener {
16 | public boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect);
17 | public void onRequestChildFocus(View child, View focused);
18 | }
19 |
20 | public CustomFrameLayout(Context context) {
21 | this(context, null, 0);
22 | }
23 |
24 | public CustomFrameLayout(Context context, AttributeSet attrs) {
25 | this(context, attrs, 0);
26 | }
27 |
28 | public CustomFrameLayout(Context context, AttributeSet attrs, int defStyle) {
29 | super(context, attrs, defStyle);
30 | }
31 |
32 | private OnFocusSearchListener mListener;
33 | private OnChildFocusListener mOnChildFocusListener;
34 |
35 | public void setOnFocusSearchListener(OnFocusSearchListener listener) {
36 | mListener = listener;
37 | }
38 |
39 | public void setOnChildFocusListener(OnChildFocusListener listener) {
40 | mOnChildFocusListener = listener;
41 | }
42 |
43 | @Override
44 | protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
45 | if (mOnChildFocusListener != null) {
46 | return mOnChildFocusListener.onRequestFocusInDescendants(direction, previouslyFocusedRect);
47 | }
48 | return super.onRequestFocusInDescendants(direction, previouslyFocusedRect);
49 | }
50 |
51 | @Override
52 | public View focusSearch(View focused, int direction) {
53 | if (mListener != null) {
54 | View view = mListener.onFocusSearch(focused, direction);
55 | if (view != null) {
56 | return view;
57 | }
58 | }
59 | return super.focusSearch(focused, direction);
60 | }
61 |
62 | @Override
63 | public void requestChildFocus(View child, View focused) {
64 | super.requestChildFocus(child, focused);
65 | if (mOnChildFocusListener != null) {
66 | mOnChildFocusListener.onRequestChildFocus(child, focused);
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/DetailsDescriptionPresenter.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
4 |
5 | public class DetailsDescriptionPresenter extends AbstractDetailsDescriptionPresenter {
6 | @Override
7 | protected void onBindDescription(ViewHolder viewHolder, Object item) {
8 | Movie movie = (Movie) item;
9 |
10 | if (movie != null) {
11 | viewHolder.getTitle().setText(movie.getTitle());
12 | viewHolder.getSubtitle().setText(movie.getStudio());
13 | viewHolder.getBody().setText(movie.getDescription());
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/PicassoBackgroundManagerTarget.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.drawable.Drawable;
5 | import android.support.v17.leanback.app.BackgroundManager;
6 | import com.squareup.picasso.Picasso;
7 | import com.squareup.picasso.Target;
8 |
9 | /**
10 | * Picasso target for updating default_background images
11 | */
12 | public class PicassoBackgroundManagerTarget implements Target {
13 | BackgroundManager mBackgroundManager;
14 |
15 | public PicassoBackgroundManagerTarget(BackgroundManager backgroundManager) {
16 | this.mBackgroundManager = backgroundManager;
17 | }
18 |
19 | @Override
20 | public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom loadedFrom) {
21 | this.mBackgroundManager.setBitmap(bitmap);
22 | }
23 |
24 | @Override
25 | public void onBitmapFailed(Drawable drawable) {
26 | this.mBackgroundManager.setDrawable(drawable);
27 | }
28 |
29 | @Override
30 | public void onPrepareLoad(Drawable drawable) {
31 | // Do nothing, default_background manager has its own transitions
32 | }
33 |
34 | @Override
35 | public boolean equals(Object o) {
36 | if (this == o)
37 | return true;
38 | if (o == null || getClass() != o.getClass())
39 | return false;
40 |
41 | PicassoBackgroundManagerTarget that = (PicassoBackgroundManagerTarget) o;
42 |
43 | if (!mBackgroundManager.equals(that.mBackgroundManager))
44 | return false;
45 |
46 | return true;
47 | }
48 |
49 | @Override
50 | public int hashCode() {
51 | return mBackgroundManager.hashCode();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVDetailsActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class TVDetailsActivity extends Activity
7 | {
8 | /** Called when the activity is first created. */
9 | @Override
10 | public void onCreate(Bundle savedInstanceState)
11 | {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_tvdetails);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVGridActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by Sebastiano Gottardo on 19/10/14.
8 | */
9 | public class TVGridActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_grid);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/TVSearchActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | /**
7 | * Created by dextor on 19/10/14.
8 | */
9 | public class TVSearchActivity extends Activity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_search);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/card_background_default.9.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/movie.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_disabled.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_focussed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_normal.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/scrubber_pressed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/shadow7.9.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/movie.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/star_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/details_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/details_img.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/ic_action_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/ic_action_a.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/ic_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/ic_title.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/movie.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/player_bg_gradient_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/shadow7.9.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/layout/activity_custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/layout/activity_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/layout/activity_tvdemo.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/layout/activity_tvdetails.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 | #000000
3 | #DDDDDD
4 | #0096a6
5 | #ffaa3f
6 | #0096a6
7 | #30000000
8 | #30FF0000
9 | #00000000
10 | #AA000000
11 | #59000000
12 | #FFFFFF
13 | #AAFADCA7
14 | #FADCA7
15 | #EEFF41
16 | #3d3d3d
17 |
18 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TVDemoApp
5 |
6 | Related Videos
7 |
8 | Error
9 | OK
10 | Pause
11 | Play
12 | Stop
13 | 00:00
14 | Play Pause Button
15 | Loading…
16 | No video was found
17 | About DemoCast Player
18 | Version: %1$s
19 | Popular Videos
20 | PREFERENCES
21 | Grid View
22 | Send Feedback
23 | Personal Settings
24 | Watch trailer
25 | FREE
26 | Rent By Day
27 | From $1.99
28 | Buy and Own
29 | AT $9.99
30 | Movie
31 | shouldStart
32 | startPosition
33 | Search Results
34 | Media loading timed out
35 | Media server was not reachable
36 | Failed to load video
37 | Oops
38 |
39 |
40 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.0.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_3/TVDemoApp/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 10 11:36:50 CET 2014
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/episode_3/TVDemoApp/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/TVDemoApp.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion '22.0.0'
6 | defaultConfig {
7 |
8 | applicationId "com.sgottard.tvdemoapp"
9 | minSdkVersion 21
10 | targetSdkVersion 22
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:recyclerview-v7:22.1.0'
25 | compile 'com.android.support:leanback-v17:22.1.1'
26 | compile 'com.android.support:appcompat-v7:22.1.1'
27 | compile 'com.github.bumptech.glide:glide:3.4.+'
28 | compile 'com.android.support:support-v4:22.1.1'
29 | }
30 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/google/home/cartland/android-sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/androidtv-leanback-sample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/androidtv-leanback-sample.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/Utils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sgottard.tvdemoapp;
18 |
19 | import android.content.Context;
20 | import android.graphics.Point;
21 | import android.media.MediaMetadataRetriever;
22 | import android.os.Build;
23 | import android.view.Display;
24 | import android.view.WindowManager;
25 | import android.widget.Toast;
26 |
27 | import java.util.HashMap;
28 |
29 | /**
30 | * A collection of utility methods, all static.
31 | */
32 | public class Utils {
33 |
34 | /*
35 | * Making sure public utility methods remain static
36 | */
37 | private Utils() {
38 | }
39 |
40 | /**
41 | * Returns the screen/display size
42 | */
43 | public static Point getDisplaySize(Context context) {
44 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
45 | Display display = wm.getDefaultDisplay();
46 | Point size = new Point();
47 | display.getSize(size);
48 | int width = size.x;
49 | int height = size.y;
50 | return size;
51 | }
52 |
53 | /**
54 | * Shows a (long) toast
55 | */
56 | public static void showToast(Context context, String msg) {
57 | Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
58 | }
59 |
60 | /**
61 | * Shows a (long) toast.
62 | */
63 | public static void showToast(Context context, int resourceId) {
64 | Toast.makeText(context, context.getString(resourceId), Toast.LENGTH_LONG).show();
65 | }
66 |
67 | public static int convertDpToPixel(Context ctx, int dp) {
68 | float density = ctx.getResources().getDisplayMetrics().density;
69 | return Math.round((float) dp * density);
70 | }
71 |
72 |
73 | public static long getDuration(String videoUrl) {
74 | MediaMetadataRetriever mmr = new MediaMetadataRetriever();
75 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
76 | mmr.setDataSource(videoUrl, new HashMap());
77 | } else {
78 | mmr.setDataSource(videoUrl);
79 | }
80 | return Long.parseLong(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/data/VideoItemLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sgottard.tvdemoapp.data;
18 |
19 | import android.content.AsyncTaskLoader;
20 | import android.content.Context;
21 | import android.util.Log;
22 |
23 | import com.sgottard.tvdemoapp.model.Movie;
24 |
25 | import java.util.HashMap;
26 | import java.util.List;
27 |
28 |
29 | /*
30 | * This class asynchronously loads videos from a backend
31 | */
32 | public class VideoItemLoader extends AsyncTaskLoader>> {
33 |
34 | private static final String TAG = "VideoItemLoader";
35 | private final String mUrl;
36 | private Context mContext;
37 |
38 | public VideoItemLoader(Context context, String url) {
39 | super(context);
40 | mContext = context;
41 | mUrl = url;
42 | }
43 |
44 | @Override
45 | public HashMap> loadInBackground() {
46 | try {
47 | return VideoProvider.buildMedia(mContext, mUrl);
48 | } catch (Exception e) {
49 | Log.e(TAG, "Failed to fetch media data", e);
50 | return null;
51 | }
52 | }
53 |
54 | @Override
55 | protected void onStartLoading() {
56 | super.onStartLoading();
57 | forceLoad();
58 | }
59 |
60 | /**
61 | * Handles a request to stop the Loader.
62 | */
63 | @Override
64 | protected void onStopLoading() {
65 | // Attempt to cancel the current load task if possible.
66 | cancelLoad();
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/presenter/DetailsDescriptionPresenter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sgottard.tvdemoapp.presenter;
18 |
19 | import android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter;
20 |
21 | import com.sgottard.tvdemoapp.model.Movie;
22 |
23 |
24 | public class DetailsDescriptionPresenter extends AbstractDetailsDescriptionPresenter {
25 |
26 | @Override
27 | protected void onBindDescription(ViewHolder viewHolder, Object item) {
28 | Movie movie = (Movie) item;
29 |
30 | if (movie != null) {
31 | viewHolder.getTitle().setText(movie.getTitle());
32 | viewHolder.getSubtitle().setText(movie.getStudio());
33 | viewHolder.getBody().setText(movie.getDescription());
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/presenter/GridItemPresenter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sgottard.tvdemoapp.presenter;
18 |
19 | import android.app.Fragment;
20 | import android.graphics.Color;
21 | import android.support.v17.leanback.widget.Presenter;
22 | import android.view.Gravity;
23 | import android.view.ViewGroup;
24 | import android.widget.TextView;
25 |
26 | import com.sgottard.tvdemoapp.tvleanback.R;
27 |
28 |
29 | public class GridItemPresenter extends Presenter {
30 | private static int GRID_ITEM_WIDTH = 200;
31 | private static int GRID_ITEM_HEIGHT = 200;
32 |
33 | private Fragment mainFragment;
34 |
35 | public GridItemPresenter(Fragment fragment) {
36 | this.mainFragment = fragment;
37 | }
38 |
39 | @Override
40 | public ViewHolder onCreateViewHolder(ViewGroup parent) {
41 | TextView view = new TextView(parent.getContext());
42 | view.setLayoutParams(new ViewGroup.LayoutParams(GRID_ITEM_WIDTH, GRID_ITEM_HEIGHT));
43 | view.setFocusable(true);
44 | view.setFocusableInTouchMode(true);
45 | view.setBackgroundColor(mainFragment.getResources().getColor(R.color.default_background));
46 | view.setTextColor(Color.WHITE);
47 | view.setGravity(Gravity.CENTER);
48 | return new ViewHolder(view);
49 | }
50 |
51 | @Override
52 | public void onBindViewHolder(ViewHolder viewHolder, Object item) {
53 | ((TextView) viewHolder.view).setText((String) item);
54 | }
55 |
56 | @Override
57 | public void onUnbindViewHolder(ViewHolder viewHolder) {
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/presenter/IconHeaderItemPresenter.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp.presenter;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.support.v17.leanback.widget.HeaderItem;
6 | import android.support.v17.leanback.widget.ListRow;
7 | import android.support.v17.leanback.widget.Presenter;
8 | import android.support.v17.leanback.widget.RowHeaderPresenter;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.ImageView;
13 | import android.widget.TextView;
14 |
15 | import com.sgottard.tvdemoapp.tvleanback.R;
16 |
17 | public class IconHeaderItemPresenter extends RowHeaderPresenter {
18 | private float mUnselectedAlpha;
19 |
20 | @Override
21 | public ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
22 | mUnselectedAlpha = viewGroup.getResources()
23 | .getFraction(R.fraction.lb_browse_header_unselect_alpha, 1, 1);
24 | LayoutInflater inflater = (LayoutInflater) viewGroup.getContext()
25 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
26 |
27 | View view = inflater.inflate(R.layout.icon_header_item, null);
28 |
29 | return new ViewHolder(view);
30 | }
31 |
32 | @Override
33 | public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object o) {
34 | HeaderItem headerItem = ((ListRow) o).getHeaderItem();
35 | View rootView = viewHolder.view;
36 |
37 | ImageView iconView = (ImageView) rootView.findViewById(R.id.header_icon);
38 | Drawable icon = rootView.getResources().getDrawable(R.drawable.android_header, null);
39 | iconView.setImageDrawable(icon);
40 |
41 | TextView label = (TextView) rootView.findViewById(R.id.header_label);
42 | label.setText(headerItem.getName());
43 | }
44 |
45 | @Override
46 | public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
47 | // no op
48 | }
49 |
50 | // TODO: TEMP - remove me when leanback onCreateViewHolder no longer sets the mUnselectAlpha,AND
51 | // also assumes the xml inflation will return a RowHeaderView
52 | @Override
53 | protected void onSelectLevelChanged(RowHeaderPresenter.ViewHolder holder) {
54 | // this is a temporary fix
55 | holder.view.setAlpha(mUnselectedAlpha + holder.getSelectLevel() *
56 | (1.0f - mUnselectedAlpha));
57 | }
58 | }
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/recommendation/BootupActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.sgottard.tvdemoapp.recommendation;
18 |
19 | import android.app.AlarmManager;
20 | import android.app.PendingIntent;
21 | import android.content.BroadcastReceiver;
22 | import android.content.Context;
23 | import android.content.Intent;
24 | import android.util.Log;
25 |
26 | /*
27 | * This class extends BroadCastReceiver and publishes recommendations on bootup
28 | */
29 | public class BootupActivity extends BroadcastReceiver {
30 | private static final String TAG = "BootupActivity";
31 |
32 | private static final long INITIAL_DELAY = 5000;
33 |
34 | @Override
35 | public void onReceive(Context context, Intent intent) {
36 | Log.d(TAG, "BootupActivity initiated");
37 | if (intent.getAction().endsWith(Intent.ACTION_BOOT_COMPLETED)) {
38 | scheduleRecommendationUpdate(context);
39 | }
40 | }
41 |
42 | private void scheduleRecommendationUpdate(Context context) {
43 | Log.d(TAG, "Scheduling recommendations update");
44 |
45 | AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
46 | Intent recommendationIntent = new Intent(context, UpdateRecommendationsService.class);
47 | PendingIntent alarmIntent = PendingIntent.getService(context, 0, recommendationIntent, 0);
48 |
49 | alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,
50 | INITIAL_DELAY,
51 | AlarmManager.INTERVAL_HALF_HOUR,
52 | alarmIntent);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/CustomFrameLayout.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp.ui;
2 |
3 | import android.content.Context;
4 | import android.graphics.Rect;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.FrameLayout;
8 |
9 | public class CustomFrameLayout extends FrameLayout {
10 |
11 | public interface OnFocusSearchListener {
12 | View onFocusSearch(View focused, int direction);
13 | }
14 |
15 | public interface OnChildFocusListener {
16 | boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect);
17 | void onRequestChildFocus(View child, View focused);
18 | }
19 |
20 | public CustomFrameLayout(Context context) {
21 | this(context, null, 0);
22 | }
23 |
24 | public CustomFrameLayout(Context context, AttributeSet attrs) {
25 | this(context, attrs, 0);
26 | }
27 |
28 | public CustomFrameLayout(Context context, AttributeSet attrs, int defStyle) {
29 | super(context, attrs, defStyle);
30 | }
31 |
32 | private OnFocusSearchListener mListener;
33 | private OnChildFocusListener mOnChildFocusListener;
34 |
35 | public void setOnFocusSearchListener(OnFocusSearchListener listener) {
36 | mListener = listener;
37 | }
38 |
39 | public void setOnChildFocusListener(OnChildFocusListener listener) {
40 | mOnChildFocusListener = listener;
41 | }
42 |
43 | @Override
44 | protected boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect) {
45 | if (mOnChildFocusListener != null) {
46 | return mOnChildFocusListener.onRequestFocusInDescendants(direction, previouslyFocusedRect);
47 | }
48 | return super.onRequestFocusInDescendants(direction, previouslyFocusedRect);
49 | }
50 |
51 | @Override
52 | public View focusSearch(View focused, int direction) {
53 | if (mListener != null) {
54 | View view = mListener.onFocusSearch(focused, direction);
55 | if (view != null) {
56 | return view;
57 | }
58 | }
59 | return super.focusSearch(focused, direction);
60 | }
61 |
62 | @Override
63 | public void requestChildFocus(View child, View focused) {
64 | super.requestChildFocus(child, focused);
65 | if (mOnChildFocusListener != null) {
66 | mOnChildFocusListener.onRequestChildFocus(child, focused);
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/ErrorFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License
10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | * or implied. See the License for the specific language governing permissions and limitations under
12 | * the License.
13 | */
14 | package com.sgottard.tvdemoapp.ui;
15 |
16 | import android.os.Bundle;
17 | import android.util.Log;
18 | import android.view.View;
19 |
20 | import com.sgottard.tvdemoapp.tvleanback.R;
21 |
22 | /*
23 | * This class demonstrates how to extend ErrorFragment
24 | */
25 | public class ErrorFragment extends android.support.v17.leanback.app.ErrorFragment {
26 | private static final String TAG = "ErrorFragment";
27 | private static final boolean TRANSLUCENT = true;
28 |
29 | @Override
30 | public void onCreate(Bundle savedInstanceState) {
31 | Log.d(TAG, "onCreate");
32 | super.onCreate(savedInstanceState);
33 | setTitle(getResources().getString(R.string.app_name));
34 | }
35 |
36 | void setErrorContent() {
37 | setImageDrawable(getResources().getDrawable(R.drawable.lb_ic_sad_cloud));
38 | setMessage(getResources().getString(R.string.error_fragment_message));
39 | setDefaultBackground(TRANSLUCENT);
40 |
41 | setButtonText(getResources().getString(R.string.dismiss_error));
42 | setButtonClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View arg0) {
45 | getFragmentManager().beginTransaction().remove(ErrorFragment.this).commit();
46 | }
47 | });
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/MovieDetailsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License
10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | * or implied. See the License for the specific language governing permissions and limitations under
12 | * the License.
13 | */
14 |
15 | package com.sgottard.tvdemoapp.ui;
16 |
17 | import android.app.Activity;
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 |
21 | import com.sgottard.tvdemoapp.tvleanback.R;
22 |
23 |
24 | /*
25 | * Details activity class that loads LeanbackDetailsFragment class
26 | */
27 | public class MovieDetailsActivity extends Activity {
28 | public static final String SHARED_ELEMENT_NAME = "hero";
29 | public static final String MOVIE = "Movie";
30 | public static final String NOTIFICATION_ID = "NotificationId";
31 |
32 | /**
33 | * Called when the activity is first created.
34 | */
35 | @Override
36 | public void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.details);
39 |
40 | }
41 |
42 | @Override
43 | public boolean onSearchRequested() {
44 | startActivity(new Intent(this, SearchActivity.class));
45 | return true;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/SearchActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License
10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | * or implied. See the License for the specific language governing permissions and limitations under
12 | * the License.
13 | */
14 |
15 | package com.sgottard.tvdemoapp.ui;
16 |
17 | import android.app.Activity;
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 |
21 | import com.sgottard.tvdemoapp.tvleanback.R;
22 |
23 |
24 | /*
25 | * SearchActivity for SearchFragment
26 | */
27 | public class SearchActivity extends Activity {
28 |
29 | private static final String TAG = "SearchActivity";
30 | private SearchFragment mFragment;
31 |
32 | /**
33 | * Called when the activity is first created.
34 | */
35 | @Override
36 | public void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.search);
39 |
40 | mFragment = (SearchFragment) getFragmentManager().findFragmentById(R.id.search_fragment);
41 | }
42 |
43 | @Override
44 | public boolean onSearchRequested() {
45 | if (mFragment.hasResults()) {
46 | startActivity(new Intent(this, SearchActivity.class));
47 | } else {
48 | mFragment.startRecognition();
49 | }
50 | return true;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.sgottard.tvdemoapp.ui;
2 |
3 | import android.app.Activity;
4 | import android.app.FragmentManager;
5 | import android.os.Bundle;
6 |
7 | import com.sgottard.tvdemoapp.tvleanback.R;
8 |
9 | /**
10 | * Created by Sebastiano Gottardo on 17/05/15.
11 | */
12 | public class SettingsActivity extends Activity {
13 |
14 | @Override
15 | public void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.settings);
18 |
19 | FragmentManager manager = getFragmentManager();
20 | manager
21 | .beginTransaction()
22 | .replace(R.id.settings_container, new SettingsFragment())
23 | .commit();
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/java/com/sgottard/tvdemoapp/ui/VerticalGridActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 | * in compliance with the License. You may obtain a copy of the License at
6 | *
7 | * http://www.apache.org/licenses/LICENSE-2.0
8 | *
9 | * Unless required by applicable law or agreed to in writing, software distributed under the License
10 | * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | * or implied. See the License for the specific language governing permissions and limitations under
12 | * the License.
13 | */
14 |
15 | package com.sgottard.tvdemoapp.ui;
16 |
17 | import android.app.Activity;
18 | import android.content.Intent;
19 | import android.os.Bundle;
20 |
21 | import com.sgottard.tvdemoapp.tvleanback.R;
22 |
23 |
24 | /*
25 | * VerticalGridActivity that loads VerticalGridFragment
26 | */
27 | public class VerticalGridActivity extends Activity {
28 | /**
29 | * Called when the activity is first created.
30 | */
31 | @Override
32 | public void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.vertical_grid);
35 | getWindow().setBackgroundDrawableResource(R.drawable.grid_bg);
36 | }
37 |
38 | @Override
39 | public boolean onSearchRequested() {
40 | startActivity(new Intent(this, SearchActivity.class));
41 | return true;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_av_play_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_av_play_dark.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_main_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/ic_main_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-hdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_av_pause_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_av_pause_dark.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_main_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/ic_main_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-mdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/bg.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/card_background_default.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/card_background_default.9.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/default_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
9 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/dragon2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/dragon2.jpg
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/grid_bg.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_a.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_b.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_guidedstep_option_c.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_main_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_main_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_pause_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_focussed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_normal.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_action_pressed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_focussed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_normal.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/ic_play_playcontrol_pressed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/maleficent.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/maleficent.jpg
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/noah.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/noah.jpg
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_disabled.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_focussed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_focussed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_normal.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/scrubber_pressed.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/shadow7.9.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable-xxhdpi/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/android_header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/android_header.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/app_icon_quantum.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/app_icon_quantum_card.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/details_img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/details_img.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/ic_action_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/ic_action_a.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/ic_title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/ic_title.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/movie.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/player_bg_gradient_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/shadow7.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/shadow7.9.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/text_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
24 |
29 |
32 |
33 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/videos_by_google_banner.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/app/src/main/res/drawable/videos_by_google_icon.png
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/details.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/guidedstep_second_guidance.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
26 |
27 |
32 |
33 |
36 |
37 |
40 |
41 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/icon_header_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
27 |
28 |
33 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/movie_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
15 |
23 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/playback_controls.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
31 |
32 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/search.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/layout/vertical_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #DDDDDD
5 | #0096a6
6 | #ffaa3f
7 | #ffaa3f
8 | #30000000
9 | #30FF0000
10 | #00000000
11 | #AA000000
12 | #59000000
13 | #FFFFFF
14 | #AAFADCA7
15 | #FADCA7
16 | #EEFF41
17 | #0096a6
18 | #4A4F51
19 | #2A2F51
20 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
18 |
21 |
24 |
27 |
30 |
33 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/app/src/main/res/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
25 |
36 |
37 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.0.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/episode_4/TVDemoApp/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 10 11:36:50 CET 2014
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/episode_4/TVDemoApp/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dextorer/BuildingForAndroidTV/bf5511071306cc5d9283bdccc4861a528d0671f8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-2.2-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':episode_1:TVDemoApp:app'
2 | //project(':episode_1:TVDemoApp:app').projectDir = new File(settingsDir, 'episode_1/TVDemoApp/app')
3 | include ':episode_2:TVDemoApp:app'
4 | //project(':episode_2:TVDemoApp:app').projectDir = new File(settingsDir, 'episode_2/TVDemoApp/app')
5 | include ':episode_3:TVDemoApp:app'
6 | //project(':episode_3:TVDemoApp:app').projectDir = new File(settingsDir, 'episode_3/TVDemoApp/app')
7 |
--------------------------------------------------------------------------------