title: position of ViewPager item with Data Binding
body: <p>I have implemented <code>ViewPager</code> with use of android Data Binding, it is working perfect with data and click events.</p>
  
  <p>I have created <code>interface</code> for click event</p>
  
  <pre><code>public interface ItemClickListener {
      public void onItemClick();
  }
  </code></pre>
  
  <p>Here is my <code>instantiateItem()</code> of <code>PagerAdapter</code></p>
  
  <pre><code>@Override
  public Object instantiateItem(ViewGroup container, final int position) {
      ListItemBinding binding = DataBindingUtil.inflate(mLayoutInflater, R.layout.list_item, container, false);
      binding.setHandler(itemClickListener);
      binding.getRoot().setTag(position);
      container.addView(binding.getRoot());
      return binding.getRoot();
  }
  </code></pre>
  
  <p>i am sending <code>itemClickListener</code> in adapter constructor.</p>
  
  <pre><code>public MatchListAdapter(Context context, ItemClickListener itemClickListener) {
      mContext = context;
      mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      this.itemClickListener= itemClickListener;
  }
  </code></pre>
  
  <p>Here is my <code>list_item.xml</code></p>
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;data&gt;
          &lt;variable
             name="handler"
             type="com.example.ItemClickListener" /&gt;
      &lt;/data&gt;
  
      &lt;LinearLayout
          android:id="@+id/root_viewItem"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:onClick="@{() -&gt; handler.onItemClick()}"
          android:orientation="vertical"&gt;
  
          //rest views and controls.
  
     &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Now problem is that i want to pass <strong>position of clicked item</strong>, how to pass that position from xml? As i have called my method from xml how to pass position?</p>