Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Android TV Talk
Effie Barak
December 03, 2015
Technology
1
190
Android TV Talk
Effie Barak
December 03, 2015
Tweet
Share
More Decks by Effie Barak
See All by Effie Barak
codingchick
0
43
codingchick
2
95
codingchick
0
52
codingchick
1
160
codingchick
8
2.6k
codingchick
2
34k
codingchick
1
110
codingchick
0
80
Other Decks in Technology
See All in Technology
1027kg
0
210
jrfk
0
230
hmatsu47
5
740
noriyukitakei
0
100
uzabase_saas_product
0
110
dena_tech
0
240
akitok_
2
800
kentaro
1
820
dena_tech
1
100
oracle4engineer
0
3.8k
sat
40
29k
minma
0
220
Featured
See All Featured
reverentgeek
27
2k
trallard
14
720
jasonvnalue
81
8.1k
cassininazir
347
20k
erikaheidi
14
4.3k
mthomps
38
2.3k
brianwarren
82
4.7k
bryan
100
11k
tanoku
258
24k
thoeni
3
610
deanohume
294
28k
hursman
106
9.3k
Transcript
ANDROID TV APPLICATION Effie Barak (@CodingChick)
None
None
Support libraries required Either Glide or Picasso can work, there
are implementation differences
Which version of the support libraries to use? The latest
one that works - All support libraries versions need to be the same. - SQLCipher needs to be 3.3.1-1or higher. Which didn’t work so well for me :(
Application Manifest Changes
Theme to play with
Tons of auto generated code!
Main page birdview
Main page birdview scrolling
Main Fragment that extends BrowseFragment: ArrayObjectAdapter ListRowPresenter ImageCardView
Hooking up Udemy’s model
Click events should use Course model
CourseCardPresenter extends Presenter (Is just your everyday adapter)
ImageCardView is provided by leanback • CARD_TYPE_INFO_OVER (1) • CARD_TYPE_INFO_UNDER
(2) • CARD_TYPE_INFO_UNDER_WITH_EXTRA (3) • CARD_TYPE_MAIN_ONLY (0)
Course Details birdview
Course Details scrolled down
CourseDetailsFragment DetailsOverviewRowPresenter ClassPresenterSelector ListRowPresenter ImageCardView
DetailsOverviewRowPresenter is deprecated New class- FullWidthDetailsOverviewRowPresenter with different UI :(
LecturePresenter is similar to CoursePresenter
Details row gets its own Presenter
Creating the course details row
Creating the lectures row
Hooking it all up to the ClassPresenterSelector
Clicking on a lecture starts the Playback activity
Playback Activity
Playback Activity
Playback Activity
PlaybackOverlayFragment extends leanback’s PlaybackOverlayFragment ClassPresenterSelector DetailsOverviewRowPresenter ListRowPresenter
Instantiating the base structure
Adding all the ACTIONS Etc etc etc…
Hooking up the actions listeners
Video! Warp 9! Engage!
The VideoView plays things
Implementation of MediaSession
And the callbacks class
playPause method
The controls in the PlaybackControlsRow need to know.
The actions click events can invoke the MediaController’s methods
Voice search
Voice search
Searchinggg
In the Search Fragment
The actual search
Loading the results
Handling clicking on a result
Starting the whole thing up
Useful resources: https://github.com/googlesamples/androidtv-Leanback Default auto- generated template https://developer.android.com/training/tv/index.html (Sorta, kinda,
maybe)