title: Swipe To Choose Android
body: <p>I want to make view like below image... swipe to choose in ANDROID.</p>
  
  <p><img src="https://i.stack.imgur.com/vhkMW.gif" alt="enter image description here"></p>
  
  <p>i found one library on github:</p>
  
  <p><a href="https://github.com/kikoso/Swipeable-Cards" rel="noreferrer">https://github.com/kikoso/Swipeable-Cards</a></p>
  
  <p><a href="http://grishma102.blogspot.in/2014/04/tinder-app-like-control-with-animation.html" rel="noreferrer">http://grishma102.blogspot.in/2014/04/tinder-app-like-control-with-animation.html</a></p>
  
  <p>but in this lib there no option to show image <strong>LIKED</strong> or <strong>NOPE</strong> over CARD, just like showing in above image</p>
  
  <p>can any one help me how to add these future in this library.</p>
  
  <hr>
  
  <h2>EDITED 10-10-2014</h2>
  
  <hr>
  
  <p>I have create view group class inside that i have made <strong>onTouchListener</strong> </p>
  
  <p>i am trying to get on <strong>onClickListener</strong> inside <strong>onTouchListener</strong> </p>
  
  <p><strong>my issue is when i am touch on to left and right corner before click event some time its rotate view then click is work, so how i stop it when click is work 
  another issue is when animation stop its also fire click event</strong></p>
  
  <p>any one help me to improve below code?</p>
  
  <pre><code>this.imageContainerLayout.setOnTouchListener(new OnTouchListener() {
  
              private long startClickTime;
              private float x1;
              private float y1;
              private float x2;
              private float y2;
              private float _dx;
              private float _dy;
  
              @Override
              public boolean onTouch(View v, MotionEvent event) {
                  x_cord = (int) event.getRawX();
                  y_cord = (int) event.getRawY();
  
                  Log.e("start x_cord--&gt;" + x_cord, "y_cord---&gt;" + y_cord);
  
                  boolean defaultResult = v.onTouchEvent(event);
  
                  switch (event.getAction()) {
                  case MotionEvent.ACTION_DOWN:
                      x = (int) event.getRawX();
                      y = (int) event.getRawY();
  
                      this.startClickTime = Calendar.getInstance()
                              .getTimeInMillis();
  
                      x1 = event.getRawX();
                      y1 = event.getRawY();
  
                      return true;
                  case MotionEvent.ACTION_MOVE:
                      x_cord = (int) event.getRawX(); // Updated for more
                                                      // smoother animation.
                      y_cord = (int) event.getRawY();
  
                      Log.e("move x_cord--&gt;" + x_cord, "y_cord---&gt;" + y_cord);
  
                      CardView_new.this.setX(event.getRawX() - x);
                      CardView_new.this.setY(event.getRawY() - y);
  
                      if (x_cord &gt;= screenCenter) {
  
                          /**
                           * rotate image 
                           * */
  
  
                              CardView_new.this
                                      .setRotation((float) (0.02454369260617026D * (x_cord - screenCenter)));
  
                          if (x_cord &gt; (screenCenter + (screenCenter / 2))) {
                              buttonLike.setAlpha(1);
                              buttonDislike.setAlpha(0);
                              if (x_cord &gt; (windowwidth - (screenCenter / 4))) {
                                  Likes = 2;
                                  moveIs = true;
                              } else {
                                  Likes = 0;
                                  moveIs = true;
                              }
  
                          } else {
                              Likes = 0;
                              buttonLike.setAlpha(0);
                              moveIs = false;
                          }
                          buttonDislike.setAlpha(0);
                      } else {
                          // rotate
                          /**
                           * rotate image 
                           * */
  
  
                              CardView_new.this
                                      .setRotation((float) (0.02454369260617026D * (x_cord - screenCenter)));
  
  
                          if (x_cord &lt; (screenCenter / 2)) {
                              buttonDislike.setAlpha(1);
                              buttonLike.setAlpha(0);
                              if (x_cord &lt; (screenCenter / 4)) {
                                  Likes = 1;
                                  moveIs = true;
                              } else {
                                  Likes = 0;
                                  moveIs = true;
                              }
  
                          } else {
                              Likes = 0;
                              buttonDislike.setAlpha(0);
                              moveIs = false;
                          }
                          buttonLike.setAlpha(0);
                      }
  
                      return true;
                  case MotionEvent.ACTION_UP:
                      x_cord = (int) event.getRawX();
                      y_cord = (int) event.getRawY();
  
                      buttonDislike.setAlpha(0);
                      buttonLike.setAlpha(0);
  
                      x2 = event.getRawX();
                      y2 = event.getRawY();
  
                      _dx = x2 - x1;
                      _dy = y2 - y1;
  
                      long l = Calendar.getInstance().getTimeInMillis()
                              - this.startClickTime;
                      if ((l &lt; 400L)
                              &amp;&amp; distance(x1, y1, x2, y2) &lt; MAX_CLICK_DISTANCE) {
  
                          Log.e("start Activity", "start activity");
  
                          CardView_new.this.setX(0);
                          CardView_new.this.setY(0);
                          CardView_new.this.setRotation(0);
  
                          if (moveIs == false) {
                              Intent i = new Intent((Activity) getContext(),
                                      DetailsActivity.class);
  
                              ((Activity) getContext()).startActivity(i);
                          }
  
                          return true;
                      } else if (Likes == 0) {
                          CardView_new.this.setX(0);
                          CardView_new.this.setY(0);
                          CardView_new.this.setRotation(0);
                          if (moveIs) {
                              moveIs = true;
                              return true;
                          } else {
                              moveIs = false;
                              return false;
                          }
                      } else if (Likes == 1) {
                          parentView.removeView(CardView_new.this);
                          CardView_new.this.mOnCardDimissedDelegate
                                  .onLike(CardView_new.this);
                          Log.e("Likes==1", "Likes==1");
                          moveIs = true;
                          return true;
                      } else if (Likes == 2) {
                          parentView.removeView(CardView_new.this);
  
                          CardView_new.this.mOnCardDimissedDelegate
                                  .onDislike(CardView_new.this);
                          Log.e("Likes==2", "Likes==2");
                          moveIs = true;
                          return true;
                      }
  
                  default:
                      return false;
                  }
              }
          }); 
  </code></pre>