leanback

Dynamically add more cards in a list Row android TV leanback

余生长醉 提交于 2020-01-15 11:58:12
问题 I am working on a Android TV app for quite some time now and I have come far while working on it. I am trying to develop an app like popcorn time but it's for Google nexus TV box. The problem where I am stuck in, is really simple but even after a lot of effort I am still unable to figure out the solution. I am fetching the json data from my database which has all the movies details and links and this works perfectly fine. Over all app view Now those who have used the you tube app on Android

Adding Multiple Presenters to ArrayObjectAdapter of Android Leanback

馋奶兔 提交于 2020-01-06 05:34:26
问题 I want to display two different types of cards in the same row (ListRow) . I tried to modify the Presenter class by adding viewType similar to dealing with displaying multiple row types in RecyclerVew but it did not work. I tried digging into the Presenter and ArrayObjectAdapter code but there is no obvious option to achieve this. If someone has done this then please point me in the right direction. 回答1: You can use ClassPresenterSelector to show different types of cards in the same row

Vertical list like android phones in android tv leanback

帅比萌擦擦* 提交于 2020-01-06 05:23:09
问题 I want to create a simple vertical list (single column in a row), which is only scrollable vertically not horizontally. How do i achieve this on android tv using leanback ? Refer below image for more clarification on ui requirement. I tried using VerticalSupportFragment, but a row item doesn't spans to a full width, tried changing styles and presenter also. Thanks in advance, is there any way to achieve this ? 回答1: If you use a VerticalGridSupportFragment you can set the number of columns

Android TV: VerticalGridFragment shadow dimension and color

我与影子孤独终老i 提交于 2020-01-02 05:46:12
问题 I'm working on an Android TV application but I'm not quite happy with the standard shadow rendered by the VerticalGridFragment , I'd like to have it smaller and a bit less darker. I've searched through the code but I didn't find any full working solution. In my VerticalGridPresenter subclass, the only method I can override is createShadowOverlayOptions but I can't get the result I want. The only workaround I came up with is to define the following dimensions, so that the ones declared in the

How to write a custom Leanbacks VerticalGridView in Android TV?

假装没事ソ 提交于 2019-12-24 07:58:09
问题 I want to implement a Row from the Details screen of the Leanback library into a customized screen. The row will be the one below. I have already implemented the HorizontalGridView and have managed to get the items to be shown. My layout: <android.support.v17.leanback.widget.HorizontalGridView android:id="@+id/detail_related" android:layout_width="match_parent" android:layout_height="wrap_content"/> My Java: RecyclerView.Adapter mAdapter = new SimilarAssetsAdapter(); mBinding.detailRelated

How to write a custom Leanbacks VerticalGridView in Android TV?

情到浓时终转凉″ 提交于 2019-12-24 07:57:03
问题 I want to implement a Row from the Details screen of the Leanback library into a customized screen. The row will be the one below. I have already implemented the HorizontalGridView and have managed to get the items to be shown. My layout: <android.support.v17.leanback.widget.HorizontalGridView android:id="@+id/detail_related" android:layout_width="match_parent" android:layout_height="wrap_content"/> My Java: RecyclerView.Adapter mAdapter = new SimilarAssetsAdapter(); mBinding.detailRelated

Leanback library support for API level 19 Android for TV app?

我的未来我决定 提交于 2019-12-23 15:23:11
问题 Is there a Leanback library support for API level 19 of Android? In this link https://developer.android.com/reference/android/support/v17/leanback/package-summary.html Google says it supports API level 21+. So I am not sure if there's a support for API level 19. 回答1: LeanBack was introduced in the support library v21 so no it is not in v19 http://developer.android.com/tools/support-library/features.html#v17-leanback if you are asking if you can use this in android version 19 aka 4.4 yes just

Leanback for Android TV : Unsetting Video Title Increases Spacing between Rows

血红的双手。 提交于 2019-12-22 09:30:42
问题 The PlaybackOverlayFragment of the sample app uses the PlaybackControlsGlue to set up playback controls based on the data model. This is the look when using the standard glue: My problem is that I don't want the title/subtitle text to appear above the main player controls bar - we want them at the top left of the player screen instead. Therefore, to disable the showing of title/subtitle, I override createControlsRowAndPresenter() of the glue and use the empty-args constructor of

Leanback VerticalGridFragment remove top spacing

孤街浪徒 提交于 2019-12-21 08:18:11
问题 I am using VerticalGridFragment to display items in a grid-like layout I don't need to show search or title and I want the rows to start from top of the screen without any margins. Any help? 回答1: You need create new class with name CustomVerticalGridPresenter and put followig code in it. public class CustomVerticalGridPresenter extends VerticalGridPresenter { VerticalGridView gridView; CustomVerticalGridPresenter(int zoom, boolean val){ super(zoom, val); } @Override protected void

Multiple ListRows for each Header on BrowseFragment - Leanback library

廉价感情. 提交于 2019-12-21 04:06:27
问题 I'm getting started with Leanback support for our app. As per UI requirements I need to add multiple list rows corresponding to each header, it's exactly like what Youtube App does on Android TV. Default ListRowPresenter seems to be rendering only one list row and its header. Is there any presenter that supports multiple list rows? I'm thinking on the lines creating a custom presenter with RowsFragment embedded in each item, correct me if my approach is wrong. 回答1: The Leanback team has