flipper 위에 addView를 사용해 ImageView 를 올리고

터치 이벤트를 써서 원하는 방향으로 슬라이드 되게 하였습니다...

왼쪽은 잘되는데 오른쪽으로 갈때 문제가 생기네요;;;

왼쪽으로 갈때는

   flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.left_in));
   flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.left_out));
   flipper.showNext();

을 실행하고 오른쪽으로 갈때는

   flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.right_in));
   flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.right_out));
   flipper.showPrevious();

을 실행합니다.

왼쪽으로 갈때는 잘 되는데

오른쪽으로 갈때 (1,2번 사진이 있을때 2번에서 1번으로 옮기면)

2번과 1번이 사진이 바뀌면서 오른쪽 슬라이딩이 되고 다시 2번과 1번 사진이 바뀝니다 --;

결과 적으로는 맞게 나오는데 슬라이딩 될때 이미지가 두번 뒤바뀌는..

   flipper.addView(imgView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
    ViewGroup.LayoutParams.FILL_PARENT));
   imgView.setOnTouchListener(new OnTouchListener(){
    float startX=0, startY=0;
    public boolean onTouch(View v, MotionEvent event){
      ...
      ...
      if(왼쪽으로 터치){
       if(gapX > 0){
        anim(0);
        flipper.showNext();
       }
       else{
        anim(1);
        flipper.showPrevious();
       }
      }
     }
     return true;
    }    
   });

위에서 anim() 은

 public void anim(Integer type){
  if(type == 0){
   flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.left_in));
   flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.left_out));
  } else{
   flipper.setInAnimation(AnimationUtils.loadAnimation(this, R.anim.right_in));
   flipper.setOutAnimation(AnimationUtils.loadAnimation(this, R.anim.right_out));
  }
 }

입니다.