title: Android TV move focus between RecyclerViews
body: <p>I am building an Android TV app with the following layout:
  <a href="https://i.stack.imgur.com/rMIq9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rMIq9.png" alt="enter image description here"></a></p>
  
  <p>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.</p>
  
  <p>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 good solution to this?</p>
  
  <p>Required behaviour:
  user navigates to the top of the list and presses "UP" - focus stays where it was, nothing happens.
  user navigates to the bottom of the list and presses "DOWN" - focus stays where it was, nothing happens.
  user navigates from list1 to list2 - the item, that previously had focus in list2, gains focus or item0 gains focus if none was focused previously.</p>
  
  <p>main layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      &gt;
  
      &lt;ImageView
          android:id="@+id/iv_background"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:focusable="false"
          /&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_marginBottom="27dp"
          android:layout_marginLeft="48dp"
          android:layout_marginRight="48dp"
          android:layout_marginTop="27dp"
          android:orientation="horizontal"
          &gt;
  
          &lt;LinearLayout
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="2"
              android:orientation="vertical"
              &gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:focusable="false"
                  android:orientation="horizontal"
                  &gt;
  
                  &lt;ImageView
                      android:id="@+id/iv_poster"
                      android:layout_width="@dimen/episodes_list_item_height"
                      android:layout_height="@dimen/episodes_list_image_width"
                      /&gt;
  
                  &lt;LinearLayout
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:orientation="vertical"
                      &gt;
  
                      &lt;TextView
                          android:id="@+id/tv_title"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          /&gt;
  
                      &lt;FrameLayout
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          &gt;
  
                          &lt;TextView
                              android:id="@+id/tv_release_date"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_gravity="left"
                              /&gt;
  
                          &lt;TextView
                              android:id="@+id/tv_rating"
                              android:layout_width="wrap_content"
                              android:layout_height="wrap_content"
                              android:layout_gravity="right"
                              android:drawableLeft="@drawable/ic_star_white_24dp"
                              android:drawablePadding="@dimen/view_padding_small"
                              /&gt;
  
                      &lt;/FrameLayout&gt;
  
                      &lt;TextView
                          android:id="@+id/tv_description"
                          android:layout_width="match_parent"
                          android:layout_height="0dp"
                          android:layout_weight="1"
                          /&gt;
                  &lt;/LinearLayout&gt;
  
              &lt;/LinearLayout&gt;
  
              &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/rv_seasons_list"
                  android:layout_width="match_parent"
                  android:layout_height="0dp"
                  android:layout_weight="1"
                  android:focusable="false"
                  /&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:id="@+id/rv_episodes_list"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="3"
              android:focusable="false"
              /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>item layout, used for both lists:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="@dimen/seasons_list_item_height"
      android:orientation="horizontal"
      android:focusable="true"
      &gt;
  
      &lt;TextView
          android:id="@+id/tv_title"
          android:layout_width="0dp"
          android:layout_height="match_parent"
          android:gravity="center_vertical"
          android:layout_weight="1"
          /&gt;
  
      &lt;TextView
          android:id="@+id/tv_episodes_count"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:gravity="center_vertical"
          android:ems="10"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>