Code Monkey home page Code Monkey logo

androidtv-leanback's Introduction

Android TV Leanback Support Library sample - Videos by Google

This repo has been migrated to github.com/android/tv-samples. Please check that repo for future updates. Thank you!

androidtv-leanback's People

Contributors

benbaxter avatar cartland avatar codingjeremy avatar dmalykhanov-github avatar dpreussler avatar fleker avatar gitter-badger avatar jaewan-github avatar kingargyle avatar marcbaechinger avatar naokigoogle avatar ogapants avatar pengying avatar ph0b avatar ryanseys avatar seventhmoon avatar shawngit avatar smishra2 avatar tjohns avatar tobdub avatar yqritc avatar

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  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

androidtv-leanback's Issues

Modify ImageCardView to show text instead of image

@ryanseys Hello, I am working with the Leanback Library Sample and would like to make a change to how the cards look. When viewing the cards as a list as well as in the detailed focused view I would like to remove the image and add some text there instead.

What would be the best way to go about doing this while still preserving the look and feel of the leanback cardview? Here are some images to show what I am looking to do. Thanks!

image

image

GPU usage

Hello ,

My issue is when i play build-in google's provided link mp4 video ,it's able to use GPU steady and the video progress bar shown .

google's link
http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Explore%20Treasure%20Mode%20with%20Google%20Maps.mp4

But when i change to my apache web server with mod_h264 module Pseudo and progressive runs well. I have tried download google's video place on my web server .

Would you please state the difference ?

Regards,

Bibby.Chan

androidtv-leanback-sample.png blocks building

Went to run the sample code on Android Studio 1.1.0 and the build fails:

Error:Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])
Error:Execution failed for task ':app:mergeDebugResources'.
> /Users/eschra000/dev-work/androidtv-Leanback/app/src/main/res/drawable/androidtv-leanback-sample.png: Error: Invalid file name: must contain only lowercase letters and digits ([a-z0-9_.])

Renaming the file to use underscores fixes the issue. 5b966f1 deleted a file with this name, so I'm not sure if this file needs to be renamed or outright deleted.

leanback-library: 25.+: BackgroundManager loses background when going back from DatailsFragment to MainFragment

Let's say we have two fragments. MainFragment showing a ListRow of card-items and the DetailFragment that opens when a card is clicked.

  • When a card is selected, the background of MainFragment get set according to the bgImagUrl.
  • When a card is clicked, the background of DetailsFragment is also set.
  • When leaving DetailsFragment and going back to MainFragment the background fades out and there's no background-image on the MainFragment.

I tried calling updateBackground() in onResume() of MainFragment, but the result is, that the background fades out, and fades back in.

The behaviour of leanback-library:24 was:

  • When leaving DetailsFragment and going back to MainFragment, the background was still there.

Custom Cards are invisible...

I have used a custom card which is a subclass of BaseCardView. You can see the hidden row was third row and it was not inside the screen but when I scroll and it shows up hidden. Why it is not visible ?
screen shot 2016-05-07 at 1 40 51 pm
screen shot 2016-05-07 at 1 40 27 pm

Long Press for Item in browsefragement

Please think about implementing a long press event. This could be useful to show a quick Dialog to the user to select an option. for example.

longpress on an album cover: instead of playing the album it could be
liked, saved to library, browsed, etc....

Now Playing Icon on Card not Customizable

I'm having an issue customizing the icon in the bottom right corner of the now playing card when a user hits the home button while watching a video on the Android TV Home screen.

I've tried to set
metadata.putString(MediaMetadata.METADATA_KEY_DISPLAY_ICON_URI, "android.resource://" + BuildConfig.APPLICATION_ID + "/drawable/android_header");

On the media session however it looks like it's not possible to change the icon on the Now Playing card. It seems to just pull directly from the application icon field. The issue here is that the icon is clearly greyscaled when this happens and the application icon I have has color in it. So I want to keep my current application icon for the playstore and have a different one for this now playing card.

I've also tried changing METADATA_KEY_DISPLAY_ICON to the bitmap directly and that doesn't seem to work. Any advice?

Crash in BrowseSupportFragment because of BrowseSupportFragment.setHeadersState(BrowseSupportFragment.HEADERS_DISABLED)

I am experiencing a crash after updating from 23.3.0 to 24.0.2 when I launch the BrowseSupportFragment.

