title: ViewPager like of thing in BrowseFragment in AndroidTV
body: <p>I am new in Android TV. Please have a look to the below attached image.</p>
  
  <p><a href="https://i.stack.imgur.com/hl1YT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hl1YT.png" alt="enter image description here"></a></p>
  
  <p>on the top of this picture there is a crousel and all the red marked area are the images.</p>
  
  <p>i want to make this screen in Android TV. i have use BrowseFragment for this. I have use two Presenter one for First Row and another for other row. </p>
  
  <p>The code which i have used : </p>
  
  <p><strong>HomeFragment.java</strong></p>
  
  <pre><code>    private  CustomListRowPresenter mListRowPresenter;
      private void loadRows() {
          List&lt;Movie&gt; list = MovieList.setupMovies();
          mListRowPresenter = new CustomListRowPresenter(getActivity(),this);
          mRowsAdapter = new ArrayObjectAdapter(mListRowPresenter);
          CardPresenter cardPresenter = new CardPresenter(getActivity());
  
          mNumberOfRows = NUM_ROWS;
          HeaderItem gridHeader = new HeaderItem(0, "");
          GridItemPresenter mGridPresenter = new GridItemPresenter();
          ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
          gridRowAdapter.add(getResources().getString(R.string.grid_view));
          gridRowAdapter.add(getString(R.string.error_fragment));
          gridRowAdapter.add(getResources().getString(R.string.personal_settings));
          mRowsAdapter.add(new ListRow(gridHeader, gridRowAdapter));
  
          int i;
          for (i = 1; i &lt; NUM_ROWS; i++) {
              if (i != 0) {
                  Collections.shuffle(list);
              }
              ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
              for (int j = 1; j &lt; NUM_COLS; j++) {
                  listRowAdapter.add(list.get(j % 5));
              }
              HeaderItem header = new HeaderItem(i, MovieList.MOVIE_CATEGORY[i]);
              mRowsAdapter.add(new ListRow(header, listRowAdapter));
          }
  
  
  
          setAdapter(mRowsAdapter);
  
      }
  </code></pre>
  
  <p><strong>CardPresenter.java</strong></p>
  
  <pre><code>public class CardPresenter extends Presenter {
      private static final String TAG = "CardPresenter";
  
      private static int CARD_WIDTH = 360;
      private static int CARD_HEIGHT = 160;
      private static int sSelectedBackgroundColor;
      private static int sDefaultBackgroundColor;
      private Drawable mDefaultCardImage;
      private Activity mActivity;
  
      public CardPresenter(Activity activity){
          mActivity = activity;
      }
  
      public CardPresenter(){
       }
      @Override
      public ViewHolder onCreateViewHolder(ViewGroup parent) {
          Log.d(TAG, "onCreateViewHolder");
  
          sDefaultBackgroundColor = parent.getResources().getColor(R.color.default_background);
          sSelectedBackgroundColor = parent.getResources().getColor(R.color.selected_background);
          mDefaultCardImage = parent.getResources().getDrawable(R.drawable.movie);
  /*
          ImageCardView cardView = new ImageCardView(parent.getContext()) {
              @Override
              public void setSelected(boolean selected) {
                  updateCardBackgroundColor(this, selected);
                  super.setSelected(selected);
              }
          };
  
          cardView.setFocusable(true);
          cardView.setFocusableInTouchMode(true);
          cardView
                  .setBackgroundResource(R.drawable.gridview_cell_border);
          updateCardBackgroundColor(cardView, false);*/
  
          View view = mActivity.getLayoutInflater().inflate(R.layout.gridview_cell_rows, parent,
                  false);
          LinearLayout linearLayout = (LinearLayout)view.findViewById(R.id.container_grid_view_item);
          linearLayout.setBackgroundResource(R.drawable.gridview_cell_border);
  
          view.setFocusable(true);
  
          ViewHolder viewHolder = new ViewHolder(view);
          return viewHolder;
  
       }
  
      private static void updateCardBackgroundColor(ImageCardView view, boolean selected) {
          int color = selected ? sSelectedBackgroundColor : sDefaultBackgroundColor;
          // Both background colors should be set because the view's background is temporarily visible
          // during animations.
          view.setBackgroundColor(color);
          view.findViewById(R.id.info_field).setBackgroundColor(color);
      }
  
      @Override
      public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
          Movie movie = (Movie) item;
          View cardView = (View) viewHolder.view;
          ImageView imageView = (ImageView)cardView.findViewById(R.id.imageView);
          LinearLayout linearLayout = (LinearLayout)cardView.findViewById(R.id.container_grid_view_item);
          linearLayout.setBackgroundResource(R.drawable.gridview_cell_border);
          Log.d(TAG, "onBindViewHolder");
          if (movie.getCardImageUrl() != null) {
             /* cardView.setTitleText(movie.getTitle());
              cardView.setContentText(movie.getStudio());
              cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);*/
              Glide.with(viewHolder.view.getContext())
                      .load(movie.getCardImageUrl())
                      .centerCrop()
                      .error(mDefaultCardImage)
                      .into(imageView);
          }
  
  
      }
  
      @Override
      public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
          Log.d(TAG, "onUnbindViewHolder");
          View cardView = (View) viewHolder.view;
          // Remove references to images so that the garbage collector can free up memory
  
      }
  </code></pre>
  
  <p>So for first row i have used CardPresenter and for other row i have used GridPresenter.</p>
  
  <p>My Requirment is that this viewpager type of thing should be auto rotate in every 5 second. </p>
  
  <p>So Please help me how can i design this fragment.</p>