I am using Android Leanback library for creating TV application. I have a layout which inflates Fragment (which is RowsSupportFragment) and below that there is button. So, when I scroll down to list of items in RowsSupportFragment after reaching to last item focus doesn't goes to button. I already have tried setting focusable(true), nextFocusDown(buttonId) etc.
I can see that RowsSupportFragment uses VerticalGridView internally to inflate list of items.
Do anybody has any idea about it?
here is my layout:
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<FrameLayout
android:id="@+id/listviewFragmentId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:nextFocusDown="@id/nextButtonId"
android:nextFocusForward="@id/nextButtonId"
layout_constraintBottom_toTopOf="@id/nextButtonId"/>
<Button
android:id="@+id/nextButtonId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:focusable="true"
android:text="Hello Next"/>
<// other items>
</android.support.constraint.ConstraintLayout>
Note: Focus works correctly if I left/right align button.