On the BrowseSupportFragment I need the headers on the left hand pane to be gone so I call setHeadersState(BrowseSupportFragment.HEADERS_DISABLED);. In the onStart() method there is a call to mMainFragment.getView(). But this fragment has not yet been created. I see that this fragment can be created when a user calls setAdapter IF there is an adapter set with a size > 0. My data comes from the network so it will only be available some time after onStart().


FATAL EXCEPTION: main
   Process: my.package.name, PID: 20818
   java.lang.RuntimeException: Unable to start activity ComponentInfo{my.package.name}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.Fragment.getView()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
   Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.support.v4.app.Fragment.getView()' on a null object reference
    at android.support.v17.leanback.app.BrowseSupportFragment.onStart(BrowseSupportFragment.java:1512)
    The rest of the stack trace is in my code

ErrorFragment causes crash

Hello,
every time I click on ErrorFragment, the app crashes. Here is the stacktrace:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.tvleanback/com.example.android.tvleanback.ui.BrowseErrorActivity}: java.lang.IllegalArgumentException: No view found for id 0x7f1000ce (com.example.android.tvleanback:id/main_frame) for fragment ErrorFragment

Please advise.

Content search seems to be broken

When running the sample app on a nexus player no content can be brought up using the google search. I can see in the logcat the following error.

1822-1838/com.example.android.leanback E/JavaBinder﹕ *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426)
at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
at android.database.AbstractWindowedCursor.getType(AbstractWindowedCursor.java:130)
at com.example.android.leanback.PaginatedCursor.(PaginatedCursor.java:65)
at com.example.android.leanback.VideoDatabase.query(VideoDatabase.java:170)
at com.example.android.leanback.VideoDatabase.getWordMatch(VideoDatabase.java:150)
at com.example.android.leanback.VideoContentProvider.getSuggestions(VideoContentProvider.java:112)
at com.example.android.leanback.VideoContentProvider.query(VideoContentProvider.java:85)
at android.content.ContentProvider.query(ContentProvider.java:950)
at android.content.ContentProvider$Transport.query(ContentProvider.java:210)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:446)

Reloading data in BrowseFragment

Hi. I am writing an Android TV app and have bumped into this issue. I have to replace all the rows in BrowseFragment with new ones on receiving an Event. What i've tried:

mRowsAdapter.clear();
...
mRowsAdapter.add(add new rows here);

Where mRowsAdapter is the ArrayObjectAdapter with ListRow items. Also tried this approach:

mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
setAdapter(mRowsAdapter);
mRowsAdapter.add(add new rows here);

Neither of them works. I keep getting IOBE. Here are the logs:

            java.lang.IndexOutOfBoundsException: Index: 7, Size: 0
                                   at java.util.ArrayList.get(ArrayList.java:411)
                                   at android.support.v17.leanback.widget.ArrayObjectAdapter.get(ArrayObjectAdapter.java:56)
                                   at android.support.v17.leanback.app.ListRowDataAdapter.get(ListRowDataAdapter.java:65)
                                   at android.support.v17.leanback.widget.ItemBridgeAdapter.getItemViewType(ItemBridgeAdapter.java:248)
                                   at android.support.v7.widget.RecyclerView$Recycler.validateViewHolderForOffsetPosition(RecyclerView.java:5046)
                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5172)
                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5153)
                                   at android.support.v17.leanback.widget.GridLayoutManager.getViewForPosition(GridLayoutManager.java:971)
                                   at android.support.v17.leanback.widget.GridLayoutManager$2.createItem(GridLayoutManager.java:1464)
                                   at android.support.v17.leanback.widget.SingleRow.appendVisibleItems(SingleRow.java:111)
                                   at android.support.v17.leanback.widget.Grid.appendVisibleItems(Grid.java:371)
                                   at android.support.v17.leanback.widget.GridLayoutManager.appendVisibleItems(GridLayoutManager.java:1702)
                                   at android.support.v17.leanback.widget.GridLayoutManager.fastRelayout(GridLayoutManager.java:1764)
                                   at android.support.v17.leanback.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:1888)
                                   at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3374)
                                   at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3183)
                                   at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3627)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.support.v17.leanback.widget.ScaleFrameLayout.onLayout(ScaleFrameLayout.java:172)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
                                   at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
                                   at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
                                   at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
                                   at com.android.internal.policy.DecorView.onLayout(DecorView.java:724)
                                   at android.view.View.layout(View.java:17519)
                                   at android.view.ViewGroup.layout(ViewGroup.java:5612)
                                   at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2342)
                                   at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2069)
                                   at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
                                   at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
                                   at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
                                   at android.view.Choreographer.doCallbacks(Choreographer.java:683)
                                   at android.view.Choreographer.doFrame(Choreographer.java:619)
