title: How to access data binding variable from a BindingAdapter
body: <p>Say for instance I have the following variable in my data bound XML.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;layout ...&gt;
      &lt;data&gt;
          &lt;variable name="listener" type="com.xyz.Listener" /&gt;
          &lt;!-- and other variables --&gt;
      &lt;/data&gt;
      ...
  &lt;/layout&gt;
  </code></pre>
  
  <p>I use this variable in every single one of my data-bound layouts, and I need to access it in almost every single one of my <code>@BindingAdapter</code>. For instance, my binding adapters mostly look like this.</p>
  
  <pre><code>@BindingAdapter("board")
  fun setBoard(view: TextView, board: Board) {
      view.setText(board.name)
      view.setOnClickListener {
          listener.onBoardClicked(board)
      }
  }
  
  @BindingAdapter("topic")
  fun setTopic(view: TextView, topic: Topic) {
      view.setText(topic.name)
      view.setOnClickListener {
          listener.onTopicClicked(topic)
      }
  }
  
  // and a few others like that
  </code></pre>
  
  <p>and I use them like this</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;TextView ... app:board="@{board}" ... /&gt;
  &lt;TextView ... app:topic="@{topic}" ... /&gt;
  </code></pre>
  
  <p>What I need here is a way to access that <code>listener</code> variable declared in the <code>data</code> block to all of my binding adapters. Is there a way to do that without manually passing it as a second variable every single time?</p>
  
  <pre><code>// I know I can do this - looking for an alternative
  @BindingAdapter({"board", "listener"})
  fun setBoard(view: TextView, board: Board, listener: Listener) {
      view.setText(board.name)
      view.setOnClickListener {
          listener.onBoardClicked(board)
      }
  }
  </code></pre>
  
  <p>I am using Kotlin here, but a solution in Java works just fine for me as well.</p>