title: Find center point of TouchImageView using TouchImageView.java class
body: <p>I have two TouchImageView. What I want to achieve is that, When I swipe first TouchImageView from left to right, second TouchImageView get swiped right to left automatically. I am using TouchImageView.java class which I have founded at GitHub. Below is my code.</p>
  
  <p>activity_main.xml</p>
  
  <pre><code>    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:orientation="horizontal"
      android:weightSum="2"
      tools:context="com.PinchZoom.pinchzoomexampletwo.MainActivity" &gt;
  
      &lt;com.PinchZoom.pinchzoomexampletwo.TouchImageView
          android:id="@+id/img_to_be_zoomed"
          android:layout_width="100dp"
          android:layout_height="100dp"
          android:layout_weight="1"
          android:src="@drawable/fb" &gt;
      &lt;/com.PinchZoom.pinchzoomexampletwo.TouchImageView&gt;
  
      &lt;com.PinchZoom.pinchzoomexampletwo.TouchImageView
          android:id="@+id/img_to_be_zoomed_mirror"
          android:layout_width="100dp"
          android:layout_height="100dp"
          android:layout_weight="1"
          android:src="@drawable/fb" &gt;
      &lt;/com.PinchZoom.pinchzoomexampletwo.TouchImageView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>MainActivity.java</p>
  
  <pre><code>package com.PinchZoom.pinchzoomexampletwo;
  
  import android.graphics.PointF;
  import android.os.Bundle;
  import android.support.v7.app.ActionBarActivity;
  import android.util.Log;
  
  import com.PinchZoom.pinchzoomexampletwo.TouchImageView.OnTouchImageViewListener;
  
  public class MainActivity extends ActionBarActivity {
      TouchImageView img_to_be_zoomed;
      TouchImageView img_to_be_zoomed_mirror;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          img_to_be_zoomed = (TouchImageView) findViewById(R.id.img_to_be_zoomed);
          img_to_be_zoomed
                  .setOnTouchImageViewListener(new OnTouchImageViewListener() {
  
                      @Override
                      public void onMove() {
  
                          img_to_be_zoomed_mirror.setZoom(img_to_be_zoomed);
  
                          Log.e("X Scroll Point: ",
                                  "" + img_to_be_zoomed.getScrollPosition());
                      }
                  });
  
          img_to_be_zoomed_mirror = (TouchImageView) findViewById(R.id.img_to_be_zoomed_mirror);
          img_to_be_zoomed_mirror
                  .setOnTouchImageViewListener(new OnTouchImageViewListener() {
  
                      @Override
                      public void onMove() {
                          // TODO Auto-generated method stub
                          img_to_be_zoomed.setZoom(img_to_be_zoomed_mirror);
                          PointF s = new PointF();
                          PointF q = new PointF();
                          s = img_to_be_zoomed.getScrollPosition();
                          q = img_to_be_zoomed_mirror.getScrollPosition();
                          img_to_be_zoomed.setScrollPosition(s.x
                                  - (q.x - img_to_be_zoomed.getX()), s.y);
                          Log.e("img_1", s.x + "/" + s.y);
                          Log.e("img_2", "" + q.x + "/" + q.y);
                      }
                  });
      }
  }
  </code></pre>
  
  <p>TouchImageView.java</p>
  
  <p><a href="https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/ortiz/touch/TouchImageView.java" rel="nofollow">TouchImageView.java Find Here</a></p>
  
  <p><strong>Edit:</strong>
  <em>I have solved problem using below code in MainActivity.java.</em></p>
  
  <pre><code>PointF pointF_img1 = new PointF();
  pointF_img1 = img_to_be_zoomed.getScrollPosition();
  img_to_be_zoomed_mirror.setScrollPosition(1 - pointF_img1.x, pointF_img1.y);
  </code></pre>