com.cloudify E/AndroidRuntime:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
                                   at android.os.Handler.handleCallback(Handler.java:751)
                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                   at android.os.Looper.loop(Looper.java:154)
                                   at android.app.ActivityThread.main(ActivityThread.java:6077)
                                   at java.lang.reflect.Method.invoke(Native Method)
                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Original question on stackoverflow
Please help. Thank you.

VerticalGridFragment turn off dimming of cards

@Fleker or anyone else that contributes to the leanback sample...

I am working on VerticalGridFragment that does not do anything but display the cards. To do this I am making some slight changes. I do not want the user to be able to focus on the cards or open them. That was easy and I just set cardView.setFocusable(false); in the CardPresenter. This is complete. However, I could not find the following...

  1. I would like all of the cards to not have the dim look and am having trouble finding where this is set. I would all cards to look equally bright.
  2. I have increased my CardView sizes in the CardPresenter and now the VerticalGridFragment shows the group of cards off center. Do you know where I can change the padding around the group of cards?

Any help on these two modifications would be great.

Thanks a ton!

Adam

Build fails with "String types not allowed (at 'slideEdge' with value 'end')."

Tried Gradle 2.2.1 and 2.3 for the same result.

Full transcript of error message:

What went wrong:
Execution failed for task ':app:processReleaseResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
c:\adt\sdk\build-tools\21.1.2\aapt.exe package -f --no-crunch -I c:\adt\sdk\platforms\android-21\android.jar -M C:\work\androidtv-Leanback-master\app\build\intermediates\manifests\full\release\AndroidManifest.xml -S C:\work\androidtv-Leanback-master\app\build\intermediates\res\release -A C:\work\androidtv-Leanback-master\app\build\intermediates\assets\release -m -J C:\work\androidtv-Leanback-master\app\build\generated\source\r\release -F C:\work\androidtv-Leanback-master\app\build\intermediates\res\resources-release.ap_ --custom-package com.example.android.tvleanback -0 apk --output-text-symbols C:\work\androidtv-Leanback-master\app\build\intermediates\symbols\release
Error Code:
1
Output:
C:\work\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_entrance_transition.xml:23: error: Error: String types not allowed (at 'slideEdge' with value 'end').
C:\work\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:18: error: Error: String types not allowed (at 'slideEdge' with value 'start').
C:\work\androidtv-Leanback-master\app\build\intermediates\res\debug\transition-v22\lb_browse_return_transition.xml:27: error: Error: String types not allowed (at 'slideEdge' with value 'end').

ExoPlayer v2

By any chance is the sample app going to be updated to use thew new ExoPlayer v2 lib?

Failed to resolve ExoPlayer

Hi,
I couldn't be gradle sync because of ExoPlayer.
But I succeed build after use not "mavenCentral" but "jcenter".
Why do you use "mavenCentral"?

It's my error.

Error:(26, 13)
Failed to resolve: com.google.android.exoplayer:exoplayer:r1.5.5
Loading SDK information...
Ignoring unknown package filter 'extra-google-m2repository'Warning: The package filter removed all packages. There is nothing to install.
         Please consider trying to update again without a package filter.

thanks.

Headers Fragment

Is Leanback has default possibility to make HeadersFragment non scrollable like it implemented in the Google Play Store?

Failed to Build Tools

I have updated my studio build tools to the latest version.
It's 24.0.4.
Still it is failing to install build tools

Voice search button cannot be selected

I encountered a bug while using the demo app. Steps to reproduce:

  1. Launch app, go to Search Activity
  2. Type in (or dictate) something in search, that will result in no results (some gibberish like "asjkdhasdha") will work just fine.
  3. Try to select the "Voice search button" with D-Pad. It will be impossible. The only way to go from there is only by selecting the search text input and typing or clearing up the search query.

I suspect the issue happens because when there are no results what we actually do is add a new row to adapter with Header and no items:

example\ui\SearchFragment.java
...
} else {
    // No results were found.
    mRowsAdapter.clear();
    HeaderItem header = new HeaderItem(getString(R.string.no_search_results, mQuery));
    ListRow row = new ListRow(header, new ArrayObjectAdapter());
    mRowsAdapter.add(row);
}

