android-tv

How to implement scrolling in RecyclerView on Android TV?

ぐ巨炮叔叔 提交于 2019-12-04 07:38:43
I have an application which I need adapt for Android TV. This application contains horizontal RecyclerView and it doesn't scroll when I press D-pad buttons on remote control. I found this solution , but it crashes. Here is the code: <ru.myapp.package.HorizontalPersistentFocusWrapper android:layout_width="wrap_content" android:layout_height="wrap_content"> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="250dp" android:background="@null" android:scrollbars="none"/> </ru.myapp.package

Android TV move focus between RecyclerViews

旧时模样 提交于 2019-12-04 05:49:27
I am building an Android TV app with the following layout: Both lists on the left and on the right are RecyclerViews with vertical LinearLayoutManagers, Header view is static. Navigation with D-PAD works fine within one list, but when switching from one list to another there are issues. Focus moves from, say list1's item 5 to list2' item 5. When list 2 is short has less than 5 items, it just loses focus. I want the last focused item index saved and when the user navigates list1-list2-list1 the item with that index to gain focus again and also prevent the views from losing focus. Is there any

Implementing a File Dialog in Android TV Leanback

和自甴很熟 提交于 2019-12-04 03:15:58
I have a dirPath String variable that I want to be able to change to a directory of my choice for an Android TV app. I find the Leanback framework's slideshow-like interface a little cumbersome for subtler actions but I would like to stick to it when I can as I'm a complete beginner on Android and java in general. So, trying to stick to best practices, I would like the user to be able to change dirPath to point to a directory of their choosing ( dirPath is used as a variable to scan for music in the nominated directory and its subdirectories). On other platforms I would look for a standard

Admob for Android TV app

好久不见. 提交于 2019-12-04 02:33:50
Developing an application for Android TV, I have a question on the use of ads. The Android TV layout guide states that: Advertising on Android TV must always be full-screen. Ads must not appear alongside or over content. The user must be able to dismiss an advertisement with the D-pad controller. Video ads must be dismissible within 30 seconds of their start time. Android TV does not provide a web browser. Your ads must not attempt to launch a web browser or redirect to the Google Play Store. Google's Admob does provide interstitial ads. However, I am not clear whether it meets the other

Multiple ListRows for each Header on BrowseFragment - Leanback library

元气小坏坏 提交于 2019-12-03 12:31:41
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. The Leanback team has recently added in support for multiple ListRow s for one HeaderItem in version 24.0.0 of the library. It allows

Remove background from ImageCardView

折月煮酒 提交于 2019-12-02 09:57:07
问题 I started using new android.support.v17.leanback library and have some trouble in styling ImageCardView . I am changing the image on ImageCardView to have a different shape so I would like to remove background and shadow which are automatically generated when using the card in ListRow for example. If I leave the shadow, my card looks weird because shadow and background are showing like the card is square. I've tried to set the different background to all the elements but it doesn't work. If I

Android Facebook SDK 3.23.0 - FB Login on AndroidTV

可紊 提交于 2019-12-02 00:48:48
Does anyone have any experience using the Facebook SDK to perform Facebook login on AndroidTV? Since it's most often the case that an AndroidTV user won't have the actual Facebook app installed on the AndroidTV device, the Facebook SDK will open a WebView to allow the user to enter his Facebook credentials and login. The issue is the webview that gets displayed doesn't respond to d-pad actions and the fields to enter text don't indicate they are selected. Am I to assume that Facebook login for AndroidTV just isn't possible using the standard Facebook SDK functionality? Correct. Also, Facebook

Disable row scaling / expand in BrowseFragment

你说的曾经没有我的故事 提交于 2019-12-01 09:15:02
I have not found any documentation how to disable the row scaling when switching the focus from the Headers to the Fragments in a BrowseFragment. Leanback version 24.2.0 The BrowseFragment has a function enableMainFragmentScaling which solves the problem partially. The images now have the full size, but the titles are still not expanded like they are in the PlayStore App, Youtube app. The expand (without animation) when focusing a row. What i did so far: enableMainFragmentScaling(false); in BrowseFragment setExpand(false); in the nested RowsFragments. But it didn't change anything. The Code is

Disable row scaling / expand in BrowseFragment

白昼怎懂夜的黑 提交于 2019-12-01 06:06:46
问题 I have not found any documentation how to disable the row scaling when switching the focus from the Headers to the Fragments in a BrowseFragment. Leanback version 24.2.0 The BrowseFragment has a function enableMainFragmentScaling which solves the problem partially. The images now have the full size, but the titles are still not expanded like they are in the PlayStore App, Youtube app. The expand (without animation) when focusing a row. What i did so far: enableMainFragmentScaling(false); in

Android TV App - unable to select list item with remote

≡放荡痞女 提交于 2019-12-01 06:01:40
Currently I am working on Android TV app. I have used Android Lean back support library. I have added one ListView , but I can not able to select any of the item from listView with real device's remote. However, I can able to select item of listView on my Android Virtual Device with the help of mouse. Here is my sample code of listView: customViewOrders = new CustomViewOrders(getActivity().getBaseContext(), arrayViewOrders); lstViewOrder.setAdapter(customViewOrders); Here, arrayViewOrders is my ArrayList which contains data received from JSON webservice. Here is my JSON Response: { "order":[ {