title: Add DividerItemDecoration both sides of recyclerView
body: <p>I'm trying make <strong>GUI</strong> for an app in Android I'm novice in that.</p>
  
  <p>First I make a horizontal <code>recyclerView</code>, add <code>DividerItemDecoration</code> with a custom drawable and and setup <code>LinearSnapHelper</code> for always snap to center.</p>
  
  <p>It works, but the left side is next to side of the screen because <code>dividerItemDecorator</code> only put the line between elements.</p>
  
  <p><a href="https://i.stack.imgur.com/esTrc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/esTrc.png" alt="enter image description here"></a> </p>
  
  <p>Exists any way to put divider at start of the <code>recycler</code>, I have tried put some padding or margin but when I slide it "cuts" before reach the end of the screen</p>
  
  <p>Sorry in advance for the English</p>
  
  <p><strong>My code is</strong></p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>@BindView(R.id.rvRecentNews)
  RecyclerView rvRecentNews;
  private ArrayList&lt;String&gt; horizontalList;
  private HorizontalAdapter horizontalAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_activity);
      ButterKnife.bind(this);
  
  horizontalList=new ArrayList&lt;&gt;();
      horizontalList.add("horizontal 1");
      horizontalList.add("horizontal 2");
      horizontalList.add("horizontal 3");
      horizontalList.add("horizontal 4");
      horizontalList.add("horizontal 5");
      horizontalList.add("horizontal 6");
      horizontalList.add("horizontal 7");
      horizontalList.add("horizontal 8");
      horizontalList.add("horizontal 9");
      horizontalList.add("horizontal 10");
  
      horizontalAdapter=new HorizontalAdapter(horizontalList);
  
      LinearLayoutManager horizontalLayoutManagaer
              = new LinearLayoutManager(MainActivity.this, LinearLayoutManager.HORIZONTAL, false);
      rvRecentNews.setLayoutManager(horizontalLayoutManagaer);
  
      DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(rvRecentNews.getContext(),
              horizontalLayoutManagaer.getOrientation());
      dividerItemDecoration.setDrawable(getApplicationContext().getResources().getDrawable(R.drawable.line_divider));
  
      rvRecentNews.addItemDecoration(dividerItemDecoration);
  
      SnapHelper helper = new LinearSnapHelper();
      helper.attachToRecyclerView(rvRecentNews);
  
      rvRecentNews.setAdapter(horizontalAdapter);
  
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  app:layout_behavior="@string/appbar_scrolling_view_behavior"
  android:orientation="vertical"
  tools:context="com.sgd.pawfriends.MainActivity"
  tools:showIn="@layout/app_bar_main"&gt;
  
  &lt;ScrollView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
              android:layout_marginTop="8dp"
              android:id="@+id/rvRecentNews"
              android:layout_width="match_parent"
              android:layout_height="200dp"
  
              app:layout_behavior="@string/appbar_scrolling_view_behavior" /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/ScrollView&gt;
  
  &lt;Button
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="salir"
      android:onClick="logout"
      /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Thanks in advance</p>