This triggers the focus to be set on the first row (because mResultAdapter.size() > 0 is true, since adapter has one row) and therefore breaks the focus, so it is no longer possible to select "Voice search" button.

v17.leanback.app.SearchFragment.java
private void updateFocus() {
        if (mResultAdapter != null && mResultAdapter.size() > 0 &&
                mRowsFragment != null && mRowsFragment.getAdapter() == mResultAdapter) {
            focusOnResults();
        } else {
            mSearchBar.requestFocus();
        }
    }

Provide Gradle/Maven build.

The code does not appear to be complete. The Theme.Leanback theme is missing so there are compilation errors. I'm working on upgrading a Google TV application to make use of Android TV functionality so having a working sample would be beneficial. Also would be nice to either have a gradle build or maven build for this.

customize browser fragment

hi, every body.
I want to know is there any way to change currently browser fragment to show headers section at the right of the screen instead of left of it. my main purpose is to make browser fragment suitable for RTL languages.

thanks for your permanent replays :)

Custom Fragment

Hi,
is there any way how to add custom fragment (for example EPG) when I select something in left navigation menu ?
Thx for advice.

Handling of KEYCODE_MEDIA_PLAY_PAUSE and other media remote buttons

According to the Android TV Design Guidelines in order to get an application accepted and published into Google Play an Android TV app that plays video or must content must respect the play/pause key during playback. This application doesn't handle any of the PLAY, PAUSE, or PLAY_PAUSE buttons on the PlaybackActivity.java and as a sample of an application that adheres to these guidelines an update should be made to bring this sample back into compliance with these published guidelines.

Please refer to our Media Play/Pause documentation for details:
http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_MEDIA_PLAY_PAUSE

re-sizing the custom cardview inherits from BaseCardView with wrap-content height

Hi,

I recently ran into a problem that needs to resize the height of cardview in PlaybackOverlayFragment after the TextView has been set with the text.

setText() was binding in onBindViewHolder()

I gave the layout of view fixed width and the height is set to wrap_content, but after I have set the text and attempt to call requestLayout() or invalidate (), I am not able to re-size the card.

may I ask your opinion that how to achieve it?

Does not work in android TV emulator

does not work in android TV emulator 720p and 1080p mode.
latest android 6.0 latest studio sdk
the emulator shows only a gray "Android" text but nothing happens

:app:assembleDebug
BUILD SUCCESSFUL
Total time: 3 mins 35.472 secs

Playback/Streaming does not work.

The sample app that google provides keeps giving me "can't play this video" and this stack trace:

11-14 10:45:29.852 8923-9263/com.example.android.tvleanback E/MediaPlayer: error (1, -38)
11-14 10:45:29.861 8923-9262/com.example.android.tvleanback E/MediaPlayer: error (1, -38)
11-14 10:45:29.861 8923-8923/com.example.android.tvleanback E/MediaPlayer: Error (1,-38)
11-14 10:45:29.861 8923-8923/com.example.android.tvleanback D/VideoView: Error: 1,-38
11-14 10:45:29.861 8923-8923/com.example.android.tvleanback E/MediaPlayer: stop called in state 0
11-14 10:45:29.861 8923-8923/com.example.android.tvleanback E/MediaPlayer: error (-38, 0)
11-14 10:45:29.940 8923-8923/com.example.android.tvleanback W/MediaPlayer: mediaplayer went away with unhanded events

I have spent hours trying to figure out what is wrong, to no avail. Not that this is my first foray into Android TV, so it's unlikely that I'd have been able to solve the issue.

Demo app not working in fire tv

Hi,
Demo app is not working in fire tv.
Also, In SearchFragment, the default android speech recognizer is not working in amazon fire os.
So, is there any way to disable speech/microphone icon in SearchFragment?

Data does not load in opening the app on Android Fire TV

While running the app, the main screen appears with a large loading circle. The data never loads and none of the buttons work. Only the Voice search option works. I am running in Amazon Fire TV. The OS is Fire OS 5.2.4.1 and the Fire TV Home Version is 5.7.3-17.

Custom Presenter Error: Do not setLayoutFrozen in layout or scroll

I had tried to create a custom presenter with just a single custom view and after first bind i get this error message. What's the problem?

