title: images are too far into LinearLayout and HorizontalScrollView
body: <p>how can i set the ranges of Images which are in the HorizontalScrollView</p>
  
  <p>As you can see the images are not so close between themselves, i need them to be close.</p>
  
  <p>This is my code for the HorizontalScrollView xml file:</p>
  
  <pre><code> &lt;HorizontalScrollView
  android:layout_width="wrap_content"
  android:layout_height="5dp"
  android:id="@+id/hscrollview"
  android:layout_weight="0.2"&gt;
  
  &lt;LinearLayout
      android:id="@+id/container"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:orientation="horizontal" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is what i have tried programmatically.</p>
  
  <pre><code>private ImageView getImageView(final Integer image, final int index) {
  
      imageView = new ImageView(getApplicationContext());
      LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
      lp.setMargins(0, 0, 0, 0);
  
      imageView.setLayoutParams(lp);
  
      imageView.setScaleType(ImageView.ScaleType.FIT_XY);
      imageView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              viewPager.setCurrentItem(index);
  
          }
      });
  
     imageView.setImageResource(image);
  
      return imageView;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9s7Bi.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9s7Bi.gif" alt="enter image description here"></a></p>