title: Unable to find center of view?
body: <p>I am trying to find the center child but everytime I execute the check below,the else part gets executed,I don't know why...Oh and by the way I am trying to edit 3dcoursel </p>
  
  <pre><code> if (childCenter &gt;= galleryCenter)///check if the image is in the centre 
          {Log.i("HOLA///", " you are awesome");
          }   
       else {
              Log.i("HOLA///", " you too are awesome ");
       }
  
  
  
  
  
  
  galleryCenter = getCenterOfGallery();
  childCenter = getCenterOfView(child);
  
  
  
    private static int getCenterOfView(View view) {
          return view.getLeft() + view.getWidth() / 2;
      }   
  
  
  
  
   private int getCenterOfGallery() {
          return (getWidth() - Carousel.this.getPaddingLeft() - Carousel.this.getPaddingRight()) / 2 + 
              Carousel.this.getPaddingLeft();
      }
  </code></pre>