03-02 21:59:23.772 21573-21573/com.nodomain.androidtvsample E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.nodomain.androidtvsample, PID: 21573
  java.lang.IllegalStateException: Do not setLayoutFrozen in layout or scroll
      at android.support.v7.widget.RecyclerView.assertNotInLayoutOrScroll(RecyclerView.java:2164)
      at android.support.v7.widget.RecyclerView.setLayoutFrozen(RecyclerView.java:1750)
      at android.support.v17.leanback.app.BaseRowFragment.onTransitionStart(BaseRowFragment.java:199)
      at android.support.v17.leanback.app.RowsFragment.onExpandTransitionStart(RowsFragment.java:483)
      at android.support.v17.leanback.app.BrowseFragment.startHeadersTransitionInternal(BrowseFragment.java:435)
      at android.support.v17.leanback.app.BrowseFragment.access$200(BrowseFragment.java:77)
      at android.support.v17.leanback.app.BrowseFragment$3.onRequestChildFocus(BrowseFragment.java:546)
      at android.support.v17.leanback.widget.BrowseFrameLayout.requestChildFocus(BrowseFrameLayout.java:124)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.support.v7.widget.RecyclerView.requestChildFocus(RecyclerView.java:2081)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.view.ViewGroup.requestChildFocus(ViewGroup.java:740)
      at android.support.v7.widget.RecyclerView.requestChildFocus(RecyclerView.java:2081)
      at android.view.ViewGroup.addViewInner(ViewGroup.java:4341)
      at android.view.ViewGroup.addView(ViewGroup.java:4145)
      at android.view.ViewGroup.addView(ViewGroup.java:4086)
      at android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:591)
      at android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107)
      at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:6708)
      at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6666)
      at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6654)
      at android.support.v17.leanback.widget.GridLayoutManager$2.createItem(GridLayoutManager.java:1473)
      at android.support.v17.leanback.widget.SingleRow.appendVisibleItems(SingleRow.java:111)
      at android.support.v17.leanback.widget.Grid.appendOneColumnVisibleItems(Grid.java:364)
      at android.support.v17.leanback.widget.GridLayoutManager.appendOneColumnVisibleItems(GridLayoutManager.java:1696)
      at android.support.v17.leanback.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:1881)
      at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3026)
      at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2903)
      at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3277)
      at android.view.View.layout(View.java:16630)
      at android.view.ViewGroup.layout(ViewGroup.java:5437)
      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
      at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
      at android.view.View.layout(View.java:16630)
      at android.view.ViewGroup.layout(ViewGroup.java:5437)
      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
      at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
      at android.view.View.layout(View.java:16630)
      at android.view.ViewGroup.layout(ViewGroup.java:5437)
      at android.support.v7.widget.RecyclerView$LayoutManager.layoutDecorated(RecyclerView.java:7629)
      at android.support.v17.leanback.widget.GridLayoutManager.layoutChild(GridLayoutManager.java:1631)
      at android.support.v17.leanback.widget.GridLayoutManager.access$2700(GridLayoutManager.java:53)
      at android.support.v17.leanback.widget.GridLayoutManager$2.addItem(GridLayoutManager.java:1540)
      at android.support.v17.leanback.widget.SingleRow.appendVisibleItems(SingleRow.java:124)
    at android.support.v17.leanback.widget.Grid.appendOneCol

How can I customize browsefragement?

Hello,
Recently, I would need some layout changing in my App like call showTitle() in BrandedFragment, but I could not do it from MainFragment that extends BrowseFragment since it's not public.

May I ask how can I tone it a little bit to adapt my design? Mainly about how to hide title/badge layout and put badge on the headerDrawerDrawer.

Thank you in advanced for your help!

Action not showing icon

Adding Action() in DetailsOverviewRow
using either DetailsOverviewRow.addAction() or DetailsOverviewRow.setActionAdapter()
is NOT showing the icon using new Action(label1, label2, drawable)

Deeplink stops working

I tried to search for Noah to see deep linking, however search result displayed as normal.
I'm using Nexus Player, Android 6.0.

App doesn't keep playback behind leanback launcher if "Recent" is pressed in Android >= 7.

Tested on an NVIDIA SHIELD device running Android 7.0

These are the steps to reproduce the issue:

  • Start video playback.
  • Hit "Recent" button.
  • Return to the app from app switcher. Video player was closed and item's preplay screen is displayed.
  • Play item again.
  • Hit "Home" button.

Expected behaviour:

  • App should keep video playback in leanback launcher background.

Actual behaviour:

  • Video playback is stopped.

