title: Android -- Gallery.onItemSelected() causes scrolling to snap
body: <p>I have a Gallery with arrow indicators that show whether there are images to the left or right.</p>
  
  <pre><code>      &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:background="@color/black"
          android:layout_weight="1" &gt;
            &lt;com.package.views.MyGallery
              android:id="@+id/carGallery"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:spacing="2dip"
              android:fadingEdge="none" /&gt;
            &lt;ImageView
              android:id="@+id/prev"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerVertical="true"
              android:src="@drawable/left_orange_arrow"
              android:paddingLeft="25dip" /&gt;
            &lt;ImageView
              android:id="@+id/next"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_centerVertical="true"
              android:layout_alignParentRight="true"
              android:src="@drawable/right_orange_arrow"
              android:paddingRight="25dip" /&gt;
        &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I update the arrows as such:</p>
  
  <pre><code>carGallery.setOnItemSelectedListener(new OnItemSelectedListener(){
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; adapter, View view, final int position, long id) {
          Car car = carAdapter.getCar(position);
          top.setText(car.nickname);
          bottom.setText(car.year+" "+car.make+" "+car.model);
  
          if(carAdapter.getItems().size() == 1) {
              prev.setVisibility(View.GONE);
              next.setVisibility(View.GONE);
          }
          else if(position == 0) {
              prev.setVisibility(View.GONE);
              next.setVisibility(View.VISIBLE);
          }
          else if(position == carAdapter.getItems().size()-1) {
              prev.setVisibility(View.VISIBLE);
              next.setVisibility(View.GONE);
          }
          else {
              prev.setVisibility(View.VISIBLE);
              next.setVisibility(View.VISIBLE);
          }
      }
  });
  </code></pre>
  
  <p>Any time I change the visibility of an arrow, the Gallery snaps to the item that just scrolled in to selection.  I know that Gallery.onItemSelected() is causing the snapping because when I do Gallery.setCallbackDuringFling(false), it doesn't do the snapping on a fling until the final item is selected.</p>
  
  <p>What can I do to stop Gallery from snapping like this?</p>
  
  <p>Thanks in advance!</p>