title: Take focus away from tabs in ViewPager/TabLayout
body: <p>I am using ViewPager/TabLayout on Android TV, and I have 2 questions. </p>
  
  <p>1) Currently, if I press DPAD_UP, the focus goes to the tabs, but the page does not actually change to the one corresponding to the focused tab until DPAD_CENTER is pressed. So, there is a difference between focused (shown as a grey box around the tab text) and selected (shown as an underline). I am wondering if it is possible to have whatever focused to be selected? </p>
  
  <p>2) I have 3 tabs in my ViewPager where the fragment in tab1 needs to have focus in order to display things properly. When I switch from tab3 to tab1, the focus is not given to the fragment but stays with the tab. This causes my fragment to not display properly. I am wondering if there is a way to take focus away from the tab? I dug into the source code of ViewPager and TabLayout, and I know the focus is with TabView of TabLayout, but no matter what I try, I cannot take away the focus state of TabView (i.e. the grey box surrounding the tab text does not go away until I use DPAD_DOWN to "go down" to the fragment). </p>
  
  <p>Tried 
  <code>((ViewGroup) tabLayout.getChildAt(0)).getChildAt(desiredPosition).clearFocus()</code> and it doesn't help. 
  I don't want to use <code>viewPager.setOffscreenPageLimit(2);</code></p>
  
  <pre><code>// This is my viewpager activity class
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_view_pager);
  
      ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
      adapterViewPager = new MyPagerAdapter(getFragmentManager());
      viewPager.setAdapter(adapterViewPager);
  
      // Give the TabLayout the ViewPager
      TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
      tabLayout.setupWithViewPager(viewPager);
  
      tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
          @Override
          public void onTabSelected(TabLayout.Tab tab) {
              // Tried to clear focus of tab here, didn't help
          }
  
          @Override
          public void onTabUnselected(TabLayout.Tab tab) {
  
          }
  
          @Override
          public void onTabReselected(TabLayout.Tab tab) {
  
          }
      });
  }
  
  
  public static class MyPagerAdapter extends FragmentPagerAdapter {
      private static int NUM_ITEMS = 3;
  
      public MyPagerAdapter(FragmentManager fragmentManager) {
          super(fragmentManager);
      }
  
      // Returns total number of pages.
      @Override
      public int getCount() {
          return NUM_ITEMS;
      }
  
      // Returns the fragment to display for a particular page.
      @Override
      public Fragment getItem(int position) {
          switch (position) {
              case 0:
                  return new OneFragment; // This is the fragment that needs focus
              case 1:
                  return new TwoFragment();
              case 2:
                  return new ThreeFragment();
              default:
                  return null;
          }
      }
  
      // Returns the page title for the top indicator
      @Override
      public CharSequence getPageTitle(int position) {
          if (position == 0) {
              return "Fragment 1";
          } else if (position == 1) {
              return "Fragment 2";
          } else {
              return "Fragment 3";
          }
      }
  
  }
  
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;android.support.design.widget.TabLayout
          android:id="@+id/sliding_tabs"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          app:tabMode="fixed"
          android:theme="@style/AppThemeTab" /&gt;
  
      &lt;android.support.v4.view.ViewPager
          android:id="@+id/viewPager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
      &lt;/android.support.v4.view.ViewPager&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Any help is appreciated, thank you!</p>