This happens because when "Recents" button is hit, PlaybackOverlayFragment:onPause is calling getActivity().requestVisibleBehind(true) so it's saying app wants to stay behind which I think it's not correct, as the system displays app switcher rather than leanback launcher so there is no point leaving video playback behind that UI. When playback is started again after returning to the app via app switcher and then "Home" is hit, requestVisibleBehind is again called but system is returning false this time, forcing video playback to be stopped.

Is there a way to identify that "Recents" button is hit and therefore don't request to leave video playback behind?

In this video you can see the behaviour described: https://drive.google.com/file/d/0B3_15qFiB8KVT1V1b3VPVEp5c28/view?usp=sharing

java.lang.IllegalStateException in leaback HeadersFragment

I`ve received such exception after which app crashed. With what it can be connected with?

/System.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
W/System.err: at android.view.ViewGroup.addViewInner(ViewGroup.java:4454)
W/System.err: at android.view.ViewGroup.addView(ViewGroup.java:4295)
W/System.err: at android.view.ViewGroup.addView(ViewGroup.java:4235)
W/System.err: at android.view.ViewGroup.addView(ViewGroup.java:4208)
W/System.err: at android.support.v17.leanback.app.HeadersFragment$3.wrap(HeadersFragment.java:220)
W/System.err: at android.support.v17.leanback.widget.ItemBridgeAdapter.onCreateViewHolder(ItemBridgeAdapter.java:313)
W/System.err: at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6321)
W/System.err: at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5509)
W/System.err: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5394)
W/System.err: at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5390)
W/System.err: at android.support.v17.leanback.widget.GridLayoutManager.getViewForPosition(GridLayoutManager.java:1007)
W/System.err: at android.support.v17.leanback.widget.GridLayoutManager$2.createItem(GridLayoutManager.java:1506)
W/System.err: at android.support.v17.leanback.widget.SingleRow.appendVisibleItems(SingleRow.java:111)
W/System.err: at android.support.v17.leanback.widget.Grid.appendOneColumnVisibleItems(Grid.java:363)
W/System.err: at android.support.v17.leanback.widget.GridLayoutManager.appendOneColumnVisibleItems(GridLayoutManager.java:1737)
W/System.err: at android.support.v17.leanback.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:1960)
W/System.err: at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3537)
W/System.err: at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3266)
W/System.err: at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3798)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
W/System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
W/System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
W/System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
W/System.err: at com.android.internal.policy.DecorView.onLayout(DecorView.java:724)
W/System.err: at android.view.View.layout(View.java:17519)
W/System.err: at android.view.ViewGroup.layout(ViewGroup.java:5612)
W/System.err: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2489)
W/System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2191)
W/System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1343)
W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6526)
W/System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
W/System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:683)
W/System.err: at android.view.Choreographer.doFrame(Choreographer.java:619)
W/System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err: at android.os.Looper.loop(Looper.java:154)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6120)
W/System.err: at java.lang.reflect.Method.invoke(Native Method)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

All unclear things

  1. Working with UI (the Leanback library).
    Specially for me it is difficult to understand which fragment is representing specific UI element, like where i can find list of fragments with associated xml layout?
    For example "ErrorFragment" how i will be able to know which layout structure it represents
  2. TvInputServices
    What is the difference between TvInputService and standard android IntentService? As I know you can run IntentService from code but this situation is different with TvInputService. How TvInputService can be run or it is not necessary and it is enough to describe TvInputService in android manifest file?
    How Android Live Channels app can recognize my TvInputService and run it? Can I сlose access Android Live Channels app to run my service without my permissions? Can i manipulate TvInputService from my app UI (ui with two buttons one of it should run service other one have to stop it)?
  3. Authorization in Android Tv apps.
    How many ways do we have to authorize users by social networks not only Google+ (Facebook, Twitter an etc)?
    Ok. I have case and I spouse to build app which should has simple UI and a few TvInputService, but TvInputService must be run when current user already authorized.

Use of MediaSessionCompat in Support Library

Migrate the code using MediaSession to MediaSessionCompat, so that the application can run on pre-lollipop devices.

Since this app is to demo Leanback support library of v17, running on sdk21+ should not be a requirement.

Image in Global Search

Image in Global Search looks uggly - pixelized, and always in landscape mode. Any suggestions, how to fix it and make it be shown in portrait mode?

Tested on Android TV (api 21) emulator

Custom Header Stopped Scrolling

After updating gradle and android libraries to latest, Custom Header Scrolling stopped completely.
onSelectLevelChanged is not getting called.

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.