코드보시면 아시겠지만
터치리스너로..

좌우를 구별해서 if문으로 구현하는데요.

현재 이미지에서 터치리스너를 받으면

거기에 해당하는방향으로 애니메이션이 되게됫는데

바뀌어질 이미지가 애니메이션이 되네요.

이미지뷰를 다시선언해보고 쓰레드로도  해보려고했는데

안되네요...

현재이미지가 애니메이션 된후 다음이미지로 넘어갈 방법이 없을까요???


public boolean onTouch(View v, MotionEvent event) {
  // TODO Auto-generated method stub
  
  Log.i("Testing..", "ACTION_DOWN : " +event.getX());
        Log.i("Testing..", "ACTION_UP : " +event.getX());
       
        Log.i("Testing..", "ACTION_UP : " + event.getAction());
    
        if(event.getAction() == MotionEvent.ACTION_DOWN) {
   curX = event.getX();
   
   Log.i("Testing..", "ACTION_DOWN");
         }
         else if(event.getAction() == MotionEvent.ACTION_UP){
   newX = event.getX();
   Log.i("Testing..", "ACTION_UP");           
           
           Log.i("Testing..", "curX : " + curX);
                 Log.i("Testing..", "newX : " + newX);
           
                 if(newX  > curX + 100) {
                  img.startAnimation(right);
                                  
                 }else if(newX  < curX - 100) {
                  img.startAnimation(left);
                 }        
                
                
                
                 if(newX  > curX + 100) {
                 // Toast.makeText(imageview.this, "left", Toast.LENGTH_SHORT).show();
                 
                    
               
                    Drawable image = null;
              FileInputStream in;
              BufferedOutputStream out;
              try {
               
                
               
               in = new FileInputStream(list[pos - 1]);
               final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
               out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
               copy(in, out);
               out.flush();

               final byte[] data = dataStream.toByteArray();
               Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
               bitmap.compress(CompressFormat.JPEG, 30, out);
               image = new BitmapDrawable(bitmap);
               ImageView img = (ImageView)findViewById(R.id.imgview);
               img.setBackgroundDrawable(image);
               
              }catch(ArrayIndexOutOfBoundsException e){
                  
               Toast.makeText(imageview.this, "처음사진", Toast.LENGTH_SHORT).show();
               pos = 1;
              }catch(OutOfMemoryError e){
               Toast.makeText(imageview.this, "사진사이즈가 큼", Toast.LENGTH_SHORT).show(); 
              } catch (IOException e) {
               Log.v("a", "fail");
               
              }
              
               pos = pos - 1 ;
     
                         
               
                }else if(newX  < curX - 100) {
                 //Toast.makeText(imageview.this, "right", Toast.LENGTH_SHORT).show();
                      
           
                 
                    Drawable image = null;
              FileInputStream in;
              BufferedOutputStream out;
              try {
               
               
               in = new FileInputStream(list[pos + 1]);
               final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
               out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
               copy(in, out);
               out.flush();

               final byte[] data = dataStream.toByteArray();
               Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
               bitmap.compress(CompressFormat.JPEG, 30, out);
               image = new BitmapDrawable(bitmap);
               ImageView img = (ImageView)findViewById(R.id.imgview);
               img.setBackgroundDrawable(image);
               
              }catch(ArrayIndexOutOfBoundsException e){
              
               Toast.makeText(imageview.this, "마지막사진", Toast.LENGTH_SHORT).show();
               pos = pos  - 1;
               Log.d("thread", Integer.toString(pos));
              }catch(OutOfMemoryError e){
               Toast.makeText(imageview.this, "사진사이즈가 큼", Toast.LENGTH_SHORT).show();
              } catch (IOException e) {
               Log.v("a", "fail");
               
                            }
                   
              pos = pos + 1 ;
              
             
           
                } 
                }
             
               
  
   return true;
 }