title: Carousel - Reduce the space between the items
body: <p>I have some images displaying using carousel effect:</p>
  
  <p>Here is the code:</p>
  
  <p>** carousel_main.xml **
      
      </p>
  
  <pre><code>    &lt;com.digitalaria.gama.carousel.Carousel
          android:id="@+id/carousel"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal"/&gt;    
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>** carousel_item.xml **</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;
  
      &lt;ImageView 
          android:id="@+id/itemImage" 
          android:layout_width="match_parent"    
          android:layout_height="match_parent" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>java file:</p>
  
  <pre><code> @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.carousel_main);
  
      init();
      }
  
  private void init() {
  // create the carousel object.
  carousel = (Carousel) findViewById(R.id.carousel);
  
  // configurations for the carousel.
  carousel.setType(Carousel.TYPE_COVERFLOW);
  carousel.setOverScrollBounceEnabled(true);
  carousel.setInfiniteScrollEnabled(false);
  carousel.setItemRearrangeEnabled(true);
  
  // set images for the carousel.
  adapter = new ImageAdapter(this);
  carousel.setAdapter(adapter);
  
  // change the first selected position.
  carousel.setCenterPosition(3);
  }
  public class ImageAdapter extends BaseAdapter {
      private Context mContext;
  
      public ImageAdapter(Context c) {
          mContext = c;
      }
  
      @Override
      public int getCount() {
          return musicCover.length;
      }
  
      @Override
      public Object getItem(int position) {
          return null;
      }
  
      @Override
      public long getItemId(int position) {
          return musicCover[position];
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          View view = convertView;
          if (view == null) {
          view = LayoutInflater.from(mContext).inflate(R.layout.carousel_item, parent, false);
          view.setLayoutParams(new Carousel.LayoutParams(450, 450));
  
          ViewHolder holder = new ViewHolder();
          holder.imageView = (ImageView) view.findViewById(R.id.itemImage);
  
          view.setTag(holder);
          }
  
          ViewHolder holder = (ViewHolder) view.getTag();
          holder.imageView.setImageResource(musicCover[position]);
  
          return view;
      }
  
      private class ViewHolder {
          ImageView imageView;
      }
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Wusen.png" alt="enter image description here"></p>
  
  <p>In the image you can see that there is lot of space between the left, middle and right (the black space).</p>
  
  <p>What is happening is if i increase the size of the <code>view.setLayoutParams(new Carousel.LayoutParams(450, 450));</code>  to 600,600 then the left and right items will not be visible.</p>
  
  <p>How to solve this?.</p>