dextorer / BuildingForAndroidTV

Code for the "Building for Android TV" series of articles.
https://medium.com/@rotxed
MIT License
104 stars 59 forks source link

about you project episode_2/TVDemoApp #8

Closed BulletTrain closed 9 years ago

BulletTrain commented 9 years ago

First,thanks for sharing this codes. I found a little bugs. setOnItemSelectedListener(getDefaultItemSelectedListener()); A quick look at the HeadersFragment source code revealed that the method has been removed and it has been replaced by setOnHeaderViewSelectedListener(OnHeaderViewSelectedListener listener).

But I can't set a OnHeaderViewSelectedListener. It can't be accessed from outside package. I try your method like this

VerticalGridView grid = getActivity().getVerticalGridView(this); grid.setOnChildSelectedListener(new OnChildSelectedListener() { @Override public void onChildSelected(ViewGroup viewGroup, View view, int i, long l) { // we can now update the content accordingly! } });

but it don't work.

dextorer commented 9 years ago

Hi @BulletTrain ,

episode 2 won't work if you use a newer version of Leanback (22 and onwards). It would be better to start from episode 4.

I'm planning to write a library that offers this CustomBrowseFragment, this will hopefully remove the need to create a project starting from what I've written here.

BulletTrain commented 9 years ago

@dextorer Thanks.