Git Product home page Git Product logo

buildingforandroidtv's Introduction

BuildingForAndroidTV

This repository contains the code related to my series of articles "Building for Android TV"

https://medium.com/building-for-android-tv/

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.

Update 29/07/2015

The library is now complete and available here: https://github.com/dextorer/Sofa

Be sure to try it and let me know your feedbacks!

Update 07/09/15

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:

Twitter @ rotxed

G+ @ SebastianoGottardo

buildingforandroidtv's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buildingforandroidtv's Issues

BaseConfig.getApplicationIdSuffix().

Unsupported method: BaseConfig.getApplicationIdSuffix().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

Not compiling

Is this code still usable?

Looks like android.support.v17.leanback.widget.OnItemSelectedListener is missing from the current (22.1.1) v17.leanback API too... or am I wrong?

App is crashing when moving from right to left side

Hey there,

app is crashing once again when moving from rows to header section:

public synchronized void toggleHeadersFragment(final boolean doOpen) {
......
final View rowsContainer = (View) rowsFragment.getView().getParent();

Do we have to copy the source code file in order to customize BrowseFragment?

Hello,

Thank you for your amazing article.
May I ask the question that in the title of this issue?
Since it would be difficult if we update the leanback lib to the latest version.

I met a problem that I want to control badge visibility base on the header drawer, however, I don't know how to do it since the headerFragment don't give out a way to verify is the drawer open or close.

Thank you in advance for your kind answer!

about you project episode_2/TVDemoApp

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.

VerticalGridFragment as content?

Hi,

First let me say thank you for publishing these guides. They've helped me out quite a bit.

I'm currently trying to build on these techniques; specifically, I'd like to use a VerticalGridFragment as the content view of a BrowseFragment (instead of a RowsFragment). I've got it mostly working, but there are a few strange behaviours that I haven't been able to get around.

The biggest issue at this point is that the animation of the rows_container doesn't appear to work correctly. If the right-most grid item is focused, and the drawer is opened, the rows_container does not slide right, instead its width seems to shrink, and the drawer slides over-top.

Would you be able to provide any insight into what could be happening? I can provide more info about my setup if needed.

Cheers!

Add Video player on the top of row fragment and manage focus between video player and row with Header fragment.

Hi,
I hope you are doing well,
I am using LeanBack code for the Android TV platform. But I have one issue. As per our requirement, We need to put the video player on the top of the row fragment and manage focus from rows to the video player.
After more research on the Leanback library, we are supposed to use the BrowseFragment to achieve the expected result.
Now the problem is how to design the preview section at the top with the Video player as the BrowseFragment shows the Rows from the bottom corner of the screen. How can we customization browse fragment or Row Fragment to resolve this?

Episode 3 code is crashing with the following error

Episode 3 is crashign due to following error in TvDemoActivity.java file:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample.example.TvDemoActivity}: java.lang.ClassCastException: android.widget.FrameLayout cannot be cast to com.sample.example.CustomFrameLayout

episode_4: default activity not found

Hi dextorer,

I tested your source code episode_4 today, and I got default activity not found error.
It could be resolved by adding tag on line 53 and 56.
Just for information.

Your source code helps me studying android TV app, thank you.

Picasso fast scrolling

Hi,

Testing to load 10 rows of 100 CardPresenters, it gets very laggy when fast scrolling even on very powerful android boxes.

Picasso v 2.4 has pauseTag() and resumeTag() made for this exact purpose. Their sample app uses a AbsListView onScrollListener and pauses/resumes the picasso bitmap loading in (fast) scroll mode.

Any way to implement this with leanback and your CustomRowFragment?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.